Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Flatland
Flatland
Commits
0ad69215
Commit
0ad69215
authored
Apr 29, 2019
by
Erik Nygren
Browse files
updated TODO's in rail_env.py and env_observation_builder.py
parent
640276c7
Pipeline
#427
failed with stage
in 1 minute and 45 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
examples/training_navigation.py
View file @
0ad69215
...
...
@@ -25,6 +25,11 @@ env = RailEnv(width=10,
rail_generator
=
random_rail_generator
(
cell_type_relative_proportion
=
transition_probability
),
number_of_agents
=
1
)
env
=
RailEnv
(
width
=
20
,
height
=
20
,
rail_generator
=
complex_rail_generator
(
nr_start_goal
=
20
,
min_dist
=
10
,
max_dist
=
99999
,
seed
=
0
),
number_of_agents
=
5
)
"""
env = RailEnv(width=20,
height=20,
...
...
flatland/core/env_observation_builder.py
View file @
0ad69215
...
...
@@ -242,6 +242,7 @@ class TreeObsForRailEnv(ObservationBuilder):
# Start from the current orientation, and see which transitions are available;
# organize them as [left, forward, right, back], relative to the current orientation
for
branch_direction
in
[(
orientation
+
4
+
i
)
%
4
for
i
in
range
(
-
1
,
3
)]:
#TODO: check if cell is a curve, then keep branch direction forward instead of left or right
if
self
.
env
.
rail
.
get_transition
((
position
[
0
],
position
[
1
],
orientation
),
branch_direction
):
new_cell
=
self
.
_new_position
(
position
,
branch_direction
)
...
...
flatland/envs/rail_env.py
View file @
0ad69215
...
...
@@ -905,6 +905,7 @@ class RailEnv(Environment):
def
reset
(
self
,
regen_rail
=
True
,
replace_agents
=
True
):
if
regen_rail
or
self
.
rail
is
None
:
#TODO: Import not only rail information but also start and goal positions
self
.
rail
=
self
.
rail_generator
(
self
.
width
,
self
.
height
,
self
.
num_resets
)
self
.
fill_valid_positions
()
...
...
@@ -916,7 +917,7 @@ class RailEnv(Environment):
# Use a TreeObsForRailEnv to compute distance maps to each agent's target, to sample initial
# agent's orientations that allow a valid solution.
# TODO: Possibility ot fill valid positions from list of goals and start
self
.
fill_valid_positions
()
if
replace_agents
:
...
...
@@ -1023,6 +1024,7 @@ class RailEnv(Environment):
is_deadend
=
False
if
action
==
2
:
# TODO: Check if cell is curve --> Compute correct transition and change in orientation
# compute number of possible transitions in the current
# cell
nbits
=
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment