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
sfwatergit
Flatland
Commits
7a28373a
Commit
7a28373a
authored
5 years ago
by
Egli Adrian (IT-SCI-API-PFI)
Browse files
Options
Downloads
Patches
Plain Diff
.
parent
57fd865a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/demo.py
+3
-2
3 additions, 2 deletions
examples/demo.py
flatland/utils/rendertools.py
+3
-9
3 additions, 9 deletions
flatland/utils/rendertools.py
with
6 additions
and
11 deletions
examples/demo.py
+
3
−
2
View file @
7a28373a
...
...
@@ -101,11 +101,12 @@ class Demo:
# update the actions
action_dict
.
update
({
iAgent
:
action
})
# render
self
.
renderer
.
renderEnv
(
show
=
True
,
show_observations
=
False
)
# environment step (apply the actions to all agents)
next_obs
,
all_rewards
,
done
,
_
=
self
.
env
.
step
(
action_dict
)
# render
self
.
renderer
.
renderEnv
(
show
=
True
,
show_observations
=
False
)
if
done
[
'
__all__
'
]:
break
...
...
This diff is collapsed.
Click to expand it.
flatland/utils/rendertools.py
+
3
−
9
View file @
7a28373a
...
...
@@ -673,15 +673,9 @@ class RenderTool(object):
direction
=
agent
.
direction
old_direction
=
agent
.
direction
if
agent
.
position
[
0
]
==
agent
.
target
[
0
]
and
agent
.
position
[
1
]
==
agent
.
target
[
1
]:
# setAgentAt uses the agent index for the color
self
.
gl
.
setCellOccupied
(
iAgent
,
*
(
agent
.
position
))
self
.
gl
.
setCellOccupied
(
iAgent
,
*
(
agent
.
old_position
))
else
:
# setAgentAt uses the agent index for the color
self
.
gl
.
setCellOccupied
(
iAgent
,
*
(
agent
.
position
))
position
=
agent
.
position
self
.
gl
.
setAgentAt
(
iAgent
,
*
position
,
old_direction
,
direction
,
iSelectedAgent
==
iAgent
)
# setAgentAt uses the agent index for the color
self
.
gl
.
setCellOccupied
(
iAgent
,
*
(
agent
.
position
))
self
.
gl
.
setAgentAt
(
iAgent
,
*
position
,
old_direction
,
direction
,
iSelectedAgent
==
iAgent
)
if
show_observations
:
self
.
renderObs
(
range
(
env
.
get_num_agents
()),
env
.
dev_obs_dict
)
...
...
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