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
pranjal_dhole
Flatland
Commits
85a46b58
Commit
85a46b58
authored
5 years ago
by
Erik Nygren
Browse files
Options
Downloads
Patches
Plain Diff
minor updates to file loading and features in observation space
parent
d87ade65
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
flatland/envs/observations.py
+2
-1
2 additions, 1 deletion
flatland/envs/observations.py
flatland/envs/rail_env.py
+1
-1
1 addition, 1 deletion
flatland/envs/rail_env.py
notebooks/complex_scene.pkl
+0
-0
0 additions, 0 deletions
notebooks/complex_scene.pkl
with
3 additions
and
2 deletions
flatland/envs/observations.py
+
2
−
1
View file @
85a46b58
...
...
@@ -397,8 +397,9 @@ class TreeObsForRailEnv(ObservationBuilder):
total_transitions
=
bin
(
self
.
env
.
rail
.
get_full_transitions
(
*
position
)).
count
(
"
1
"
)
num_transitions
=
np
.
count_nonzero
(
cell_transitions
)
exploring
=
False
# Detect Switches that can only be used by other agents.
if
total_transitions
>
2
>
num_transitions
:
if
total_transitions
>
2
>
num_transitions
and
tot_dist
<
unusable_switch
:
unusable_switch
=
tot_dist
if
num_transitions
==
1
:
...
...
This diff is collapsed.
Click to expand it.
flatland/envs/rail_env.py
+
1
−
1
View file @
85a46b58
...
...
@@ -446,7 +446,7 @@ class RailEnv(Environment):
# agents are always reset as not moving
self
.
agents_static
=
[
EnvAgentStatic
(
d
[
0
],
d
[
1
],
d
[
2
],
moving
=
False
)
for
d
in
data
[
b
"
agents_static
"
]]
self
.
agents
=
[
EnvAgent
(
d
[
0
],
d
[
1
],
d
[
2
],
d
[
3
],
d
[
4
])
for
d
in
data
[
b
"
agents
"
]]
if
hasattr
(
self
.
obs_builder
,
'
distance_map
'
):
if
hasattr
(
self
.
obs_builder
,
'
distance_map
'
)
and
b
"
distance_maps
"
in
data
.
keys
()
:
self
.
obs_builder
.
distance_map
=
data
[
b
"
distance_maps
"
]
# setup with loaded data
self
.
height
,
self
.
width
=
self
.
rail
.
grid
.
shape
...
...
This diff is collapsed.
Click to expand it.
notebooks/complex_scene.pkl
+
0
−
0
View file @
85a46b58
No preview for this file type
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