Skip to content
Snippets Groups Projects
Commit d533db29 authored by Fabian Heinrich's avatar Fabian Heinrich
Browse files

Validation can be turned off in config

parent 6d6c804d
No related branches found
No related tags found
1 merge request!72Resolve "Too large number of selected players does not break the gui and environment"
......@@ -5,8 +5,9 @@ plates:
# range of seconds until the dirty plate arrives.
game:
time_limit_seconds: 300
time_limit_seconds: 1
undo_dispenser_pickup: true
validate_recipes: false
meals:
all: true
......
......@@ -287,11 +287,28 @@ class Environment:
self.counter_positions = np.array([c.pos for c in self.counters])
# TODO Maybe validation can be turned off in config...
meals_to_be_ordered = self.validate_environment()
assert meals_to_be_ordered, "Need possible meals for order generation."
if (
"validate_recipes" in self.environment_config["game"].keys()
and self.environment_config["game"]["validate_recipes"]
):
# TODO Maybe validation can be turned off in config...
meals_to_be_ordered = self.validate_environment()
assert meals_to_be_ordered, "Need possible meals for order generation."
available_meals = {
meal: self.item_info[meal] for meal in meals_to_be_ordered
}
else:
all_meals = {
meal_name: meal_info
for meal_name, meal_info in self.item_info.items()
if meal_info.type == ItemType.Meal
}
available_meals = (
{n: self.item_info[n] for n in self.environment_config["meals"]["list"]}
if not self.environment_config["meals"]["all"]
else all_meals
)
available_meals = {meal: self.item_info[meal] for meal in meals_to_be_ordered}
self.order_manager.set_available_meals(available_meals)
self.order_manager.create_init_orders(self.env_time)
self.start_time = self.env_time
......
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