136 using difference_type = std::vector<Vehicle_node>::difference_type;
137 auto node = begin() +
static_cast<difference_type
>(from);
139 while (node != end()) {
140 if (node == begin()) {
153 using difference_type = std::vector<double>::difference_type;
154 pgassert(pos < size() - 1 &&
static_cast<difference_type
>(pos) > 0);
155 std::deque<Vehicle_node>::erase(std::deque<Vehicle_node>::begin() +
static_cast<difference_type
>(pos));
159 using difference_type = std::vector<double>::difference_type;
160 pgassert(pos < size() &&
static_cast<difference_type
>(pos) > 0);
161 std::deque<Vehicle_node>::insert(std::deque<Vehicle_node>::begin() +
static_cast<difference_type
>(pos), node);
188 std::deque<Vehicle_node>::erase(
189 std::remove_if(begin(), end(),
193 for (
size_t pos = 0 ; pos < size() ; ++pos) {
194 if (node.
idx() == at(pos).idx()) {
231 std::swap(at(i), at(j));
243 m_capacity(p_capacity),
245 std::deque<Vehicle_node>::push_back(p_starting_site);
246 std::deque<Vehicle_node>::push_back(p_ending_site);
253 std::ostringstream log;
254 log <<
"truck " <<
id() <<
"(" <<
idx() <<
")" <<
" (";
255 for (
const auto &p_stop : *
this) {
256 if (!(p_stop == front())) log <<
", ";
257 p_stop.is_start() || p_stop.is_end()?
258 log << p_stop.type_str() <<
id() :
259 log << p_stop.type_str() << p_stop.order();
261 log << std::fixed << std::setprecision(4) <<
")\t"
273 std::ostringstream key;
275 for (
const auto &p_stop : *
this) {
276 if (!(p_stop == front())) key <<
",";
278 if (p_stop.is_start() || p_stop.is_end()) {
279 key << p_stop.type_str();
281 key << p_stop.type_str() << p_stop.order();
291 std::vector<Solution_rt>
293 std::vector<Solution_rt> result;
295 for (
const auto &p_stop : *
this) {
296 result.push_back(p_stop.get_postgres_result(vid,
id(), stop_seq));
307 if (
is_phony())
return std::vector<Id>();
308 std::vector<Id> result;
309 for (
const auto &p_stop : *
this) {
310 if (p_stop.is_start() || p_stop.is_end())
continue;
311 result.push_back(p_stop.order());
335 size_t high = size();
336 size_t low_limit = high;
339 while (low_limit > low
340 && at(low_limit - 1).is_compatible_IJ(nodeI,
speed())
341 && !at(low_limit - 1).is_pickup()) {
370 size_t high = size();
371 size_t low_limit = high;
374 while (low_limit > low
375 && at(low_limit - 1).is_compatible_IJ(nodeI)) {
401 size_t high = size();
402 size_t high_limit = low;
405 while (high_limit < high
418 std::pair<size_t, size_t>
422 return std::make_pair(low, high);
425 std::pair<size_t, size_t>
429 return std::make_pair(low, high);
467 if (lhs.size() < rhs.size())
return true;