Commit e5636bc0 authored by Benjamin's avatar Benjamin
Browse files

fix bugs curriculum & meta-curriculum

parent 381cd367
......@@ -57,12 +57,13 @@ class Curriculum(object):
'but {3} were found'.format(key, location,
self.max_lesson_num + 1,
len(configuration_files)))
folder_yaml_files = os.listdir(location)
folder = os.path.dirname(location)
folder_yaml_files = os.listdir(folder)
if not all([file in folder_yaml_files for file in configuration_files]):
raise Curriculum(
'One or more configuration file(s) in curriculum {0} could not be found'.format(location)
)
self.configurations = [ArenaConfig(os.path.join(location, file) for file in yaml_files)]
self.configurations = [ArenaConfig(os.path.join(folder, file)) for file in yaml_files]
@property
def lesson_num(self):
......
......@@ -34,7 +34,7 @@ class MetaCurriculum(object):
yaml_files = [file for file in os.listdir(curriculum_folder) if
('.yaml' in file.lower() or '.yml' in file.lower())]
for curriculum_filename in json_files:
brain_name= curriculum_filename.split('.')[0]
brain_name = curriculum_filename.split('.')[0]
curriculum_filepath = \
os.path.join(curriculum_folder, curriculum_filename)
curriculum = Curriculum(curriculum_filepath, yaml_files)
......
!ArenaConfig
arenas:
0: !Arena
t: 500
items:
- !Item
name: Wall
positions:
- !Vector3 {x: -1, y: 0, z: 10}
- !Vector3 {x: -1, y: 0, z: 20}
- !Vector3 {x: -1, y: 0, z: 30}
- !Vector3 {x: 10, y: 0, z: -1}
- !Vector3 {x: 20, y: 0, z: -1}
- !Vector3 {x: 30, y: 0, z: -1}
colors:
rotations: [90,90,90,0,0,0]
sizes:
- !Vector3 {x: 1, y: 5, z: 9}
- !Vector3 {x: 1, y: 5, z: 9}
- !Vector3 {x: 1, y: 5, z: 9}
- !Vector3 {x: 1, y: 5, z: 9}
- !Vector3 {x: 1, y: 5, z: 9}
- !Vector3 {x: 1, y: 5, z: 9}
- !Item
name: GoodGoal
positions:
- !Vector3 {x: -1, y: 0, z: 35}
sizes:
- !Vector3 {x: 2, y: 2, z: 2}
- !Item
name: Agent
positions:
- !Vector3 {x: -1, y: 1, z: 5}
\ No newline at end of file
......@@ -3,11 +3,14 @@
"thresholds": [
0.1,
0.3,
0.5
0.5,
0.6,
0.7
],
"min_lesson_length": 100,
"signal_smoothing": true,
"configuration_files": [
"0.yaml",
"1.yaml",
"2.yaml",
"3.yaml",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment