Skip to content
Snippets Groups Projects
Commit 0ff8a4b8 authored by Erik Nygren's avatar Erik Nygren
Browse files

fixed tree observation data bug, where not the correct values where provided to agent

parent 7d1ee39b
No related branches found
No related tags found
No related merge requests found
...@@ -548,9 +548,10 @@ class TreeObsForRailEnv(ObservationBuilder): ...@@ -548,9 +548,10 @@ class TreeObsForRailEnv(ObservationBuilder):
depth += 1 depth += 1
pow4 *= 4 pow4 *= 4
child_size = (len(tree) - num_features_per_node) // 4 child_size = (len(tree) - num_features_per_node) // 4
tree_data = tree[0:4].tolist() tree_data = tree[:4].tolist()
distance_data = [tree[4]] distance_data = [tree[4]]
agent_data = tree[num_features_per_node - 3:num_features_per_node].tolist() agent_data = tree[5:num_features_per_node].tolist()
print(agent_data)
for children in range(4): for children in range(4):
child_tree = tree[(num_features_per_node + children * child_size): child_tree = tree[(num_features_per_node + children * child_size):
(num_features_per_node + (children + 1) * child_size)] (num_features_per_node + (children + 1) * child_size)]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment