Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Flatland
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
yoogottamk
Flatland
Commits
8eec5856
Commit
8eec5856
authored
5 years ago
by
Erik Nygren
Browse files
Options
Downloads
Patches
Plain Diff
removed obsolete todo in env_observation_builder.py
parent
af698037
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/training_navigation.py
+4
-4
4 additions, 4 deletions
examples/training_navigation.py
flatland/core/env_observation_builder.py
+1
-2
1 addition, 2 deletions
flatland/core/env_observation_builder.py
with
5 additions
and
6 deletions
examples/training_navigation.py
+
4
−
4
View file @
8eec5856
...
...
@@ -24,17 +24,17 @@ env = RailEnv(width=10,
height
=
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
,
rail_generator
=
rail_from_list_of_saved_GridTransitionMap_generator
(
[
'
../env-data/tests/
test1
.npy
'
]),
[
'
../env-data/tests/
circle
.npy
'
]),
number_of_agents
=
1
)
...
...
@@ -54,7 +54,7 @@ scores = []
dones_list
=
[]
action_prob
=
[
0
]
*
4
agent
=
Agent
(
state_size
,
action_size
,
"
FC
"
,
0
)
agent
.
qnetwork_local
.
load_state_dict
(
torch
.
load
(
'
../flatland/baselines/Nets/avoid_checkpoint1
50
00.pth
'
))
agent
.
qnetwork_local
.
load_state_dict
(
torch
.
load
(
'
../flatland/baselines/Nets/avoid_checkpoint1
49
00.pth
'
))
demo
=
True
...
...
This diff is collapsed.
Click to expand it.
flatland/core/env_observation_builder.py
+
1
−
2
View file @
8eec5856
...
...
@@ -242,7 +242,6 @@ 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
)
...
...
@@ -395,7 +394,7 @@ class TreeObsForRailEnv(ObservationBuilder):
observation
=
observation
+
branch_observation
elif
last_isSwitch
and
self
.
env
.
rail
.
get_transition
((
position
[
0
],
position
[
1
],
direction
),
branch_direction
):
):
new_cell
=
self
.
_new_position
(
position
,
branch_direction
)
branch_observation
=
self
.
_explore_branch
(
handle
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment