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

fix dirty plate bug and realistic times

parent 78603eb3
No related branches found
No related tags found
1 merge request!27Resolve "Orders"
Pipeline #44051 passed
...@@ -11,16 +11,16 @@ orders: ...@@ -11,16 +11,16 @@ orders:
duration_sample: duration_sample:
func: uniform func: uniform
kwargs: kwargs:
a: 3 a: 40
b: 5 b: 60
max_orders: 6 max_orders: 6
num_start_meals: 3 num_start_meals: 3
sample_on_dur: true sample_on_dur: true
sample_on_dur_func: sample_on_dur_func:
func: uniform func: uniform
kwargs: kwargs:
a: 1 a: 10
b: 2 b: 20
sample_on_serving: false sample_on_serving: false
score_calc_gen_kwargs: score_calc_gen_kwargs:
other: 0 other: 0
......
...@@ -44,30 +44,30 @@ Bun: ...@@ -44,30 +44,30 @@ Bun:
ChoppedTomato: ChoppedTomato:
type: Ingredient type: Ingredient
needs: [ Tomato ] needs: [ Tomato ]
seconds: 0.1 seconds: 4.0
equipment: CuttingBoard equipment: CuttingBoard
ChoppedLettuce: ChoppedLettuce:
type: Ingredient type: Ingredient
needs: [ Lettuce ] needs: [ Lettuce ]
seconds: 0.1 seconds: 3.0
equipment: CuttingBoard equipment: CuttingBoard
ChoppedOnion: ChoppedOnion:
type: Ingredient type: Ingredient
needs: [ Onion ] needs: [ Onion ]
seconds: 0.1 seconds: 5.0
equipment: CuttingBoard equipment: CuttingBoard
ChoppedMeat: ChoppedMeat:
type: Ingredient type: Ingredient
needs: [ Meat ] needs: [ Meat ]
seconds: 0.1 seconds: 4.0
equipment: CuttingBoard equipment: CuttingBoard
CookedPatty: CookedPatty:
type: Ingredient type: Ingredient
seconds: 2.0 seconds: 5.0
needs: [ ChoppedMeat ] needs: [ ChoppedMeat ]
equipment: Pan equipment: Pan
...@@ -86,11 +86,11 @@ Salad: ...@@ -86,11 +86,11 @@ Salad:
TomatoSoup: TomatoSoup:
type: Meal type: Meal
needs: [ ChoppedTomato, ChoppedTomato, ChoppedTomato ] needs: [ ChoppedTomato, ChoppedTomato, ChoppedTomato ]
seconds: 3.0 seconds: 6.0
equipment: Pot equipment: Pot
OnionSoup: OnionSoup:
type: Meal type: Meal
needs: [ ChoppedOnion, ChoppedOnion, ChoppedOnion ] needs: [ ChoppedOnion, ChoppedOnion, ChoppedOnion ]
seconds: 3.0 seconds: 6.0
equipment: Pot equipment: Pot
CuttingBoard:
type: Equipment
Sink:
type: Equipment
Stove:
type: Equipment
Pot:
type: Equipment
equipment: Stove
Pan:
type: Equipment
equipment: Stove
DirtyPlate:
type: Equipment
Plate:
type: Equipment
needs: [ DirtyPlate ]
seconds: 1.0
equipment: Sink
# --------------------------------------------------------------------------------
Tomato:
type: Ingredient
Lettuce:
type: Ingredient
Onion:
type: Ingredient
Meat:
type: Ingredient
Bun:
type: Ingredient
ChoppedTomato:
type: Ingredient
needs: [ Tomato ]
seconds: 0.1
equipment: CuttingBoard
ChoppedLettuce:
type: Ingredient
needs: [ Lettuce ]
seconds: 0.1
equipment: CuttingBoard
ChoppedOnion:
type: Ingredient
needs: [ Onion ]
seconds: 0.1
equipment: CuttingBoard
ChoppedMeat:
type: Ingredient
needs: [ Meat ]
seconds: 0.1
equipment: CuttingBoard
CookedPatty:
type: Ingredient
seconds: 2.0
needs: [ ChoppedMeat ]
equipment: Pan
# --------------------------------------------------------------------------------
Burger:
type: Meal
needs: [ Bun, ChoppedLettuce, ChoppedTomato, CookedPatty ]
equipment: ~
Salad:
type: Meal
needs: [ ChoppedLettuce, ChoppedTomato ]
equipment: ~
TomatoSoup:
type: Meal
needs: [ ChoppedTomato, ChoppedTomato, ChoppedTomato ]
seconds: 3.0
equipment: Pot
OnionSoup:
type: Meal
needs: [ ChoppedOnion, ChoppedOnion, ChoppedOnion ]
seconds: 3.0
equipment: Pot
...@@ -129,6 +129,7 @@ class CookingEquipment(Item): ...@@ -129,6 +129,7 @@ class CookingEquipment(Item):
ingredients = collections.Counter( ingredients = collections.Counter(
item.name for item in self.content_list + other item.name for item in self.content_list + other
) )
print(ingredients)
return any( return any(
ingredients <= recipe["recipe"] for recipe in self.transitions.values() ingredients <= recipe["recipe"] for recipe in self.transitions.values()
) )
...@@ -237,5 +238,6 @@ class Plate(CookingEquipment): ...@@ -237,5 +238,6 @@ class Plate(CookingEquipment):
): ):
return other.content_list[0].name in self.meals return other.content_list[0].name in self.meals
return False return False
else: elif self.clean:
return True return True
return False
...@@ -524,8 +524,8 @@ class PyGameGUI: ...@@ -524,8 +524,8 @@ class PyGameGUI:
""" """
pos = counter.pos * self.grid_size pos = counter.pos * self.grid_size
if counter.__class__.__name__ != "Trash":
self.draw_thing(pos, self.visualization_config["Counter"]["parts"]) self.draw_thing(pos, self.visualization_config["Counter"]["parts"])
if str(counter) in self.visualization_config: if str(counter) in self.visualization_config:
self.draw_thing(pos, self.visualization_config[str(counter)]["parts"]) self.draw_thing(pos, self.visualization_config[str(counter)]["parts"])
else: else:
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
GameWindow: GameWindow:
WhatIsFixed: grid # grid or window_width or window_height WhatIsFixed: grid # grid or window_width or window_height
size: 50 size: 80
screen_margin: 100 screen_margin: 100
min_width: 700 min_width: 700
min_height: 600 min_height: 600
......
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