Skip to content
Snippets Groups Projects
Commit efc4c6b3 authored by u214892's avatar u214892
Browse files

#164 improving stability sparse level generator

parent 1018ce8c
No related branches found
No related tags found
No related merge requests found
......@@ -395,8 +395,6 @@ class RailEnv(Environment):
self.rewards_dict[i_agent] += self.step_penalty * agent.speed_data['speed']
self.rewards_dict[i_agent] += self.stop_penalty
agent.moving = False
else:
agent.speed_data['transition_action_on_cellexit'] = action
# if we've just broken in this step, nothing else to do
if new_malfunction:
......
......@@ -682,6 +682,7 @@ def sparse_rail_generator(num_cities=5, num_intersections=4, num_trainstations=2
if tries > 100:
warnings.warn("Could not set trainstations, please change initial parameters!!!!")
spot_found = False
break
if spot_found:
train_stations[trainstation_node].append((station_x, station_y))
......
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