Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Flatland
Flatland
Commits
2c45e16b
Commit
2c45e16b
authored
Jul 02, 2019
by
spiglerg
Browse files
fixed issue
#73
parent
5a5d7980
Pipeline
#1272
failed with stages
in 5 minutes and 50 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
flatland/envs/rail_env.py
View file @
2c45e16b
...
...
@@ -189,7 +189,7 @@ class RailEnv(Environment):
self
.
rewards_dict
[
iAgent
]
=
0
if
self
.
dones
[
"__all__"
]:
self
.
rewards_dict
=
[
r
+
global_reward
for
r
in
self
.
rewards_dict
]
self
.
rewards_dict
=
{
i
:
r
+
global_reward
for
i
,
r
in
self
.
rewards_dict
.
items
()}
return
self
.
_get_observations
(),
self
.
rewards_dict
,
self
.
dones
,
{}
# for i in range(len(self.agents_handles)):
...
...
@@ -297,7 +297,7 @@ class RailEnv(Environment):
# Check for end of episode + add global reward to all rewards!
if
np
.
all
([
np
.
array_equal
(
agent2
.
position
,
agent2
.
target
)
for
agent2
in
self
.
agents
]):
self
.
dones
[
"__all__"
]
=
True
self
.
rewards_dict
=
[
0
*
r
+
global_reward
for
r
in
self
.
rewards_dict
]
self
.
rewards_dict
=
{
i
:
0
*
r
+
global_reward
for
i
,
r
in
self
.
rewards_dict
.
items
()}
return
self
.
_get_observations
(),
self
.
rewards_dict
,
self
.
dones
,
{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment