Skip to content
Snippets Groups Projects
Commit 67d7929e authored by u214892's avatar u214892
Browse files

#25 use RailEnvActions enum instead of hardcoded action ints

parent 4145c9ea
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ Collection of environment-specific PredictionBuilder.
import numpy as np
from envs.rail_env import RailEnvActions
from flatland.core.env_prediction_builder import PredictionBuilder
......@@ -41,12 +42,7 @@ class DummyPredictorForRailEnv(PredictionBuilder):
prediction_dict = {}
for agent in agents:
# 0: do nothing
# 1: turn left and move to the next cell
# 2: move to the next cell in front of the agent
# 3: turn right and move to the next cell
action_priorities = [2, 1, 3]
action_priorities = [RailEnvActions.MOVE_FORWARD, RailEnvActions.MOVE_LEFT, RailEnvActions.MOVE_RIGHT]
_agent_initial_position = agent.position
_agent_initial_direction = agent.direction
prediction = np.zeros(shape=(self.max_depth, 5))
......
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