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

Method Solution

pyvrp/cpp/search/Solution.cpp:11–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9using pyvrp::search::Solution;
10
11Solution::Solution(ProblemData const &data) : data_(data)
12{
13 nodes.reserve(data.numLocations());
14 for (size_t loc = 0; loc != data.numLocations(); ++loc)
15 nodes.emplace_back(loc);
16
17 routes.reserve(data.numVehicles());
18 size_t rIdx = 0;
19 for (size_t vehType = 0; vehType != data.numVehicleTypes(); ++vehType)
20 {
21 auto const numAvailable = data.vehicleType(vehType).numAvailable;
22 for (size_t vehicle = 0; vehicle != numAvailable; ++vehicle)
23 routes.emplace_back(data, rIdx++, vehType);
24 }
25}
26
27void Solution::load(pyvrp::Solution const &solution)
28{

Callers

nothing calls this directly

Calls 5

reserveMethod · 0.80
numLocationsMethod · 0.80
numVehiclesMethod · 0.80
numVehicleTypesMethod · 0.80
vehicleTypeMethod · 0.45

Tested by

no test coverage detected