From 7d1ee39b62d2b21800cb9c33dbb2e3f561512882 Mon Sep 17 00:00:00 2001 From: Erik Nygren <erik.nygren@sbb.ch> Date: Thu, 13 Jun 2019 17:37:33 +0200 Subject: [PATCH] fixed tree observation data bug, where not the correct values where provided to agent --- flatland/envs/observations.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flatland/envs/observations.py b/flatland/envs/observations.py index e0f0c7f..41d5603 100644 --- a/flatland/envs/observations.py +++ b/flatland/envs/observations.py @@ -234,6 +234,9 @@ class TreeObsForRailEnv(ObservationBuilder): 0 = no agent present other direction than myself #8: possible conflict detected + 1 = Other agent predicts to pass along this cell at the same time as the agent + + 0 = No other agent reserve the same cell at similar time Missing/padding nodes are filled in with -inf (truncated). @@ -547,8 +550,7 @@ class TreeObsForRailEnv(ObservationBuilder): child_size = (len(tree) - num_features_per_node) // 4 tree_data = tree[0:4].tolist() distance_data = [tree[4]] - agent_data = tree[-3:].tolist() - + agent_data = tree[num_features_per_node - 3:num_features_per_node].tolist() for children in range(4): child_tree = tree[(num_features_per_node + children * child_size): (num_features_per_node + (children + 1) * child_size)] -- GitLab