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

Method merge

pyvrp/cpp/LoadSegment.h:99–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97};
98
99LoadSegment LoadSegment::merge(LoadSegment const &first,
100 LoadSegment const &second)
101{
102 // See Vidal et al. (2014) for details. This function implements equations
103 // (9) -- (11) of https://doi.org/10.1016/j.ejor.2013.09.045.
104 return {
105 first.delivery_ + second.delivery_,
106 first.pickup_ + second.pickup_,
107 std::max(first.load_ + second.delivery_, second.load_ + first.pickup_),
108 first.excessLoad_ + second.excessLoad_};
109}
110
111Load LoadSegment::excessLoad(Load capacity) const
112{

Calls

no outgoing calls