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

fixed introduces error by setting speeds to None

parent 81ae9c09
No related branches found
No related tags found
No related merge requests found
......@@ -79,7 +79,7 @@ def complex_schedule_generator(speed_ratio_map: Mapping[float, float] = None, se
speeds = [1.0] * len(agents_position)
return Schedule(agent_positions=agents_position, agent_directions=agents_direction,
agent_targets=agents_target, agent_speeds=speeds,agent_malfunction_rates=None)
agent_targets=agents_target, agent_speeds=speeds, agent_malfunction_rates=None)
return generator
......@@ -165,7 +165,7 @@ def sparse_schedule_generator(speed_ratio_map: Mapping[float, float] = None, see
speeds = [1.0] * len(agents_position)
return Schedule(agent_positions=agents_position, agent_directions=agents_direction,
agent_targets=agents_target, agent_speeds=speeds,agent_malfunction_rates=None)
agent_targets=agents_target, agent_speeds=speeds, agent_malfunction_rates=None)
return generator
......@@ -187,7 +187,7 @@ def random_schedule_generator(speed_ratio_map: Optional[Mapping[float, float]] =
"""
def generator(rail: GridTransitionMap, num_agents: int, hints: Any = None,
num_resets: int = 0) -> Schedule:
num_resets: int = 0) -> Schedule:
_runtime_seed = seed + num_resets
np.random.seed(_runtime_seed)
......@@ -263,7 +263,7 @@ def random_schedule_generator(speed_ratio_map: Optional[Mapping[float, float]] =
agents_speed = speed_initialization_helper(num_agents, speed_ratio_map, seed=_runtime_seed)
return Schedule(agent_positions=agents_position, agent_directions=agents_direction,
agent_targets=agents_target, agent_speeds=speeds,agent_malfunction_rates=None)
agent_targets=agents_target, agent_speeds=None, agent_malfunction_rates=None)
return generator
......@@ -307,6 +307,6 @@ def schedule_from_file(filename, load_from_package=None) -> ScheduleGenerator:
else:
agents_speed = None
return Schedule(agent_positions=agents_position, agent_directions=agents_direction,
agent_targets=agents_target, agent_speeds=speeds,agent_malfunction_rates=None)
agent_targets=agents_target, agent_speeds=None, agent_malfunction_rates=None)
return generator
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