From c1a1cab7b8356c710569166990ce04963c3f54cb Mon Sep 17 00:00:00 2001 From: Erik Nygren <erik.nygren@sbb.ch> Date: Sun, 14 Jul 2019 13:16:56 -0400 Subject: [PATCH] updated load and save function. Now also distance maps are stored. Additional package msgpack-numpy needed for ndarray. This saves tons of time when loading precomputed files. Updated test to test loading and saving with and without distance maps minor update to bug in observation dimension --- flatland/envs/observations.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flatland/envs/observations.py b/flatland/envs/observations.py index 4385d4da..977a74a1 100644 --- a/flatland/envs/observations.py +++ b/flatland/envs/observations.py @@ -22,7 +22,7 @@ class TreeObsForRailEnv(ObservationBuilder): For details about the features in the tree observation see the get() function. """ - observation_dim = 9 + def __init__(self, max_depth, predictor=None): super().__init__() @@ -43,6 +43,9 @@ class TreeObsForRailEnv(ObservationBuilder): self.tree_explorted_actions_char = ['L', 'F', 'R', 'B'] self.distance_map = None + # this needs to be updated when new features are added! + self.observation_dim = 9 + def reset(self): agents = self.env.agents nb_agents = len(agents) -- GitLab