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
bdfd4f09
Commit
bdfd4f09
authored
Oct 12, 2021
by
mmarti
Browse files
changed 'status' to 'state'
parent
dba7a409
Pipeline
#8731
failed with stages
in 10 minutes and 14 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
flatland/contrib/wrappers/flatland_wrappers.py
View file @
bdfd4f09
...
@@ -25,7 +25,7 @@ def possible_actions_sorted_by_distance(env: RailEnv, handle: int):
...
@@ -25,7 +25,7 @@ def possible_actions_sorted_by_distance(env: RailEnv, handle: int):
agent_virtual_position
=
agent
.
position
agent_virtual_position
=
agent
.
position
else
:
else
:
print
(
"no action possible!"
)
print
(
"no action possible!"
)
print
(
"agent stat
us
: "
,
agent
.
state
)
print
(
"agent stat
e
: "
,
agent
.
state
)
# NEW: if agent is at target, DO_NOTHING, and distance is zero.
# NEW: if agent is at target, DO_NOTHING, and distance is zero.
# NEW: (needs to be tested...)
# NEW: (needs to be tested...)
return
[(
RailEnvActions
.
DO_NOTHING
,
0
)]
*
2
return
[(
RailEnvActions
.
DO_NOTHING
,
0
)]
*
2
...
@@ -215,7 +215,7 @@ class NoChoiceCellsSkipper:
...
@@ -215,7 +215,7 @@ class NoChoiceCellsSkipper:
i
[
"action_required"
]
=
dict
()
i
[
"action_required"
]
=
dict
()
i
[
"malfunction"
]
=
dict
()
i
[
"malfunction"
]
=
dict
()
i
[
"speed"
]
=
dict
()
i
[
"speed"
]
=
dict
()
i
[
"stat
us
"
]
=
dict
()
# TODO: change to "state"
i
[
"stat
e
"
]
=
dict
()
while
len
(
o
)
==
0
:
while
len
(
o
)
==
0
:
obs
,
reward
,
done
,
info
=
self
.
env
.
step
(
action_dict
)
obs
,
reward
,
done
,
info
=
self
.
env
.
step
(
action_dict
)
...
@@ -231,7 +231,7 @@ class NoChoiceCellsSkipper:
...
@@ -231,7 +231,7 @@ class NoChoiceCellsSkipper:
i
[
"action_required"
][
agent_id
]
=
info
[
"action_required"
][
agent_id
]
i
[
"action_required"
][
agent_id
]
=
info
[
"action_required"
][
agent_id
]
i
[
"malfunction"
][
agent_id
]
=
info
[
"malfunction"
][
agent_id
]
i
[
"malfunction"
][
agent_id
]
=
info
[
"malfunction"
][
agent_id
]
i
[
"speed"
][
agent_id
]
=
info
[
"speed"
][
agent_id
]
i
[
"speed"
][
agent_id
]
=
info
[
"speed"
][
agent_id
]
i
[
"stat
us
"
][
agent_id
]
=
info
[
"stat
us
"
][
agent_id
]
# TODO: change to "state"
i
[
"stat
e
"
][
agent_id
]
=
info
[
"stat
e
"
][
agent_id
]
if
self
.
accumulate_skipped_rewards
:
if
self
.
accumulate_skipped_rewards
:
discounted_skipped_reward
=
r
[
agent_id
]
discounted_skipped_reward
=
r
[
agent_id
]
...
...
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