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

Method finaliseBack

pyvrp/cpp/DurationSegment.h:231–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229}
230
231DurationSegment DurationSegment::finaliseBack() const
232{
233 // We finalise this segment by taking into account the end time of the
234 // previous trip, and then merging with this segment, finalised at the
235 // start, because that accounts for release times and our earliest and
236 // latest start (and, as a consequence, end).
237 DurationSegment const prev = {0, 0, 0, prevEndLate_};
238 DurationSegment const finalised = merge(prev, finaliseFront());
239
240 return {0,
241 0,
242 finalised.endEarly(),
243 // The next trip is free to start at any time after this trip can
244 // end, so the latest start is not constrained. However, starting
245 // after our latest end will incur wait duration at the depot.
246 std::numeric_limits<Duration>::max(),
247 // The next trip cannot leave the depot before we return, so we
248 // impose our earliest end as a release time.
249 finalised.endEarly(),
250 cumDuration_ + finalised.duration(),
251 cumTimeWarp_ + finalised.timeWarp(),
252 finalised.endLate()};
253}
254
255DurationSegment DurationSegment::finaliseFront() const
256{

Callers 1

updateMethod · 0.80

Calls 4

endEarlyMethod · 0.80
endLateMethod · 0.80
durationMethod · 0.45
timeWarpMethod · 0.45

Tested by

no test coverage detected