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

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.
parent 31497c68
No related branches found
No related tags found
No related merge requests found
Pipeline #45189 passed
...@@ -73,7 +73,8 @@ can be cooked/created. ...@@ -73,7 +73,8 @@ can be cooked/created.
### Layout Config ### 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 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 ### Environment Config
......
...@@ -199,7 +199,7 @@ The BaseModel and TypedDicts can be found in `overcooked_simulator.state_represe ...@@ -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` `overcooked_simulator.state_representation.StateRepresentation` represents the json state that the `get_json_state`
returns. 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 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. pygame-2d visualization. You can do that by running the `drawing.py` script and referencing a json file.
```bash ```bash
...@@ -208,6 +208,32 @@ python3 overcooked_simulator/gui_2d_vis/drawing.py --state my_state.json ...@@ -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 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`. - 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 # Citation
# Structure of the Documentation # Structure of the Documentation
......
...@@ -7,19 +7,17 @@ method, e.g., the `CuttingBoard.progress`. The environment class detects which c ...@@ -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. `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 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: Sink:
type: Equipment
CuttingBoard:
type: Equipment
Sink:
type: Equipment
Stove:
type: Equipment
Stove:
type: Equipment
```
The defined counter classes are: The defined counter classes are:
- `Counter` - `Counter`
...@@ -177,8 +175,7 @@ class Counter: ...@@ -177,8 +175,7 @@ class Counter:
class CuttingBoard(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 ```yaml
ChoppedTomato: ChoppedTomato:
type: Ingredient type: Ingredient
...@@ -312,7 +309,7 @@ class Dispenser(Counter): ...@@ -312,7 +309,7 @@ class Dispenser(Counter):
At the moment all ingredients have an unlimited stock. 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 ```yaml
T: Tomato T: Tomato
L: Lettuce L: Lettuce
...@@ -320,7 +317,6 @@ class Dispenser(Counter): ...@@ -320,7 +317,6 @@ class Dispenser(Counter):
B: Bun B: Bun
M: Meat 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. 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. Which also is easier for the visualization of the dispenser.
......
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