MCPcopy Create free account
hub / github.com/PyVRP/PyVRP / test_before_max_runtime

Function test_before_max_runtime

tests/stop/test_MultipleCriteria.py:30–38  ·  view source on GitHub ↗

Tests that the stopping criterion allows iterations if the maximum runtime has not yet been violated.

(max_runtime)

Source from the content-addressed store, hash-verified

28
29@mark.parametrize("max_runtime", [0.01, 0.05, 0.10])
30def test_before_max_runtime(max_runtime):
31 """
32 Tests that the stopping criterion allows iterations if the maximum runtime
33 has not yet been violated.
34 """
35 stop = MultipleCriteria([MaxIterations(101), MaxRuntime(max_runtime)])
36
37 for _ in range(100):
38 assert_(not stop(1))
39
40
41@mark.parametrize("max_runtime", [0.01, 0.05, 0.10])

Callers

nothing calls this directly

Calls 3

MultipleCriteriaClass · 0.90
MaxIterationsClass · 0.90
MaxRuntimeClass · 0.90

Tested by

no test coverage detected