| 9 | using pyvrp::search::Solution; |
| 10 | |
| 11 | Solution::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 | |
| 27 | void Solution::load(pyvrp::Solution const &solution) |
| 28 | { |
nothing calls this directly
no test coverage detected