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

Method inplaceCost

pyvrp/cpp/search/primitives.cpp:98–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98pyvrp::Cost pyvrp::search::inplaceCost(Route::Node *U,
99 Route::Node *V,
100 ProblemData const &data,
101 CostEvaluator const &costEvaluator)
102{
103 if (U->route() || !V->route())
104 return 0;
105
106 auto const *route = V->route();
107 ProblemData::Client const &uClient = data.location(U->client());
108 ProblemData::Client const &vClient = data.location(V->client());
109
110 Cost deltaCost = vClient.prize - uClient.prize;
111
112 costEvaluator.deltaCost<true>(
113 deltaCost,
114 Route::Proposal(route->before(V->idx() - 1),
115 ClientSegment(data, U->client()),
116 route->after(V->idx() + 1)));
117
118 return deltaCost;
119}

Callers

nothing calls this directly

Calls 8

ProposalClass · 0.85
ClientSegmentClass · 0.85
locationMethod · 0.80
clientMethod · 0.80
beforeMethod · 0.80
idxMethod · 0.80
afterMethod · 0.80
routeMethod · 0.45

Tested by

no test coverage detected