From 292230146ff218b87afe2d9647a1f8132c27adfa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20Schr=C3=B6der?=
 <fschroeder@techfak.uni-bielefeld.de>
Date: Wed, 31 Jan 2024 20:02:55 +0100
Subject: [PATCH] Update documentation for layout and equipment configuration

Documentation has been updated to provide better clarity on the layout and equipment configuration. The README file now includes information on defining counter mappings in the Environment config. The code examples in comments within the counters.py file have also been reformatted and updated, specifically those related to defining equipment types and dispenser characters. The additional change includes an expanded section in the __init__.py file on environment and item configuration.
---
 README.md                        |  3 ++-
 overcooked_simulator/__init__.py | 28 +++++++++++++++++++++++++++-
 overcooked_simulator/counters.py | 26 +++++++++++---------------
 3 files changed, 40 insertions(+), 17 deletions(-)

diff --git a/README.md b/README.md
index 4e7e315b..1d25c126 100644
--- a/README.md
+++ b/README.md
@@ -73,7 +73,8 @@ can be cooked/created.
 ### Layout Config
 
 You can define the layout of the kitchen via a layout file. The position of counters are based on a grid system, even
-when the players do not move grid steps but continuous steps. Each character defines a different type of counter.
+when the players do not move grid steps but continuous steps. Each character defines a different type of counter. Which
+character is mapped to which counter is defined in the Environment config.
 
 ### Environment Config
 
diff --git a/overcooked_simulator/__init__.py b/overcooked_simulator/__init__.py
index 6d127832..fb5fb7c0 100644
--- a/overcooked_simulator/__init__.py
+++ b/overcooked_simulator/__init__.py
@@ -199,7 +199,7 @@ The BaseModel and TypedDicts can be found in `overcooked_simulator.state_represe
 `overcooked_simulator.state_representation.StateRepresentation` represents the json state that the `get_json_state`
 returns.
 
-# Generate images from JSON states
+## Generate images from JSON states
 You might have stored some json states and now you want to visualize them via the
 pygame-2d visualization. You can do that by running the `drawing.py` script and referencing a json file.
 ```bash
@@ -208,6 +208,32 @@ python3 overcooked_simulator/gui_2d_vis/drawing.py --state my_state.json
 - You can specify a different visualization config with `-v` or `--visualization_config`.
 - You can specify the name of the output file with `-o` or `--output_file`. The default is `screenshot.jpg`.
 
+# Configuration
+
+The environment configuration is currently done with 3 config files + GUI configuration.
+
+## Item Config
+
+The item config defines which ingredients, cooking equipment and meals can exist and how meals and processed ingredients
+can be cooked/created.
+
+## Layout Config
+
+You can define the layout of the kitchen via a layout file. The position of counters are based on a grid system, even
+when the players do not move grid steps but continuous steps. Each character defines a different type of counter. Which
+character is mapped to which counter is defined in the Environment config.
+
+## Environment Config
+
+The environment config defines how a level/environment is defined. Here, the available plates, meals, order and player
+configuration is done.
+
+## PyGame Visualization Config
+
+Here the visualisation for all objects is defined. Reference the images or define a list of base shapes that represent
+the counters, ingredients, meals and players.
+
+
 # Citation
 
 # Structure of the Documentation
diff --git a/overcooked_simulator/counters.py b/overcooked_simulator/counters.py
index 677ef858..fdfa9b02 100644
--- a/overcooked_simulator/counters.py
+++ b/overcooked_simulator/counters.py
@@ -7,19 +7,17 @@ method, e.g., the `CuttingBoard.progress`. The environment class detects which c
 `progress` method defined and on instances of these classes the progress will be delegated.
 
 Inside the item_info.yaml, equipment needs to be defined. It includes counters that are part of the
-interaction/requirements for the interaction.
+interaction/requirements for the interaction:
+```yaml
+CuttingBoard:
+  type: Equipment
 
-Example:
-    
-    CuttingBoard:
-      type: Equipment
-
-    Sink:
-      type: Equipment
-
-    Stove:
-      type: Equipment
+Sink:
+  type: Equipment
 
+Stove:
+  type: Equipment
+```
 
 The defined counter classes are:
 - `Counter`
@@ -177,8 +175,7 @@ class Counter:
 
 
 class CuttingBoard(Counter):
-    """Cutting ingredients on. The requirement in a new object could look like
-
+    """Cutting ingredients on. The requirement in a new object could look like:
     ```yaml
     ChoppedTomato:
       type: Ingredient
@@ -312,7 +309,7 @@ class Dispenser(Counter):
 
     At the moment all ingredients have an unlimited stock.
 
-    The character for each dispenser in the `layout` file is currently hard coded in the environment class:
+    The character for each dispenser in the `layout` file is defined in the `environment_config.yml`:
     ```yaml
     T: Tomato
     L: Lettuce
@@ -320,7 +317,6 @@ class Dispenser(Counter):
     B: Bun
     M: Meat
     ```
-    The plan is to put the info also in the config.
 
     In the implementation, an instance of the item to dispense is always on top of the dispenser.
     Which also is easier for the visualization of the dispenser.
-- 
GitLab