| 97 | }; |
| 98 | |
| 99 | LoadSegment 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 | |
| 111 | Load LoadSegment::excessLoad(Load capacity) const |
| 112 | { |
no outgoing calls