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

Refactor code for better readability and clarity

The changes include improving the wording in readme files, from 'Python 3.10 or higher' to 'Python 3
parent 29223014
No related branches found
No related tags found
No related merge requests found
Pipeline #45191 passed
...@@ -10,7 +10,7 @@ The real-time overcooked simulation for a cognitive cooperative system. ...@@ -10,7 +10,7 @@ The real-time overcooked simulation for a cognitive cooperative system.
You have two options to install the environment. Either clone it and install it locally or install it in your You have two options to install the environment. Either clone it and install it locally or install it in your
site-packages. site-packages.
You need a Python 3.10 or higher environment. Either conda or PyEnv. You need a Python 3.10 or greater environment. Either conda or PyEnv.
### Local Editable Installation ### Local Editable Installation
......
...@@ -21,7 +21,7 @@ like a "real" cooperative / human partner. ...@@ -21,7 +21,7 @@ like a "real" cooperative / human partner.
# Installation # Installation
You need a Python **3.10** or higher environment. You need a Python **3.10** or greater environment.
```bash ```bash
pip install overcooked-environment@git+https://gitlab.ub.uni-bielefeld.de/scs/cocosy/overcooked-simulator@main pip install overcooked-environment@git+https://gitlab.ub.uni-bielefeld.de/scs/cocosy/overcooked-simulator@main
``` ```
...@@ -217,17 +217,97 @@ The environment configuration is currently done with 3 config files + GUI config ...@@ -217,17 +217,97 @@ The environment configuration is currently done with 3 config files + GUI config
The item config defines which ingredients, cooking equipment and meals can exist and how meals and processed ingredients The item config defines which ingredients, cooking equipment and meals can exist and how meals and processed ingredients
can be cooked/created. can be cooked/created.
For example
```yaml
CuttingBoard:
type: Equipment
Stove:
type: Equipment
Pot:
type: Equipment
equipment: Stove
Tomato:
type: Ingredient
ChoppedTomato:
type: Ingredient
needs: [ Tomato ]
seconds: 4.0
equipment: CuttingBoard
TomatoSoup:
type: Meal
needs: [ ChoppedTomato, ChoppedTomato, ChoppedTomato ]
seconds: 6.0
equipment: Pot
```
## 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. Which 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. character is mapped to which counter is defined in the Environment config.
For example
```
#QU#FO#TNLB#
#__________M
#__________K
W__________I
#__A_____A_D
C__________E
C__________G
#__________#
#P#S+#X##S+#
```
## Environment Config ## Environment Config
The environment config defines how a level/environment is defined. Here, the available plates, meals, order and player The environment config defines how a level/environment is defined. Here, the available plates, meals, order and player
configuration is done. configuration is done.
For example
```yaml
plates:
clean_plates: 1
dirty_plates: 2
plate_delay: [ 5, 10 ]
# range of seconds until the dirty plate arrives.
game:
time_limit_seconds: 300
meals:
all: true
layout_chars:
_: Free
hash: Counter
A: Agent
P: PlateDispenser
C: CuttingBoard
X: Trashcan
W: ServingWindow
S: Sink
+: SinkAddon
U: Pot # with Stove
T: Tomato
orders:
...
player_config:
radius: 0.4
player_speed_units_per_seconds: 8
interaction_range: 1.6
```
## PyGame Visualization Config ## PyGame Visualization Config
Here the visualisation for all objects is defined. Reference the images or define a list of base shapes that represent Here the visualisation for all objects is defined. Reference the images or define a list of base shapes that represent
......
...@@ -7,17 +7,17 @@ method, e.g., the `CuttingBoard.progress`. The environment class detects which c ...@@ -7,17 +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
Sink: CuttingBoard:
type: Equipment type: Equipment
Sink:
type: Equipment
Stove:
type: Equipment
Stove:
type: Equipment
```
The defined counter classes are: The defined counter classes are:
- `Counter` - `Counter`
...@@ -175,14 +175,14 @@ class Counter: ...@@ -175,14 +175,14 @@ 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
ChoppedTomato: ChoppedTomato:
type: Ingredient type: Ingredient
needs: [ Tomato ] needs: [ Tomato ]
seconds: 4.0 seconds: 4.0
equipment: CuttingBoard equipment: CuttingBoard
```
The character `C` in the `layout` file represents the CuttingBoard. The character `C` in the `layout` file represents the CuttingBoard.
""" """
......
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