diff --git a/flatland/envs/schedule_generators.py b/flatland/envs/schedule_generators.py index 5883794f4e0b2675c92becc516e57c85f47e060b..9fc74368525fe775f97b5cb830c2d6bb7de9a771 100644 --- a/flatland/envs/schedule_generators.py +++ b/flatland/envs/schedule_generators.py @@ -199,12 +199,12 @@ def random_schedule_generator(speed_ratio_map: Optional[Mapping[float, float]] = valid_positions.append((r, c)) if len(valid_positions) == 0: return Schedule(agent_positions=[], agent_directions=[], - agent_targets=[], agent_speeds=[]) + agent_targets=[], agent_speeds=[], agent_malfunction_rates=None) if len(valid_positions) < num_agents: warnings.warn("schedule_generators: len(valid_positions) < num_agents") return Schedule(agent_positions=[], agent_directions=[], - agent_targets=[], agent_speeds=[]) + agent_targets=[], agent_speeds=[], agent_malfunction_rates=None) agents_position_idx = [i for i in np.random.choice(len(valid_positions), num_agents, replace=False)] agents_position = [valid_positions[agents_position_idx[i]] for i in range(num_agents)]