Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Cooperative Cuisine Environment
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
Show more breadcrumbs
Social Cognitive Systems
CoCoSy
Cooperative Cuisine Environment
Commits
c45545fb
Commit
c45545fb
authored
1 year ago
by
Fabian Heinrich
Browse files
Options
Downloads
Patches
Plain Diff
Fix merge
parent
9d22c368
No related branches found
No related tags found
1 merge request
!72
Resolve "Too large number of selected players does not break the gui and environment"
Pipeline
#47709
failed
1 year ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cooperative_cuisine/environment.py
+13
-11
13 additions, 11 deletions
cooperative_cuisine/environment.py
with
13 additions
and
11 deletions
cooperative_cuisine/environment.py
+
13
−
11
View file @
c45545fb
...
...
@@ -68,7 +68,9 @@ PREVENT_SQUEEZING_INTO_OTHER_PLAYERS = True
class
EnvironmentConfig
(
TypedDict
):
plates
:
PlateConfig
game
:
dict
[
Literal
[
"
time_limit_seconds
"
]
|
Literal
[
"
undo_dispenser_pickup
"
],
int
|
bool
Literal
[
"
time_limit_seconds
"
]
|
Literal
[
"
undo_dispenser_pickup
"
],
int
|
bool
,
bool
,
]
meals
:
dict
[
Literal
[
"
all
"
]
|
Literal
[
"
list
"
],
bool
|
list
[
str
]]
orders
:
OrderConfig
...
...
@@ -232,25 +234,25 @@ class Environment:
"
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
()
meals_to_be_ordered
=
self
.
recipe_validation
.
validate_environment
(
self
.
counters
)
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
set_meals
=
{
n
:
self
.
item_info
[
n
]
for
n
in
self
.
environment_config
[
"
meals
"
][
"
list
"
]
}
meals_to_be_ordered
=
(
set_meals
if
not
self
.
environment_config
[
"
meals
"
][
"
all
"
]
else
all_meals
)
meals_to_be_ordered
=
self
.
recipe_validation
.
validate_environment
(
self
.
counters
)
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
}
self
.
order_manager
.
set_available_meals
(
available_meals
)
self
.
order_manager
.
create_init_orders
(
self
.
env_time
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment