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
ebbbe6fb
Commit
ebbbe6fb
authored
5 years ago
by
u214892
Browse files
Options
Downloads
Patches
Plain Diff
bugfix test_multi_speed
parent
13cce94b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_multi_speed.py
+3
-4
3 additions, 4 deletions
tests/test_multi_speed.py
with
3 additions
and
4 deletions
tests/test_multi_speed.py
+
3
−
4
View file @
ebbbe6fb
...
@@ -66,7 +66,7 @@ def test_multi_speed_init():
...
@@ -66,7 +66,7 @@ def test_multi_speed_init():
# Run episode
# Run episode
for
step
in
range
(
100
):
for
step
in
range
(
100
):
# Chose an action for each agent in the environment
# Cho
o
se an action for each agent in the environment
for
a
in
range
(
env
.
get_num_agents
()):
for
a
in
range
(
env
.
get_num_agents
()):
action
=
agent
.
act
(
0
)
action
=
agent
.
act
(
0
)
action_dict
.
update
({
a
:
action
})
action_dict
.
update
({
a
:
action
})
...
@@ -75,12 +75,11 @@ def test_multi_speed_init():
...
@@ -75,12 +75,11 @@ def test_multi_speed_init():
assert
old_pos
[
a
]
==
env
.
agents
[
a
].
position
assert
old_pos
[
a
]
==
env
.
agents
[
a
].
position
# Environment step which returns the observations for all agents, their corresponding
# Environment step which returns the observations for all agents, their corresponding
# reward and whether the
ir
are done
# reward and whether the
y
are done
_
,
_
,
_
,
_
=
env
.
step
(
action_dict
)
_
,
_
,
_
,
_
=
env
.
step
(
action_dict
)
# Update old position whenever an agent was allowed to move
# Update old position whenever an agent was allowed to move
for
i_agent
in
range
(
env
.
get_num_agents
()):
for
i_agent
in
range
(
env
.
get_num_agents
()):
if
(
step
+
1
)
%
(
i_agent
+
1
)
==
0
:
if
(
step
+
1
)
%
(
i_agent
+
1
)
==
0
:
print
(
step
,
i_agent
,
env
.
agents
[
a
].
position
)
print
(
step
,
i_agent
,
env
.
agents
[
i_agent
].
position
)
old_pos
[
i_agent
]
=
env
.
agents
[
i_agent
].
position
old_pos
[
i_agent
]
=
env
.
agents
[
i_agent
].
position
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