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

Method timeWarp

pyvrp/cpp/DurationSegment.h:269–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267}
268
269Duration DurationSegment::timeWarp(Duration maxDuration) const
270{
271 auto const timeWarp = cumTimeWarp_ + timeWarp_;
272 auto const netDuration = duration() - timeWarp;
273
274 return timeWarp
275 // Additional time warp from having to wait until release time.
276 + std::max<Duration>(releaseTime_ - startLate_, 0)
277 // Max duration constraint applies only to net route duration,
278 // subtracting existing time warp. Use ternary to avoid underflow.
279 + (netDuration > maxDuration ? netDuration - maxDuration : 0);
280}
281
282Duration DurationSegment::startEarly() const
283{

Callers 1

finaliseBackMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected