Skip to content

Commit 6524a61

Browse files
committed
[MINOR] Use new simulator stop condition
1 parent 23ea466 commit 6524a61

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/bsk_rl/sim/simulator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ def run(self) -> None:
183183
actionFunction=lambda sim: sim.logger.info("Max step duration reached"),
184184
terminal=True,
185185
)
186-
self.ConfigureStopTime(mc.sec2nano(min(self.time_limit, 2**31)))
186+
self.ConfigureStopTime(
187+
mc.sec2nano(min(self.time_limit, 2**31)), StopCondition=">="
188+
)
187189
self.ExecuteSimulation()
188190

189191
def delete_event(self, event_name) -> None:

tests/unittest/sim/test_simulator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,6 @@ def test_run(self, simbase_init, start_time, step_duration, time_limit, stop_tim
6565
sim = self.mock_sim(max_step_duration=step_duration, time_limit=time_limit)
6666
sim.TotalSim.CurrentNanos = start_time * 1000000000
6767
sim.run()
68-
sim.ConfigureStopTime.assert_called_with(time_limit * 1000000000)
68+
sim.ConfigureStopTime.assert_called_with(
69+
time_limit * 1000000000, StopCondition=">="
70+
)

0 commit comments

Comments
 (0)