From d53639ea80c428f4a84f9ef866d6f9d47af0ce90 Mon Sep 17 00:00:00 2001 From: hagrid67 <jdhwatson@gmail.com> Date: Sat, 27 Apr 2019 18:01:07 +0100 Subject: [PATCH] fixed flake8 whitespace --- flatland/envs/rail_env.py | 5 ++++- flatland/utils/editor.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/flatland/envs/rail_env.py b/flatland/envs/rail_env.py index 2cde6bc..ce05ce0 100644 --- a/flatland/envs/rail_env.py +++ b/flatland/envs/rail_env.py @@ -532,7 +532,10 @@ class RailEnv(Environment): self.agents_position.append(tuple(rcPos)) # ensure it's a tuple not a list self.agents_handles.append(max(self.agents_handles + [-1]) + 1) # max(handles) + 1, starting at 0 - self.agents_direction.append(0) + + if iDir is None: + iDir = self.pick_agent_direction(rcPos, rcTarget) + self.agents_direction.append(iDir) self.agents_target.append(rcPos) # set the target to the origin initially self.number_of_agents += 1 self.check_agent_lists() diff --git a/flatland/utils/editor.py b/flatland/utils/editor.py index d71b05e..88b6d7a 100644 --- a/flatland/utils/editor.py +++ b/flatland/utils/editor.py @@ -79,7 +79,7 @@ class JupEditor(object): rcCell = ((array([y, x]) - self.yxBase) / self.nPixCell).astype(int) if self.drawMode == "Origin": - self.iAgent = self.env.add_agent(rcCell, rcCell, 0) + self.iAgent = self.env.add_agent(rcCell, rcCell, None) self.drawMode = "Destination" self.player = None # will need to start a new player -- GitLab