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

Function test_excess_load_capacity

tests/test_LoadSegment.py:62–75  ·  view source on GitHub ↗

Tests that excess load is correctly evaluated and merged.

()

Source from the content-addressed store, hash-verified

60
61
62def test_excess_load_capacity():
63 """
64 Tests that excess load is correctly evaluated and merged.
65 """
66 before = LoadSegment(5, 5, 5, 30)
67 after = LoadSegment(2, 2, 2, 5)
68 merged = LoadSegment.merge(before, after)
69
70 # There's seven load on this segment, but 30 excess load from some part of
71 # the route executed before the last return to the depot, and 5 excess load
72 # from part of the route executed after the next return to the depot.
73 assert_equal(merged.load(), 7)
74 assert_equal(merged.excess_load(7), 35)
75 assert_equal(merged.excess_load(0), 42)
76
77
78@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

LoadSegmentClass · 0.85
mergeMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected