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
df18b268
Commit
df18b268
authored
5 years ago
by
u214892
Browse files
Options
Downloads
Patches
Plain Diff
#178 post-rebase fix
parent
8e8f91a5
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/custom_observation_example_03_ObservePredictions.py
+2
-1
2 additions, 1 deletion
examples/custom_observation_example_03_ObservePredictions.py
flatland/core/grid/rail_env_grid.py
+2
-1
2 additions, 1 deletion
flatland/core/grid/rail_env_grid.py
with
4 additions
and
2 deletions
examples/custom_observation_example_03_ObservePredictions.py
+
2
−
1
View file @
df18b268
...
...
@@ -11,6 +11,7 @@ from flatland.envs.predictions import ShortestPathPredictorForRailEnv
from
flatland.envs.rail_env
import
RailEnv
from
flatland.envs.rail_generators
import
complex_rail_generator
from
flatland.envs.schedule_generators
import
complex_schedule_generator
from
flatland.utils.ordered_set
import
OrderedSet
from
flatland.utils.rendertools
import
RenderTool
random
.
seed
(
100
)
...
...
@@ -82,7 +83,7 @@ class ObservePredictions(TreeObsForRailEnv):
# We are going to track what cells where considered while building the obervation and make them accesible
# For rendering
visited
=
s
et
()
visited
=
OrderedS
et
()
for
_idx
in
range
(
10
):
# Check if any of the other prediction overlap with agents own predictions
x_coord
=
self
.
predictions
[
handle
][
_idx
][
1
]
...
...
This diff is collapsed.
Click to expand it.
flatland/core/grid/rail_env_grid.py
+
2
−
1
View file @
df18b268
from
flatland.core.grid.grid4
import
Grid4Transitions
from
flatland.utils.ordered_set
import
OrderedSet
class
RailEnvTransitions
(
Grid4Transitions
):
...
...
@@ -44,7 +45,7 @@ class RailEnvTransitions(Grid4Transitions):
)
# create this to make validation faster
self
.
transitions_all
=
s
et
()
self
.
transitions_all
=
OrderedS
et
()
for
index
,
trans
in
enumerate
(
self
.
transitions
):
self
.
transitions_all
.
add
(
trans
)
if
index
in
(
2
,
4
,
6
,
7
,
8
,
9
,
10
):
...
...
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