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

removed unused code snippet for curve detection

parent 8f122295
No related branches found
No related tags found
No related merge requests found
...@@ -367,18 +367,6 @@ class RailEnv(Environment): ...@@ -367,18 +367,6 @@ class RailEnv(Environment):
# (pos[0], pos[1], direction), # (pos[0], pos[1], direction),
# movement) # movement)
movement = curv_dir movement = curv_dir
"""
reverse_direction = (direction + 2) % 4
curv_dir = (movement + 1) % 4
while not valid_transition:
if curv_dir != reverse_direction:
valid_transition = self.rail.get_transition(
(pos[0], pos[1], direction),
curv_dir)
if valid_transition:
movement = curv_dir
curv_dir = (curv_dir + 1) % 4
"""
new_position = self._new_position(pos, movement) new_position = self._new_position(pos, movement)
# Is it a legal move? 1) transition allows the movement in the # Is it a legal move? 1) transition allows the movement in the
# cell, 2) the new cell is not empty (case 0), 3) the cell is # cell, 2) the new cell is not empty (case 0), 3) the cell is
......
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