From d8ca40de403289984455fcb5d8c53952b160feb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Schr=C3=B6der?= <fschroeder@techfak.uni-bielefeld.de> Date: Sat, 27 Jan 2024 03:15:11 +0100 Subject: [PATCH] Add OrderConfig and EnvironmentConfig classes in utils.py The OrderConfig and EnvironmentConfig classes were added to the utils.py file in the Overcooked simulator. These classes help define the structure and type of orders and environments used in the simulation, contributing to the manageability and modularity of the codebase. --- overcooked_simulator/utils.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/overcooked_simulator/utils.py b/overcooked_simulator/utils.py index ecfb5958..d3807995 100644 --- a/overcooked_simulator/utils.py +++ b/overcooked_simulator/utils.py @@ -3,8 +3,27 @@ import os import sys from datetime import datetime from enum import Enum +from typing import TypedDict, Literal, Type, Any, Callable, Tuple from overcooked_simulator import ROOT_DIR +from overcooked_simulator.counters import PlateConfig +from overcooked_simulator.game_items import Item +from overcooked_simulator.order import OrderGeneration +from overcooked_simulator.player import PlayerConfig + + +class OrderConfig(TypedDict): + order_gen_class: Type[OrderGeneration] + order_gen_kwargs: dict[str, Any] + serving_not_ordered_meals: Callable[[Item], Tuple[bool, float]] + + +class EnvironmentConfig(TypedDict): + plates: PlateConfig + game: dict[Literal["time_limit_seconds"], int] + meals: dict[Literal["all"] | Literal["list"], bool | list[str]] + orders: OrderConfig + player_config: PlayerConfig def create_init_env_time(): -- GitLab