Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/overcooked_ai_py/mdp/overcooked_mdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ class Recipe:

def __new__(cls, ingredients):
if not cls._configured:
raise ValueError("Recipe class must be configured before recipes can be created")
cls.configure({})
# raise ValueError("Recipe class must be configured before recipes can be created")
# Some basic argument verification
if not ingredients or not hasattr(ingredients, '__iter__') or len(ingredients) == 0:
raise ValueError("Invalid input recipe. Must be ingredients iterable with non-zero length")
Expand Down Expand Up @@ -1197,6 +1198,10 @@ def resolve_interacts(self, new_state, joint_action, events_infos):
soup.add_ingredient(obj)
shaped_reward[player_idx] += self.reward_shaping_params["PLACEMENT_IN_POT_REW"]

# Start cooking without extra INTERACT action if recipe is done
if self.soup_to_be_cooked_at_location(new_state, i_pos) and soup.is_full and soup.is_valid:
soup.begin_cooking()

# Log potting
self.log_object_potting(events_infos, new_state, old_soup, soup, obj.name, player_idx)
if obj.name == Recipe.ONION:
Expand Down
2 changes: 1 addition & 1 deletion src/overcooked_ai_py/mdp/overcooked_trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}
"""

TIMESTEP_TRAJ_KEYS = set(["ep_states", "ep_actions", "ep_rewards", "ep_dones", "ep_infos"])
TIMESTEP_TRAJ_KEYS = set(["ep_states", "ep_actions", "ep_other_actions", "ep_rewards", "ep_dones", "ep_infos"])
EPISODE_TRAJ_KEYS = set(["ep_returns", "ep_lengths", "mdp_params", "env_params"])
DEFAULT_TRAJ_KEYS = set(list(TIMESTEP_TRAJ_KEYS) + list(EPISODE_TRAJ_KEYS) + ["metadatas"])

Expand Down