Skip to content
Snippets Groups Projects
Commit 620d88fe authored by Christoph Kowalski's avatar Christoph Kowalski
Browse files

Removed the hook adaptations in the normal code

parent 193af9b6
No related branches found
No related tags found
2 merge requests!110V1.2.0 changes,!109SB3 RL with Hydra
Pipeline #64108 passed
......@@ -244,16 +244,15 @@ class Counter:
before_combine = copy.copy(item)
occupied_before_combine = copy.deepcopy(self.occupied_by)
return_this = self.occupied_by.combine(item)
if self.occupied_by.name != "Plate" and item.name != "Plate":
self.hook(
DROP_OFF_ON_COOKING_EQUIPMENT,
item=before_combine,
equipment=self.occupied_by,
counter=self,
occupied_before=occupied_before_combine,
player=player,
return_this=return_this,
)
self.hook(
DROP_OFF_ON_COOKING_EQUIPMENT,
item=before_combine,
equipment=self.occupied_by,
counter=self,
occupied_before=occupied_before_combine,
player=player,
return_this=return_this,
)
return return_this
return None
......
......@@ -425,10 +425,6 @@ Args:
before (CookingEquipment): the cooking equipment.
result (str): Name of the meal.
"""
PLATED_MEAL = "plated_meal"
"""A ready meal was plated on a Plate"""
COOKING_FINISHED = "cooking_finished"
# --- orders.py ---
......
......@@ -37,7 +37,7 @@ from cooperative_cuisine.hooks import (
PROGRESS_FINISHED,
PROGRESS_STARTED,
CONTENT_READY,
PLATED_MEAL, COOKING_FINISHED
COOKING_FINISHED
)
from cooperative_cuisine.state_representation import (
ItemState,
......@@ -304,8 +304,6 @@ class CookingEquipment(Item):
ingredients = collections.Counter(
item.name for item in self.content_list + other
)
if ("ChoppedTomato" in [item.name for item in self.content_list] and "ChoppedLettuce" in [item.name for item in other]) or ("ChoppedTomato" in [item.name for item in other] and "ChoppedLettuce" in [item.name for item in self.content_list]):
self.hook(PLATED_MEAL)
return any(ingredients <= recipe.recipe for recipe in self.transitions.values())
def combine(self, other) -> Item | None:
......@@ -486,8 +484,6 @@ class Plate(CookingEquipment):
):
# additional check for meals in the content list of another equipment,
# e.g., Soups which is not covered by the normal transition checks.
if other.name == "Pot" and other.content_list[0].name in self.meals:
self.hook(PLATED_MEAL)
return other.content_list[0].name in self.meals
return False
elif self.clean:
......
......@@ -139,13 +139,6 @@ hook_callbacks:
_partial_: true
callback_class_kwargs:
static_score: 0.0
plate_meal:
hooks: [ plated_meal ]
callback_class:
_target_: "cooperative_cuisine.scores.ScoreViaHooks"
_partial_: true
callback_class_kwargs:
static_score: 0.05
cooking_finished:
hooks: [ cooking_finished ]
callback_class:
......
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