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

Function test_initial_load_calculation

tests/search/test_Route.py:833–846  ·  view source on GitHub ↗

Tests that loads are calculated correctly when there's an initial load present on the vehicle.

(ok_small)

Source from the content-addressed store, hash-verified

831
832
833def test_initial_load_calculation(ok_small):
834 """
835 Tests that loads are calculated correctly when there's an initial load
836 present on the vehicle.
837 """
838 orig_route = Route(ok_small, 0, 0)
839 assert_equal(orig_route.load(), [0])
840
841 veh_type = ok_small.vehicle_type(0)
842 new_type = veh_type.replace(initial_load=[5])
843 new_data = ok_small.replace(vehicle_types=[new_type])
844
845 new_route = Route(new_data, 0, 0)
846 assert_equal(new_route.load(), [5])
847
848
849def test_multi_trip_depots(ok_small_multiple_trips):

Callers

nothing calls this directly

Calls 3

replaceMethod · 0.80
RouteClass · 0.50
loadMethod · 0.45

Tested by

no test coverage detected