Skip to content
Snippets Groups Projects
Commit e2cede22 authored by Erik Nygren's avatar Erik Nygren :bullettrain_front:
Browse files

Update multi_agent_training.py

parent 4af2cc01
No related branches found
No related tags found
No related merge requests found
...@@ -44,10 +44,11 @@ def main(argv): ...@@ -44,10 +44,11 @@ def main(argv):
# Use a the malfunction generator to break agents from time to time # Use a the malfunction generator to break agents from time to time
stochastic_data = {'malfunction_rate': 8000, # Rate of malfunction occurence of single agent stochastic_data = MalfunctionParameters(malfunction_rate=10000, # Rate of malfunction occurence
'min_duration': 15, # Minimal duration of malfunction min_duration=15, # Minimal duration of malfunction
'max_duration': 50 # Max duration of malfunction max_duration=50 # Max duration of malfunction
} )
# Custom observation builder # Custom observation builder
TreeObservation = TreeObsForRailEnv(max_depth=2, predictor=ShortestPathPredictorForRailEnv(30)) TreeObservation = TreeObsForRailEnv(max_depth=2, predictor=ShortestPathPredictorForRailEnv(30))
...@@ -71,6 +72,8 @@ def main(argv): ...@@ -71,6 +72,8 @@ def main(argv):
malfunction_generator_and_process_data=malfunction_from_params(stochastic_data), malfunction_generator_and_process_data=malfunction_from_params(stochastic_data),
obs_builder_object=TreeObservation) obs_builder_object=TreeObservation)
# Reset env
env.reset(True,True)
# After training we want to render the results so we also load a renderer # After training we want to render the results so we also load a renderer
env_renderer = RenderTool(env, gl="PILSVG", ) env_renderer = RenderTool(env, gl="PILSVG", )
# Given the depth of the tree observation and the number of features per node we get the following state_size # Given the depth of the tree observation and the number of features per node we get the following state_size
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment