| 48 | } // namespace |
| 49 | |
| 50 | pyvrp::Cost pyvrp::search::insertCost(Route::Node *U, |
| 51 | Route::Node *V, |
| 52 | ProblemData const &data, |
| 53 | CostEvaluator const &costEvaluator) |
| 54 | { |
| 55 | if (!V->route() || U->isDepot()) |
| 56 | return 0; |
| 57 | |
| 58 | auto *route = V->route(); |
| 59 | ProblemData::Client const &client = data.location(U->client()); |
| 60 | |
| 61 | Cost deltaCost |
| 62 | = Cost(route->empty()) * route->fixedVehicleCost() - client.prize; |
| 63 | |
| 64 | costEvaluator.deltaCost<true>( |
| 65 | deltaCost, |
| 66 | Route::Proposal(route->before(V->idx()), |
| 67 | ClientSegment(data, U->client()), |
| 68 | route->after(V->idx() + 1))); |
| 69 | |
| 70 | return deltaCost; |
| 71 | } |
| 72 | |
| 73 | pyvrp::Cost pyvrp::search::removeCost(Route::Node *U, |
| 74 | ProblemData const &data, |
nothing calls this directly
no test coverage detected