Skip to main content

Multi-recipe Overcooked used in LIPO

A variant of https://github.com/DavidRother/cooking_zoo used in LIPO.

Installation

pip install gym-cooking-lipo

Examples

Environment creation

from gym_cooking.environment.game.game import Game
from gym_cooking.environment import cooking_zoo

n_agents = 2
max_steps = 100
render = False

level = "full_divider_salad_4"
seed = 1
record = False
max_num_timesteps = 1000
recipes = [
    "LettuceSalad",
    "TomatoSalad",
    "TomatoLettuceSalad",
    "TomatoCarrotSalad",
    "ChoppedCarrot",
    "ChoppedOnion",
]

env = parallel_env = cooking_zoo.parallel_env(
    level=level,
    num_agents=n_agents,
    record=record,
    max_steps=max_num_timesteps,
    recipes=recipes,
    obs_spaces=["dense"],
)
obs = env.reset()
print(obs)

Human-AI gameplay

from gym_cooking.environment.game.game import Game
from gym_cooking.environment import cooking_zoo

n_agents = 2
num_humans = 1
max_steps = 100
render = False

level = "full_divider_salad_4"  # 'open_room_salad_easy'
seed = 1
record = False
max_num_timesteps = 1000
recipes = [
    "LettuceSalad",
    "TomatoSalad",
    "ChoppedCarrot",
    "ChoppedOnion",
    "TomatoLettuceSalad",
    "TomatoCarrotSalad",
]

parallel_env = cooking_zoo.parallel_env(
    level=level,
    num_agents=n_agents,
    record=record,
    max_steps=max_num_timesteps,
    recipes=recipes,
    obs_spaces=["dense"],
    interact_reward=0.5,
    progress_reward=1.0,
    complete_reward=10.0,
    step_cost=0.05,
)

action_spaces = parallel_env.action_spaces


class CookingAgent:

    def __init__(self, action_space):
        self.action_space = action_space

    def get_action(self, observation) -> int:
        return self.action_space.sample()


player_2_action_space = action_spaces["player_1"]
cooking_agent = CookingAgent(player_2_action_space)
game = Game(parallel_env, num_humans, [cooking_agent], max_steps, render=False)
store = game.on_execute()

print("done")

Single-player gameplay

from gym_cooking.environment.game.game import Game
from gym_cooking.environment import cooking_zoo


n_agents = 1
num_humans = 1
max_steps = 100
render = False

level = "open_room_blender"
seed = 1
record = False
max_num_timesteps = 100
recipes = ["ChoppedCarrot", "LettuceSalad"]

parallel_env = cooking_zoo.parallel_env(
    level=level,
    num_agents=n_agents,
    record=record,
    max_steps=max_num_timesteps,
    recipes=recipes,
    obs_spaces=["dense"],
)

game = Game(parallel_env, num_humans, [], max_steps)
store = game.on_execute()

print("done")

Metadata

Release files for gym-cooking-lipo 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gym-cooking-lipo 0.0.2
File Size Uploaded
gym_cooking_lipo-0.0.2.tar.gz 2.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for gym-cooking-lipo 0.0.2
File Interpreter ABI Platform
gym_cooking_lipo-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 5.9 MB

Release files / gym_cooking_lipo-0.0.2.tar.gz

Download URL gym_cooking_lipo-0.0.2.tar.gz
Size 2.9 MB
Tags Source
SHA-256 checksum
How to use checksums
dba9cf342d2a165db5acc077d50f9897c224dd6846628605338dad0af9d7d2e8
BLAKE2b-256 checksum
How to use checksums
8858e02819d4914cc1d0323ff419201f6f74177a1261f5aae9729ad20748df6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.19

Release files / gym_cooking_lipo-0.0.2-py3-none-any.whl

Download URL gym_cooking_lipo-0.0.2-py3-none-any.whl
Size 2.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
bff8c20c56ba929f6f1904372649b63767ec83e6c11c51cc872224d1042ca112
BLAKE2b-256 checksum
How to use checksums
27f61a4536ce9897c7a8e7b92c2d5651ac0f4e806032c7a837759ba4bbb5a85d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.19

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page