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
38b49cf5
Commit
38b49cf5
authored
5 years ago
by
Erik Nygren
Committed by
spmohanty
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fixed first tests in malfunction test
parent
81819368
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/flatland_2_0_example.py
+4
-0
4 additions, 0 deletions
examples/flatland_2_0_example.py
flatland/envs/distance_map.py
+1
-0
1 addition, 0 deletions
flatland/envs/distance_map.py
tests/test_flatland_malfunction.py
+8
-0
8 additions, 0 deletions
tests/test_flatland_malfunction.py
with
13 additions
and
0 deletions
examples/flatland_2_0_example.py
+
4
−
0
View file @
38b49cf5
...
...
@@ -37,7 +37,11 @@ env = RailEnv(width=100,
seed
=
14
,
# Random seed
grid_mode
=
False
,
max_rails_between_cities
=
2
,
<<<<<<<
HEAD
max_rails_in_city
=
13
,
=======
max_rails_in_city
=
8
,
>>>>>>>
fixed
first
tests
in
malfunction
test
),
schedule_generator
=
sparse_schedule_generator
(
speed_ration_map
),
number_of_agents
=
100
,
...
...
This diff is collapsed.
Click to expand it.
flatland/envs/distance_map.py
+
1
−
0
View file @
38b49cf5
...
...
@@ -55,6 +55,7 @@ class DistanceMap:
self
.
env_width
=
rail
.
width
def
_compute
(
self
,
agents
:
List
[
EnvAgent
],
rail
:
GridTransitionMap
):
print
(
"
computing distance map
"
)
self
.
agents_previous_computation
=
self
.
agents
self
.
distance_map
=
np
.
inf
*
np
.
ones
(
shape
=
(
len
(
agents
),
self
.
env_height
,
...
...
This diff is collapsed.
Click to expand it.
tests/test_flatland_malfunction.py
+
8
−
0
View file @
38b49cf5
...
...
@@ -82,7 +82,11 @@ def test_malfunction_process():
obs_builder_object
=
SingleAgentNavigationObs
()
)
# reset to initialize agents_static
<<<<<<<
HEAD
obs
,
info
=
env
.
reset
(
False
,
False
,
True
,
random_seed
=
10
)
=======
obs
,
info
=
env
.
reset
(
False
,
False
,
True
,
random_seed
=
0
)
>>>>>>>
fixed
first
tests
in
malfunction
test
print
(
env
.
agents
[
0
].
malfunction_data
)
# Check that a initial duration for malfunction was assigned
assert
env
.
agents
[
0
].
malfunction_data
[
'
next_malfunction
'
]
>
0
...
...
@@ -151,7 +155,11 @@ def test_malfunction_process_statistically():
obs_builder_object
=
SingleAgentNavigationObs
()
)
# reset to initialize agents_static
<<<<<<<
HEAD
env
.
reset
(
True
,
True
,
False
,
random_seed
=
10
)
=======
env
.
reset
(
False
,
False
,
False
,
random_seed
=
0
)
>>>>>>>
fixed
first
tests
in
malfunction
test
env
.
agents
[
0
].
target
=
(
0
,
0
)
nb_malfunction
=
0
...
...
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