Commit f899425c authored by Benjamin Beyret's avatar Benjamin Beyret
Browse files

add gym wrapper + add dopamine + move train package to examples

parent 16e8636f
env/*
!env/README.md
/models
/summaries
models/
summaries/
/.idea
__pycache__/
UnitySDK.log
......
......@@ -94,11 +94,11 @@ class ArenaConfig(yaml.YAMLObject):
return config_out
def update(self, arenas_configurations_input):
def update(self, arenas_configurations):
if arenas_configurations_input is not None:
for arena_i in arenas_configurations_input.arenas:
self.arenas[arena_i] = copy.copy(arenas_configurations_input.arenas[arena_i])
if arenas_configurations is not None:
for arena_i in arenas_configurations.arenas:
self.arenas[arena_i] = copy.copy(arenas_configurations.arenas[arena_i])
def constructor_arena(loader, node):
......
......@@ -217,16 +217,16 @@ class UnityEnvironment(object):
Number of Training Brains : {2}'''.format(self._academy_name, str(self._num_brains),
str(self._num_external_brains))
def reset(self, arenas_configurations_input=None, train_mode=True) -> AllBrainInfo:
def reset(self, arenas_configurations=None, train_mode=True) -> AllBrainInfo:
"""
Sends a signal to reset the unity environment.
:return: AllBrainInfo : A data structure corresponding to the initial reset state of the environment.
"""
if self._loaded:
self.arenas_configurations.update(arenas_configurations_input)
self.arenas_configurations.update(arenas_configurations)
outputs = self.communicator.exchange(
self._generate_reset_input(train_mode, arenas_configurations_input)
self._generate_reset_input(train_mode, arenas_configurations)
)
if outputs is None:
raise KeyboardInterrupt
......
......@@ -183,7 +183,7 @@ class TrainerController(object):
return env.reset(config=self.meta_curriculum.get_config())
else:
if self.update_config:
return env.reset(arenas_configurations_input=self.config)
return env.reset(arenas_configurations=self.config)
self.update_config = False
else:
return env.reset()
......
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