Commit 9a35f2a9 authored by MasterScrat's avatar MasterScrat
Browse files

Fixed tests following malfunction rate fix

parent 213fa805
Pipeline #4464 passed with stages
in 72 minutes and 55 seconds
......@@ -119,9 +119,9 @@ def test_malfunction_process():
def test_malfunction_process_statistically():
"""Tests hat malfunctions are produced by stochastic_data!"""
"""Tests that malfunctions are produced by stochastic_data!"""
# Set fixed malfunction duration for this test
stochastic_data = MalfunctionParameters(malfunction_rate=5, # Rate of malfunction occurence
stochastic_data = MalfunctionParameters(malfunction_rate=1/5, # Rate of malfunction occurence
min_duration=5, # Minimal duration of malfunction
max_duration=5 # Max duration of malfunction
)
......@@ -168,7 +168,7 @@ def test_malfunction_process_statistically():
def test_malfunction_before_entry():
"""Tests that malfunctions are working properly for agents before entering the environment!"""
# Set fixed malfunction duration for this test
stochastic_data = MalfunctionParameters(malfunction_rate=2, # Rate of malfunction occurence
stochastic_data = MalfunctionParameters(malfunction_rate=1/2, # Rate of malfunction occurrence
min_duration=10, # Minimal duration of malfunction
max_duration=10 # Max duration of malfunction
)
......@@ -215,7 +215,7 @@ def test_malfunction_values_and_behavior():
rail, rail_map = make_simple_rail2()
action_dict: Dict[int, RailEnvActions] = {}
stochastic_data = MalfunctionParameters(malfunction_rate=0.001, # Rate of malfunction occurence
stochastic_data = MalfunctionParameters(malfunction_rate=1/0.001, # Rate of malfunction occurence
min_duration=10, # Minimal duration of malfunction
max_duration=10 # Max duration of malfunction
)
......@@ -241,7 +241,7 @@ def test_malfunction_values_and_behavior():
def test_initial_malfunction():
stochastic_data = MalfunctionParameters(malfunction_rate=1000, # Rate of malfunction occurence
stochastic_data = MalfunctionParameters(malfunction_rate=1/1000, # Rate of malfunction occurence
min_duration=2, # Minimal duration of malfunction
max_duration=5 # Max duration of malfunction
)
......@@ -390,7 +390,7 @@ def test_initial_malfunction_stop_moving():
def test_initial_malfunction_do_nothing():
stochastic_data = MalfunctionParameters(malfunction_rate=70, # Rate of malfunction occurence
stochastic_data = MalfunctionParameters(malfunction_rate=1/70, # Rate of malfunction occurence
min_duration=2, # Minimal duration of malfunction
max_duration=5 # Max duration of malfunction
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment