Skip to content
Snippets Groups Projects
Commit b83ba205 authored by Florian Schröder's avatar Florian Schröder
Browse files

Add drop-off interaction with cooking equipment

The code now includes a new hook called 'drop_off_on_cooking_equipment'. This hook is used to track and score instances of players dropping off items on the cooking equipment in the Overcooked game simulator. This enhancement will allow for more detailed game simulations and scoring capabilities.
parent f33ce3c8
No related branches found
No related tags found
1 merge request!52Resolve "gym env"
Pipeline #45797 passed
......@@ -61,6 +61,7 @@ from overcooked_simulator.hooks import (
DROP_ON_SINK_ADDON,
PICK_UP_FROM_SINK_ADDON,
PLATE_OUT_OF_KITCHEN_TIME,
DROP_OFF_ON_COOKING_EQUIPMENT,
)
if TYPE_CHECKING:
......@@ -197,6 +198,12 @@ class Counter:
if self.occupied_by is None:
self.occupied_by = item
elif self.occupied_by.can_combine(item):
self.hook(
DROP_OFF_ON_COOKING_EQUIPMENT,
item=item,
equipment=self.occupied_by,
counter=self,
)
return self.occupied_by.combine(item)
return None
......
......@@ -123,7 +123,13 @@ extra_setup_functions:
callback_class: !!python/name:overcooked_simulator.scores.ScoreViaHooks ''
callback_class_kwargs:
static_score: -1
combine:
func: !!python/name:overcooked_simulator.hooks.hooks_via_callback_class ''
kwargs:
hooks: [ drop_off_on_cooking_equipment ]
callback_class: !!python/name:overcooked_simulator.scores.ScoreViaHooks ''
callback_class_kwargs:
static_score: 20
# json_states:
# func: !!python/name:overcooked_simulator.recording.class_recording_with_hooks ''
# kwargs:
......
......@@ -107,6 +107,8 @@ ACTION_PUT = "action_put"
ACTION_INTERACT_START = "action_interact_start"
DROP_OFF_ON_COOKING_EQUIPMENT = "drop_off_on_cooking_equipment"
class Hooks:
def __init__(self, env):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment