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
500d043e
Commit
500d043e
authored
11 months ago
by
Fabian Heinrich
Browse files
Options
Downloads
Patches
Plain Diff
Seed in study config
parent
05af345c
No related branches found
No related tags found
No related merge requests found
Pipeline
#49684
passed
11 months ago
Stage: test
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cooperative_cuisine/configs/study/study_config.yaml
+4
-0
4 additions, 0 deletions
cooperative_cuisine/configs/study/study_config.yaml
cooperative_cuisine/study_server.py
+5
-4
5 additions, 4 deletions
cooperative_cuisine/study_server.py
with
9 additions
and
4 deletions
cooperative_cuisine/configs/study/study_config.yaml
+
4
−
0
View file @
500d043e
...
@@ -4,6 +4,7 @@ levels:
...
@@ -4,6 +4,7 @@ levels:
layout_path
:
LAYOUTS_DIR/overcooked-1/1-1-far-apart.layout
layout_path
:
LAYOUTS_DIR/overcooked-1/1-1-far-apart.layout
item_info_path
:
CONFIGS_DIR/item_info.yaml
item_info_path
:
CONFIGS_DIR/item_info.yaml
name
:
"
Level
1"
name
:
"
Level
1"
seed
:
12345
config_overwrite
:
config_overwrite
:
game
:
game
:
time_limit_seconds
:
300
time_limit_seconds
:
300
...
@@ -21,6 +22,7 @@ levels:
...
@@ -21,6 +22,7 @@ levels:
layout_path
:
LAYOUTS_DIR/overcooked-1/1-4-bottleneck.layout
layout_path
:
LAYOUTS_DIR/overcooked-1/1-4-bottleneck.layout
item_info_path
:
CONFIGS_DIR/item_info.yaml
item_info_path
:
CONFIGS_DIR/item_info.yaml
name
:
"
Level
2"
name
:
"
Level
2"
seed
:
12345
config_overwrite
:
config_overwrite
:
game
:
game
:
time_limit_seconds
:
300
time_limit_seconds
:
300
...
@@ -29,6 +31,7 @@ levels:
...
@@ -29,6 +31,7 @@ levels:
layout_path
:
LAYOUTS_DIR/overcooked-1/1-5-circle.layout
layout_path
:
LAYOUTS_DIR/overcooked-1/1-5-circle.layout
item_info_path
:
CONFIGS_DIR/item_info.yaml
item_info_path
:
CONFIGS_DIR/item_info.yaml
name
:
"
Level
3"
name
:
"
Level
3"
seed
:
12345
config_overwrite
:
config_overwrite
:
game
:
game
:
time_limit_seconds
:
300
time_limit_seconds
:
300
...
@@ -41,6 +44,7 @@ levels:
...
@@ -41,6 +44,7 @@ levels:
layout_path
:
LAYOUTS_DIR/overcooked-1/4-1-moving-counters.layout
layout_path
:
LAYOUTS_DIR/overcooked-1/4-1-moving-counters.layout
item_info_path
:
CONFIGS_DIR/item_info.yaml
item_info_path
:
CONFIGS_DIR/item_info.yaml
name
:
"
Level
4"
name
:
"
Level
4"
seed
:
12345
config_overwrite
:
config_overwrite
:
game
:
game
:
time_limit_seconds
:
300
time_limit_seconds
:
300
...
...
This diff is collapsed.
Click to expand it.
cooperative_cuisine/study_server.py
+
5
−
4
View file @
500d043e
...
@@ -15,7 +15,6 @@ import argparse
...
@@ -15,7 +15,6 @@ import argparse
import
asyncio
import
asyncio
import
logging
import
logging
import
os
import
os
import
random
import
signal
import
signal
import
subprocess
import
subprocess
import
uuid
import
uuid
...
@@ -70,6 +69,8 @@ class LevelConfig(BaseModel):
...
@@ -70,6 +69,8 @@ class LevelConfig(BaseModel):
"""
Path to the item info file.
"""
"""
Path to the item info file.
"""
config_overwrite
:
dict
[
str
,
Any
]
|
None
=
None
config_overwrite
:
dict
[
str
,
Any
]
|
None
=
None
"""
Overwrite parts of the `environment_config`
"""
"""
Overwrite parts of the `environment_config`
"""
seed
:
int
"""
Seed for the level.
"""
class
LevelInfo
(
BaseModel
):
class
LevelInfo
(
BaseModel
):
...
@@ -108,13 +109,13 @@ class Study:
...
@@ -108,13 +109,13 @@ class Study:
game_port: The port number of the game server.
game_port: The port number of the game server.
"""
"""
with
open
(
study_config_path
,
"
r
"
)
as
file
:
with
open
(
study_config_path
,
"
r
"
)
as
file
:
env
_config_f
=
file
.
read
()
study
_config_f
=
file
.
read
()
self
.
study_id
=
uuid
.
uuid4
().
hex
[:
UUID_CUTOFF
]
self
.
study_id
=
uuid
.
uuid4
().
hex
[:
UUID_CUTOFF
]
"""
Unique ID of the study.
"""
"""
Unique ID of the study.
"""
self
.
study_config
:
StudyConfig
=
yaml
.
load
(
self
.
study_config
:
StudyConfig
=
yaml
.
load
(
str
(
env
_config_f
),
Loader
=
yaml
.
Loader
str
(
study
_config_f
),
Loader
=
yaml
.
Loader
)
)
"""
Configuration for the study which layouts, env_configs and item infos are used for the study levels.
"""
"""
Configuration for the study which layouts, env_configs and item infos are used for the study levels.
"""
self
.
levels
:
list
[
dict
]
=
self
.
study_config
[
"
levels
"
]
self
.
levels
:
list
[
dict
]
=
self
.
study_config
[
"
levels
"
]
...
@@ -203,7 +204,7 @@ class Study:
...
@@ -203,7 +204,7 @@ class Study:
deep_update
(
self
.
current_config
,
level
.
config_overwrite
)
deep_update
(
self
.
current_config
,
level
.
config_overwrite
)
environment_config
=
yaml
.
dump
(
self
.
current_config
)
environment_config
=
yaml
.
dump
(
self
.
current_config
)
seed
=
int
(
random
.
random
()
*
1000000
)
seed
=
level
.
seed
creation_json
=
CreateEnvironmentConfig
(
creation_json
=
CreateEnvironmentConfig
(
manager_id
=
study_manager
.
server_manager_id
,
manager_id
=
study_manager
.
server_manager_id
,
number_players
=
self
.
study_config
[
"
num_players
"
]
number_players
=
self
.
study_config
[
"
num_players
"
]
...
...
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