Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
marl-flatland
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
manavsinghal157
marl-flatland
Commits
c53739a9
Commit
c53739a9
authored
4 years ago
by
Egli Adrian (IT-SCI-API-PFI)
Browse files
Options
Downloads
Patches
Plain Diff
refactored file name
parent
a8631db6
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
run.py
+1
-1
1 addition, 1 deletion
run.py
utils/fast_tree_obs.py
+8
-3
8 additions, 3 deletions
utils/fast_tree_obs.py
with
9 additions
and
4 deletions
run.py
+
1
−
1
View file @
c53739a9
...
...
@@ -27,7 +27,7 @@ VERBOSE = True
# Checkpoint to use (remember to push it!)
# checkpoint = "./checkpoints/201112143850-5400.pth" # 21.220418678677177 DEPTH=2 AGENTS=10
checkpoint
=
"
./checkpoints/201113211844-6
2
00.pth
"
# 19.690047767961005 DEPTH=2 AGENTS=20
checkpoint
=
"
./checkpoints/201113211844-6
7
00.pth
"
# 19.690047767961005 DEPTH=2 AGENTS=20
# Use last action cache
...
...
This diff is collapsed.
Click to expand it.
utils/fast_tree_obs.py
+
8
−
3
View file @
c53739a9
from
typing
import
List
,
Optional
import
numpy
as
np
from
flatland.core.env_observation_builder
import
ObservationBuilder
from
flatland.core.grid.grid4_utils
import
get_new_position
...
...
@@ -232,6 +234,12 @@ class FastTreeObs(ObservationBuilder):
return
has_opp_agent
,
has_same_agent
,
has_target
,
visited
def
get_many
(
self
,
handles
:
Optional
[
List
[
int
]]
=
None
):
self
.
dead_lock_avoidance_agent
.
start_step
()
observations
=
super
().
get_many
(
handles
)
self
.
dead_lock_avoidance_agent
.
end_step
()
return
observations
def
get
(
self
,
handle
):
# all values are [0,1]
# observation[0] : 1 path towards target (direction 0) / otherwise 0 -> path is longer or there is no path
...
...
@@ -262,9 +270,6 @@ class FastTreeObs(ObservationBuilder):
# observation[25] : If there is a switch on the path which agent can not use -> 1
# observation[26] : If there the dead-lock avoidance agent predicts a deadlock -> 1
if
handle
==
0
:
self
.
dead_lock_avoidance_agent
.
start_step
()
observation
=
np
.
zeros
(
self
.
observation_dim
)
visited
=
[]
agent
=
self
.
env
.
agents
[
handle
]
...
...
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