diff --git a/flatland/envs/agent_chains.py b/flatland/envs/agent_chains.py index d13b734b1c44805983ba2ff5b9616321867788ec..52789f09f6c12437d34b03b3ed344f64ed7b485e 100644 --- a/flatland/envs/agent_chains.py +++ b/flatland/envs/agent_chains.py @@ -16,7 +16,8 @@ class MotionCheck(object): def addAgent(self, iAg, rc1, rc2, xlabel=None): """ add an agent and its motion as row,col tuples of current and next position. The agent's current position is given an "agent" attribute recording the agent index. - If an agent does not move this round then its cell is + If an agent does not want to move this round (rc1 == rc2) then a self-loop edge is created. + xlabel is used for test cases to give a label (see graphviz) """ # Agents which have not yet entered the env have position None. diff --git a/flatland/envs/schedule_generators.py b/flatland/envs/schedule_generators.py index 1cd10a4bd31162a85345cfe58831b960958c9a59..7d5656ddcbdd63ddc17c07aeae52419da0239a7d 100644 --- a/flatland/envs/schedule_generators.py +++ b/flatland/envs/schedule_generators.py @@ -329,13 +329,17 @@ def schedule_from_file(filename, load_from_package=None) -> ScheduleGenerator: # setup with loaded data agents_position = [a.initial_position for a in agents] - agents_direction = [a.direction for a in agents] + + # this logic is wrong - we should really load the initial_direction as the direction. + #agents_direction = [a.direction for a in agents] + agents_direction = [a.initial_direction for a in agents] agents_target = [a.target for a in agents] agents_speed = [a.speed_data['speed'] for a in agents] - agents_malfunction = [a.malfunction_data['malfunction_rate'] for a in agents] + #agents_malfunction = [a.malfunction_data['malfunction_rate'] for a in agents] return Schedule(agent_positions=agents_position, agent_directions=agents_direction, - agent_targets=agents_target, agent_speeds=agents_speed, agent_malfunction_rates=None, + agent_targets=agents_target, agent_speeds=agents_speed, + agent_malfunction_rates=None, max_episode_steps=max_episode_steps) return generator diff --git a/requirements_dev.txt b/requirements_dev.txt index 4ef1cd5b3d22adaf2aca397ef1dc346adc3cb5e0..ca1d82c2015b96d4c0782ac39623359a02c04592 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -22,3 +22,4 @@ gym==0.14.0 networkx ipycanvas graphviz +imagio