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
8e7d6bc9
Commit
8e7d6bc9
authored
5 years ago
by
u229589
Browse files
Options
Downloads
Patches
Plain Diff
fix tests for malfunctions since sparse env has changed
parent
cac4559a
No related branches found
Branches containing commit
Tags
submission-v7.8
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_flatland_malfunction.py
+8
-8
8 additions, 8 deletions
tests/test_flatland_malfunction.py
with
8 additions
and
8 deletions
tests/test_flatland_malfunction.py
+
8
−
8
View file @
8e7d6bc9
...
...
@@ -145,7 +145,7 @@ def test_malfunction_process_statistically():
env
.
step
(
action_dict
)
# check that generation of malfunctions works as expected
assert
nb_malfunction
==
1
56
,
"
nb_malfunction={}
"
.
format
(
nb_malfunction
)
assert
nb_malfunction
==
1
28
,
"
nb_malfunction={}
"
.
format
(
nb_malfunction
)
def
test_initial_malfunction
():
...
...
@@ -203,14 +203,14 @@ def test_initial_malfunction():
# malfunctioning ends: starting and running at speed 1.0
),
Replay
(
position
=
(
28
,
4
),
direction
=
Grid4TransitionsEnum
.
W
EST
,
position
=
(
28
,
6
),
direction
=
Grid4TransitionsEnum
.
E
A
ST
,
action
=
RailEnvActions
.
MOVE_FORWARD
,
malfunction
=
0
,
reward
=
env
.
step_penalty
*
1.0
# running at speed 1.0
),
Replay
(
position
=
(
27
,
4
),
position
=
(
27
,
6
),
direction
=
Grid4TransitionsEnum
.
NORTH
,
action
=
RailEnvActions
.
MOVE_FORWARD
,
malfunction
=
0
,
...
...
@@ -294,8 +294,8 @@ def test_initial_malfunction_stop_moving():
reward
=
env
.
start_penalty
+
env
.
step_penalty
*
1.0
# full step penalty while stopped
),
Replay
(
position
=
(
28
,
4
),
direction
=
Grid4TransitionsEnum
.
W
EST
,
position
=
(
28
,
6
),
direction
=
Grid4TransitionsEnum
.
E
A
ST
,
action
=
RailEnvActions
.
MOVE_FORWARD
,
malfunction
=
0
,
reward
=
env
.
step_penalty
*
1.0
# full step penalty while stopped
...
...
@@ -378,8 +378,8 @@ def test_initial_malfunction_do_nothing():
reward
=
env
.
start_penalty
+
env
.
step_penalty
*
1.0
# start penalty + step penalty for speed 1.0
),
Replay
(
position
=
(
28
,
4
),
direction
=
Grid4TransitionsEnum
.
W
EST
,
position
=
(
28
,
6
),
direction
=
Grid4TransitionsEnum
.
E
A
ST
,
action
=
RailEnvActions
.
MOVE_FORWARD
,
malfunction
=
0
,
reward
=
env
.
step_penalty
*
1.0
# step penalty for speed 1.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