diff --git a/overcooked_simulator/game_content/environment_config.yaml b/overcooked_simulator/game_content/environment_config.yaml index 08241cc4fef845185ae4cf370fd82aeabd99a7f7..a0c14fcd20f67d31ad893934fc5295f4eace3da8 100644 --- a/overcooked_simulator/game_content/environment_config.yaml +++ b/overcooked_simulator/game_content/environment_config.yaml @@ -162,18 +162,18 @@ extra_setup_functions: callback_class_kwargs: log_path: USER_LOG_DIR/ENV_NAME/LOG_RECORD_NAME.jsonl add_hook_ref: true - info_msg: - func: !!python/name:overcooked_simulator.recording.class_recording_with_hooks '' - kwargs: - hooks: [ cutting_board_100 ] - log_class: !!python/name:overcooked_simulator.info_msg.InfoMsgManager '' - log_class_kwargs: - msg: Glückwunsch du hast was geschnitten! - fire_msg: - func: !!python/name:overcooked_simulator.recording.class_recording_with_hooks '' - kwargs: - hooks: [ new_fire ] - log_class: !!python/name:overcooked_simulator.info_msg.InfoMsgManager '' - log_class_kwargs: - msg: Feuer, Feuer, Feuer - level: Warning +# info_msg: +# func: !!python/name:overcooked_simulator.hooks.hooks_via_callback_class '' +# kwargs: +# hooks: [ cutting_board_100 ] +# log_class: !!python/name:overcooked_simulator.info_msg.InfoMsgManager '' +# log_class_kwargs: +# msg: Glückwunsch du hast was geschnitten! +# fire_msg: +# func: !!python/name:overcooked_simulator.hooks.hooks_via_callback_class '' +# kwargs: +# hooks: [ new_fire ] +# log_class: !!python/name:overcooked_simulator.info_msg.InfoMsgManager '' +# log_class_kwargs: +# msg: Feuer, Feuer, Feuer +# level: Warning diff --git a/overcooked_simulator/game_server.py b/overcooked_simulator/game_server.py index 8f7006dbb1a9f2991670655d0950a70f808e29e3..84879915dce1ff120d6f7a99e405466aa9f7adce 100644 --- a/overcooked_simulator/game_server.py +++ b/overcooked_simulator/game_server.py @@ -432,13 +432,6 @@ class EnvironmentHandler: / 1_000_000_000 ) ) - - ( - grid, - player, - env_time, - orders, - ) = env_data.environment.get_vectorized_state("0") env_data.last_step_time = step_start if env_data.environment.game_ended: log.info(f"Env {env_id} ended. Set env to STOPPED.") diff --git a/overcooked_simulator/hooks.py b/overcooked_simulator/hooks.py index d53077ecc5567afe7f1d6009f599db426be889ba..ed85785782071b915f9c7e25eb23bf90c3993c94 100644 --- a/overcooked_simulator/hooks.py +++ b/overcooked_simulator/hooks.py @@ -111,6 +111,8 @@ NEW_FIRE = "new_fire" FIRE_SPREADING = "fire_spreading" +DROP_OFF_ON_COOKING_EQUIPMENT = "drop_off_on_cooking_equipment" + class Hooks: def __init__(self, env): diff --git a/overcooked_simulator/overcooked_environment.py b/overcooked_simulator/overcooked_environment.py index 9da0f8b8ac9ca674d31541f304515aaeaed8d72b..7c504995d9b76aba418910892a8b811c3232dca9 100644 --- a/overcooked_simulator/overcooked_environment.py +++ b/overcooked_simulator/overcooked_environment.py @@ -52,7 +52,7 @@ from overcooked_simulator.order import ( OrderConfig, ) from overcooked_simulator.player import Player, PlayerConfig -from overcooked_simulator.state_representation import StateRepresentation, InfoMsg +from overcooked_simulator.state_representation import InfoMsg from overcooked_simulator.utils import create_init_env_time, get_closest log = logging.getLogger(__name__) @@ -277,7 +277,7 @@ class Environment: self.counter_positions = np.array([c.pos for c in self.counters]) - self.order_and_score.create_init_orders(self.env_time) + self.order_manager.create_init_orders(self.env_time) self.start_time = self.env_time """The relative env time when it started.""" self.env_time_end = self.env_time + timedelta( diff --git a/overcooked_simulator/reinforcement_learning/environment_config_rl.yaml b/overcooked_simulator/reinforcement_learning/environment_config_rl.yaml index b6c9d3bc212547eaffdcd197c29ebc793b2f5d5c..6b9c63899331b296dfe470a2202850f32e4be98e 100644 --- a/overcooked_simulator/reinforcement_learning/environment_config_rl.yaml +++ b/overcooked_simulator/reinforcement_learning/environment_config_rl.yaml @@ -131,21 +131,21 @@ extra_setup_functions: callback_class_kwargs: static_score: 0.15 # json_states: - # func: !!python/name:overcooked_simulator.recording.class_recording_with_hooks '' + # func: !!python/name:overcooked_simulator.hooks.hooks_via_callback_class '' # kwargs: # hooks: [ json_state ] # log_class: !!python/name:overcooked_simulator.recording.LogRecorder '' # log_class_kwargs: # log_path: USER_LOG_DIR/ENV_NAME/json_states.jsonl # actions: -# func: !!python/name:overcooked_simulator.recording.class_recording_with_hooks '' +# func: !!python/name:overcooked_simulator.hooks.hooks_via_callback_class '' # kwargs: # hooks: [ pre_perform_action ] # log_class: !!python/name:overcooked_simulator.recording.LogRecorder '' # log_class_kwargs: # log_path: USER_LOG_DIR/ENV_NAME/LOG_RECORD_NAME.jsonl # random_env_events: -# func: !!python/name:overcooked_simulator.recording.class_recording_with_hooks '' +# func: !!python/name:overcooked_simulator.hooks.hooks_via_callback_class '' # kwargs: # hooks: [ order_duration_sample, plate_out_of_kitchen_time ] # log_class: !!python/name:overcooked_simulator.recording.LogRecorder '' @@ -153,7 +153,7 @@ extra_setup_functions: # log_path: USER_LOG_DIR/ENV_NAME/LOG_RECORD_NAME.jsonl # add_hook_ref: true # env_configs: -# func: !!python/name:overcooked_simulator.recording.class_recording_with_hooks '' +# func: !!python/name:overcooked_simulator.hooks.hooks_via_callback_class '' # kwargs: # hooks: [ env_initialized, item_info_config ] # log_class: !!python/name:overcooked_simulator.recording.LogRecorder ''