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
af698037
Commit
af698037
authored
Apr 29, 2019
by
Erik Nygren
Browse files
minor bugfixes and added TODO for observation speed up
parent
a355b142
Pipeline
#435
passed with stage
in 2 minutes and 38 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
examples/training_navigation.py
View file @
af698037
...
...
@@ -109,9 +109,10 @@ for trials in range(1, n_trials + 1):
for
a
in
range
(
env
.
number_of_agents
):
if
demo
:
eps
=
0
action
=
2
#
agent.act(np.array(obs[a]), eps=eps)
action
=
agent
.
act
(
np
.
array
(
obs
[
a
]),
eps
=
eps
)
action_prob
[
action
]
+=
1
action_dict
.
update
({
a
:
action
})
env
.
obs_builder
.
util_print_obs_subtree
(
tree
=
obs
[
a
],
num_features_per_node
=
5
)
# Environment step
next_obs
,
all_rewards
,
done
,
_
=
env
.
step
(
action_dict
)
for
a
in
range
(
env
.
number_of_agents
):
...
...
@@ -126,7 +127,7 @@ for trials in range(1, n_trials + 1):
if
done
[
'__all__'
]:
env_done
=
1
break
# Epsi
o
ln decay
# Epsil
o
n decay
eps
=
max
(
eps_end
,
eps_decay
*
eps
)
# decrease epsilon
done_window
.
append
(
env_done
)
...
...
flatland/core/env_observation_builder.py
View file @
af698037
...
...
@@ -326,7 +326,7 @@ class TreeObsForRailEnv(ObservationBuilder):
if
not
last_isDeadEnd
:
# Keep walking through the tree along `direction'
exploring
=
True
# TODO: Remove below calculation, this is computed already above and could be reused
for
i
in
range
(
4
):
if
cell_transitions
[
i
]:
position
=
self
.
_new_position
(
position
,
i
)
...
...
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