From 1af86348ff7e3b790395d0b01f50d24b99e51b0d Mon Sep 17 00:00:00 2001 From: Erik Nygren <erik.nygren@sbb.ch> Date: Sun, 16 Jun 2019 10:29:21 +0200 Subject: [PATCH] fomatting --- examples/training_example.py | 2 +- flatland/envs/observations.py | 3 --- notebooks/Scene_Editor.ipynb | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/examples/training_example.py b/examples/training_example.py index 218f133..dd9ded9 100644 --- a/examples/training_example.py +++ b/examples/training_example.py @@ -80,7 +80,7 @@ for trials in range(1, n_trials + 1): # Environment step which returns the observations for all agents, their corresponding # reward and whether their are done next_obs, all_rewards, done, _ = env.step(action_dict) - # TreeObservation.util_print_obs_subtree(next_obs[0], num_features_per_node=8) + # Update replay buffer and train agent for a in range(env.get_num_agents()): agent.step((obs[a], action_dict[a], all_rewards[a], next_obs[a], done[a])) diff --git a/flatland/envs/observations.py b/flatland/envs/observations.py index 4de614d..4b0049f 100644 --- a/flatland/envs/observations.py +++ b/flatland/envs/observations.py @@ -342,21 +342,18 @@ class TreeObsForRailEnv(ObservationBuilder): for ca in conflicting_agent: if direction != self.predicted_dir[tot_dist][ca[0]]: potential_conflict = 1 - # print("Potential Conflict",position,handle,ca[0],tot_dist,depth) # Look for opposing paths at distance num_step-1 elif int_position in np.delete(self.predicted_pos[pre_step], handle): conflicting_agent = np.where(self.predicted_pos[pre_step] == int_position) for ca in conflicting_agent: if direction != self.predicted_dir[pre_step][ca[0]]: potential_conflict = 1 - # print("Potential Conflict", position,handle,ca[0],pre_step,depth) # Look for opposing paths at distance num_step+1 elif int_position in np.delete(self.predicted_pos[post_step], handle): conflicting_agent = np.where(np.delete(self.predicted_pos[post_step], handle) == int_position) for ca in conflicting_agent: if direction != self.predicted_dir[post_step][ca[0]]: potential_conflict = 1 - # print("Potential Conflict", position,handle,ca[0],post_step,depth) if position in self.location_has_target and position != agent.target: if num_steps < other_target_encountered: diff --git a/notebooks/Scene_Editor.ipynb b/notebooks/Scene_Editor.ipynb index 250ad48..db23e0e 100644 --- a/notebooks/Scene_Editor.ipynb +++ b/notebooks/Scene_Editor.ipynb @@ -100,7 +100,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "7783247e5f2146e293236d2426248f90", + "model_id": "387832d242b44d69a1712a42d9547c05", "version_major": 2, "version_minor": 0 }, @@ -134,7 +134,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.8" + "version": "3.6.5" }, "latex_envs": { "LaTeX_envs_menu_present": true, -- GitLab