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

Update render_agent_behavior.py

parent e2cede22
No related branches found
No related tags found
No related merge requests found
...@@ -38,10 +38,10 @@ min_dist = 5 ...@@ -38,10 +38,10 @@ min_dist = 5
observation_builder = TreeObsForRailEnv(max_depth=2) observation_builder = TreeObsForRailEnv(max_depth=2)
# 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': 80, # 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) TreeObservation = TreeObsForRailEnv(max_depth=2)
...@@ -64,7 +64,7 @@ env = RailEnv(width=x_dim, ...@@ -64,7 +64,7 @@ env = RailEnv(width=x_dim,
number_of_agents=n_agents, number_of_agents=n_agents,
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)
env.reset() env.reset(True,True)
env_renderer = RenderTool(env, gl="PILSVG", ) env_renderer = RenderTool(env, gl="PILSVG", )
num_features_per_node = env.obs_builder.observation_dim num_features_per_node = env.obs_builder.observation_dim
......
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