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
Show more breadcrumbs
Social Cognitive Systems
CoCoSy
Cooperative Cuisine Environment
Commits
16c3fc47
"README.md" did not exist on "f352fa9ea3704db1537ddeb35dfa1b00493734ca"
Commit
16c3fc47
authored
1 year ago
by
Florian Schröder
Browse files
Options
Downloads
Patches
Plain Diff
type hints
parent
4f068991
No related branches found
No related tags found
1 merge request
!19
Resolve "Add recipe yaml check + visualize recipes"
Pipeline
#43958
passed
1 year ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
overcooked_simulator/counters.py
+1
-1
1 addition, 1 deletion
overcooked_simulator/counters.py
overcooked_simulator/game_items.py
+4
-5
4 additions, 5 deletions
overcooked_simulator/game_items.py
with
5 additions
and
6 deletions
overcooked_simulator/counters.py
+
1
−
1
View file @
16c3fc47
...
@@ -145,7 +145,7 @@ class ServingWindow(Counter):
...
@@ -145,7 +145,7 @@ class ServingWindow(Counter):
self
,
self
,
pos
,
pos
,
game_score
:
GameScore
,
game_score
:
GameScore
,
meals
:
li
st
[
str
],
meals
:
s
e
t
[
str
],
plate_dispenser
:
PlateDispenser
=
None
,
plate_dispenser
:
PlateDispenser
=
None
,
):
):
self
.
game_score
=
game_score
self
.
game_score
=
game_score
...
...
This diff is collapsed.
Click to expand it.
overcooked_simulator/game_items.py
+
4
−
5
View file @
16c3fc47
...
@@ -77,7 +77,7 @@ class Item:
...
@@ -77,7 +77,7 @@ class Item:
def
extra_repr
(
self
):
def
extra_repr
(
self
):
return
""
return
""
def
can_combine
(
self
,
other
):
def
can_combine
(
self
,
other
)
->
bool
:
return
False
return
False
def
combine
(
self
,
other
)
->
Item
|
None
:
def
combine
(
self
,
other
)
->
Item
|
None
:
...
@@ -106,7 +106,6 @@ class CookingEquipment(Item):
...
@@ -106,7 +106,6 @@ class CookingEquipment(Item):
super
().
__init__
(
*
args
,
**
kwargs
)
super
().
__init__
(
*
args
,
**
kwargs
)
self
.
transitions
=
transitions
self
.
transitions
=
transitions
self
.
active_transition
:
Optional
[
dict
]
=
None
self
.
active_transition
:
Optional
[
dict
]
=
None
# self.content: Item | list[Item] = [] # list if cooking, meal item when done
self
.
content_ready
:
Item
|
None
=
None
self
.
content_ready
:
Item
|
None
=
None
self
.
content_list
:
list
[
Item
]
=
[]
self
.
content_list
:
list
[
Item
]
=
[]
...
@@ -116,7 +115,7 @@ class CookingEquipment(Item):
...
@@ -116,7 +115,7 @@ class CookingEquipment(Item):
for
transition
in
self
.
transitions
.
values
():
for
transition
in
self
.
transitions
.
values
():
transition
[
"
recipe
"
]
=
collections
.
Counter
(
transition
[
"
needs
"
])
transition
[
"
recipe
"
]
=
collections
.
Counter
(
transition
[
"
needs
"
])
def
can_combine
(
self
,
other
):
def
can_combine
(
self
,
other
)
->
bool
:
# already cooking or nothing to combine
# already cooking or nothing to combine
if
other
is
None
:
if
other
is
None
:
return
False
return
False
...
@@ -134,7 +133,7 @@ class CookingEquipment(Item):
...
@@ -134,7 +133,7 @@ class CookingEquipment(Item):
ingredients
<=
recipe
[
"
recipe
"
]
for
recipe
in
self
.
transitions
.
values
()
ingredients
<=
recipe
[
"
recipe
"
]
for
recipe
in
self
.
transitions
.
values
()
)
)
def
combine
(
self
,
other
):
def
combine
(
self
,
other
)
->
Item
|
None
:
return_value
=
None
return_value
=
None
if
isinstance
(
other
,
CookingEquipment
):
if
isinstance
(
other
,
CookingEquipment
):
self
.
content_list
.
extend
(
other
.
content_list
)
self
.
content_list
.
extend
(
other
.
content_list
)
...
@@ -199,7 +198,7 @@ class CookingEquipment(Item):
...
@@ -199,7 +198,7 @@ class CookingEquipment(Item):
class
Plate
(
CookingEquipment
):
class
Plate
(
CookingEquipment
):
def
__init__
(
self
,
transitions
,
clean
,
content
=
None
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
transitions
,
clean
,
*
args
,
**
kwargs
):
self
.
clean
=
clean
self
.
clean
=
clean
super
().
__init__
(
super
().
__init__
(
name
=
self
.
create_name
(),
transitions
=
transitions
,
*
args
,
**
kwargs
name
=
self
.
create_name
(),
transitions
=
transitions
,
*
args
,
**
kwargs
...
...
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