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
1fe7506b
Commit
1fe7506b
authored
4 years ago
by
MasterScrat
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/jw/option_row_col_labels' into eval_timeouts
parents
fcbe2dee
933254fb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
flatland/utils/rendertools.py
+13
-7
13 additions, 7 deletions
flatland/utils/rendertools.py
with
13 additions
and
7 deletions
flatland/utils/rendertools.py
+
13
−
7
View file @
1fe7506b
...
...
@@ -51,13 +51,14 @@ class RenderTool(object):
show_inactive_agents
=
False
,
# whether to show agents before they start
show_observations
=
True
,
# whether to include observations
show_predictions
=
False
,
# whether to include predictions
show_rowcols
=
False
,
# label the rows and columns
frames
=
False
,
# frame counter to show (intended since invocation)
episode
=
None
,
# int episode number to show
step
=
None
,
# int step number to show in image
selected_agent
=
None
,
# indicate which agent is "selected" in the editor):
return_image
=
False
):
# indicate if image is returned for use in monitor:
return
self
.
renderer
.
render_env
(
show
,
show_agents
,
show_inactive_agents
,
show_observations
,
show_predictions
,
frames
,
episode
,
step
,
selected_agent
,
return_image
)
show_predictions
,
show_rowcols
,
frames
,
episode
,
step
,
selected_agent
,
return_image
)
def
close_window
(
self
):
self
.
renderer
.
close_window
()
...
...
@@ -508,6 +509,7 @@ class RenderLocal(RenderBase):
show_inactive_agents
=
False
,
show_observations
=
True
,
# whether to include observations
show_predictions
=
False
,
# whether to include predictions
show_rowcols
=
False
,
# label the rows and columns
frames
=
False
,
# frame counter to show (intended since invocation)
episode
=
None
,
# int episode number to show
step
=
None
,
# int step number to show in image
...
...
@@ -525,6 +527,7 @@ class RenderLocal(RenderBase):
selected_agent
=
selected_agent
,
show_agents
=
show_agents
,
show_inactive_agents
=
show_inactive_agents
,
show_rowcols
=
show_rowcols
,
return_image
=
return_image
)
else
:
...
...
@@ -533,6 +536,7 @@ class RenderLocal(RenderBase):
show_inactive_agents
=
show_inactive_agents
,
show_observations
=
show_observations
,
show_predictions
=
show_predictions
,
show_rowcols
=
show_rowcols
,
frames
=
frames
,
episode
=
episode
,
step
=
step
,
...
...
@@ -557,6 +561,7 @@ class RenderLocal(RenderBase):
show_inactive_agents
=
False
,
show_observations
=
True
,
# whether to include observations
show_predictions
=
False
,
# whether to include predictions
show_rowcols
=
False
,
# label the rows and columns
frames
=
False
,
# frame counter to show (intended since invocation)
episode
=
None
,
# int episode number to show
step
=
None
,
# int step number to show in image
...
...
@@ -615,7 +620,7 @@ class RenderLocal(RenderBase):
def
render_env_svg
(
self
,
show
=
False
,
show_observations
=
True
,
show_predictions
=
False
,
selected_agent
=
None
,
show_agents
=
True
,
show_inactive_agents
=
False
,
return_image
=
False
show_agents
=
True
,
show_inactive_agents
=
False
,
show_rowcols
=
False
,
return_image
=
False
):
"""
Renders the environment with SVG support (nice image)
...
...
@@ -655,11 +660,12 @@ class RenderLocal(RenderBase):
self
.
gl
.
build_background_map
(
targets
)
# label rows, cols
for
iRow
in
range
(
env
.
height
):
self
.
gl
.
text_rowcol
((
iRow
,
0
),
str
(
iRow
),
layer
=
self
.
gl
.
RAIL_LAYER
)
for
iCol
in
range
(
env
.
width
):
self
.
gl
.
text_rowcol
((
0
,
iCol
),
str
(
iCol
),
layer
=
self
.
gl
.
RAIL_LAYER
)
if
show_rowcols
:
# label rows, cols
for
iRow
in
range
(
env
.
height
):
self
.
gl
.
text_rowcol
((
iRow
,
0
),
str
(
iRow
),
layer
=
self
.
gl
.
RAIL_LAYER
)
for
iCol
in
range
(
env
.
width
):
self
.
gl
.
text_rowcol
((
0
,
iCol
),
str
(
iCol
),
layer
=
self
.
gl
.
RAIL_LAYER
)
if
show_agents
:
...
...
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