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
074401cd
Commit
074401cd
authored
5 years ago
by
Erik Nygren
Browse files
Options
Downloads
Patches
Plain Diff
updated custom_observation_example.py to highlight how we use predictors
and render custom obvsercations
parent
84402e1c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
flatland/envs/observations.py
+1
-0
1 addition, 0 deletions
flatland/envs/observations.py
flatland/envs/predictions.py
+1
-1
1 addition, 1 deletion
flatland/envs/predictions.py
flatland/utils/rendertools.py
+0
-4
0 additions, 4 deletions
flatland/utils/rendertools.py
with
2 additions
and
5 deletions
flatland/envs/observations.py
+
1
−
0
View file @
074401cd
...
@@ -308,6 +308,7 @@ class TreeObsForRailEnv(ObservationBuilder):
...
@@ -308,6 +308,7 @@ class TreeObsForRailEnv(ObservationBuilder):
We walk along the branch and collect the information documented in the get() function.
We walk along the branch and collect the information documented in the get() function.
If there is a branching point a new node is created and each possible branch is explored.
If there is a branching point a new node is created and each possible branch is explored.
"""
"""
# [Recursive branch opened]
# [Recursive branch opened]
if
depth
>=
self
.
max_depth
+
1
:
if
depth
>=
self
.
max_depth
+
1
:
return
[],
[]
return
[],
[]
...
...
This diff is collapsed.
Click to expand it.
flatland/envs/predictions.py
+
1
−
1
View file @
074401cd
...
@@ -86,7 +86,7 @@ class ShortestPathPredictorForRailEnv(PredictionBuilder):
...
@@ -86,7 +86,7 @@ class ShortestPathPredictorForRailEnv(PredictionBuilder):
The prediction acts as if no other agent is in the environment and always takes the forward action.
The prediction acts as if no other agent is in the environment and always takes the forward action.
"""
"""
def
__init__
(
self
,
max_depth
):
def
__init__
(
self
,
max_depth
=
20
):
self
.
max_depth
=
max_depth
self
.
max_depth
=
max_depth
def
get
(
self
,
custom_args
=
None
,
handle
=
None
):
def
get
(
self
,
custom_args
=
None
,
handle
=
None
):
...
...
This diff is collapsed.
Click to expand it.
flatland/utils/rendertools.py
+
0
−
4
View file @
074401cd
...
@@ -304,10 +304,6 @@ class RenderTool(object):
...
@@ -304,10 +304,6 @@ class RenderTool(object):
warnings
.
warn
(
warnings
.
warn
(
"
Predictor did not provide any predicted cells to render.
\
"
Predictor did not provide any predicted cells to render.
\
Predictors builder needs to populate: env.dev_pred_dict
"
)
Predictors builder needs to populate: env.dev_pred_dict
"
)
else
:
else
:
for
agent
in
agent_handles
:
for
agent
in
agent_handles
:
color
=
self
.
gl
.
get_agent_color
(
agent
)
color
=
self
.
gl
.
get_agent_color
(
agent
)
...
...
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