diff --git a/tests/test_flatland_malfunction.py b/tests/test_flatland_malfunction.py index 464e7523db805bd1a45441c0666f5d37245439c1..eaa3112708f3f0e5d255b7e454078d9a59e7ca22 100644 --- a/tests/test_flatland_malfunction.py +++ b/tests/test_flatland_malfunction.py @@ -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 )