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

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
parent c1a1cab7
No related branches found
No related tags found
No related merge requests found
...@@ -22,7 +22,7 @@ class TreeObsForRailEnv(ObservationBuilder): ...@@ -22,7 +22,7 @@ class TreeObsForRailEnv(ObservationBuilder):
For details about the features in the tree observation see the get() function. For details about the features in the tree observation see the get() function.
""" """
observation_dim = 9
def __init__(self, max_depth, predictor=None): def __init__(self, max_depth, predictor=None):
super().__init__() super().__init__()
...@@ -43,9 +43,6 @@ class TreeObsForRailEnv(ObservationBuilder): ...@@ -43,9 +43,6 @@ class TreeObsForRailEnv(ObservationBuilder):
self.tree_explorted_actions_char = ['L', 'F', 'R', 'B'] self.tree_explorted_actions_char = ['L', 'F', 'R', 'B']
self.distance_map = None self.distance_map = None
# this needs to be updated when new features are added!
self.observation_dim = 9
def reset(self): def reset(self):
agents = self.env.agents agents = self.env.agents
nb_agents = len(agents) nb_agents = len(agents)
......
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