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
yoogottamk
Flatland
Commits
5f2885d0
Commit
5f2885d0
authored
5 years ago
by
Erik Nygren
Browse files
Options
Downloads
Patches
Plain Diff
file loading bug fix
parent
03833fd9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
flatland/envs/schedule_generators.py
+11
-3
11 additions, 3 deletions
flatland/envs/schedule_generators.py
with
11 additions
and
3 deletions
flatland/envs/schedule_generators.py
+
11
−
3
View file @
5f2885d0
...
@@ -228,14 +228,22 @@ def schedule_from_file(filename) -> ScheduleGenerator:
...
@@ -228,14 +228,22 @@ def schedule_from_file(filename) -> ScheduleGenerator:
data
=
msgpack
.
unpackb
(
load_data
,
use_list
=
False
,
encoding
=
'
utf-8
'
)
data
=
msgpack
.
unpackb
(
load_data
,
use_list
=
False
,
encoding
=
'
utf-8
'
)
# agents are always reset as not moving
# agents are always reset as not moving
agents_static
=
[
EnvAgentStatic
(
d
[
0
],
d
[
1
],
d
[
2
],
d
[
3
],
d
[
4
],
d
[
5
])
for
d
in
data
[
"
agents_static
"
]]
if
len
(
data
[
'
agents_static
'
][
0
])
>
5
:
print
(
len
(
data
[
'
agents_static
'
][
0
]))
agents_static
=
[
EnvAgentStatic
(
d
[
0
],
d
[
1
],
d
[
2
],
d
[
3
],
d
[
4
],
d
[
5
])
for
d
in
data
[
"
agents_static
"
]]
else
:
agents_static
=
[
EnvAgentStatic
(
d
[
0
],
d
[
1
],
d
[
2
],
d
[
3
])
for
d
in
data
[
"
agents_static
"
]]
# setup with loaded data
# setup with loaded data
agents_position
=
[
a
.
position
for
a
in
agents_static
]
agents_position
=
[
a
.
position
for
a
in
agents_static
]
agents_direction
=
[
a
.
direction
for
a
in
agents_static
]
agents_direction
=
[
a
.
direction
for
a
in
agents_static
]
agents_target
=
[
a
.
target
for
a
in
agents_static
]
agents_target
=
[
a
.
target
for
a
in
agents_static
]
agents_speed
=
[
a
.
speed_data
[
'
speed
'
]
for
a
in
agents_static
]
if
len
(
data
[
'
agents_static
'
][
0
])
>
5
:
agents_malfunction
=
[
a
.
malfunction_data
[
'
malfunction_rate
'
]
for
a
in
agents_static
]
agents_speed
=
[
a
.
speed_data
[
'
speed
'
]
for
a
in
agents_static
]
agents_malfunction
=
[
a
.
malfunction_data
[
'
malfunction_rate
'
]
for
a
in
agents_static
]
else
:
agents_speed
=
None
agents_malfunction
=
None
return
agents_position
,
agents_direction
,
agents_target
,
agents_speed
,
agents_malfunction
return
agents_position
,
agents_direction
,
agents_target
,
agents_speed
,
agents_malfunction
return
generator
return
generator
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