65 const bool isPerson = (*res->
persons.begin())->isPerson();
67 std::vector<const Reservation*> sequence{ res, res };
68 std::vector<const Reservation*> toRemove{ res };
75 for (
auto it2 = resIt + 1; it2 != reservations.end();) {
77 const bool isPerson2 = (*res2->
persons.begin())->isPerson();
78 if (capacityLeft < (
int)res2->
persons.size() || isPerson != isPerson2 || !taxi->
compatibleLine(res2)) {
86 const bool pickup = std::find(route.begin(), route.end(), res2->
from) != route.end();
87 const bool dropoff = std::find(route.begin(), route.end(), res2->
to) != route.end();
90 <<
" pickup=" << pickup <<
" startFirst=" << (std::find(route2.begin(), route2.end(), first->from) != route2.end())
91 <<
" dropoff=" << dropoff <<
" endLast=" << (std::find(route2.begin(), route2.end(), last->
to) != route2.end())
94 if ((pickup || std::find(route2.begin(), route2.end(), first->from) != route2.end()) &&
95 (dropoff || std::find(route2.begin(), route2.end(), last->
to) != route2.end())) {
96 std::vector<const Reservation*>::iterator resSeqIt = sequence.begin();
97 EdgePosVector::iterator edgeIt = posSequence.begin();
102 resSeqIt = sequence.insert(resSeqIt, res2) + 1;
103 edgeIt = posSequence.insert(edgeIt, std::make_pair(res2->
from, res2->
fromPos)) + 1;
107 sequence.insert(resSeqIt, res2);
108 posSequence.insert(edgeIt, std::make_pair(res2->
from, res2->
fromPos));
111 sequence.push_back(res2);
112 posSequence.push_back(std::make_pair(res2->
to, res2->
toPos));
114 toRemove.push_back(res2);
115 it2 = reservations.erase(it2);
117 capacityLeft -= (int)res2->
persons.size();
118 if (capacityLeft == 0) {
122 first = sequence.front();
123 last = sequence.back();
130 if (sequence.size() > 2) {
152 resIt = reservations.erase(resIt);
153 return (
int)toRemove.size();
void findInsertionPoint(std::vector< const Reservation * >::iterator &resIt, EdgePosVector::iterator &edgeIt, const EdgePosVector::iterator &edgeEnd, ConstMSEdgeVector &route, const MSEdge *newEdge, const double newPos) const
bool writeXMLHeader(const std::string &rootElement, const std::string &schemaFile, std::map< SumoXMLAttr, std::string > attrs=std::map< SumoXMLAttr, std::string >(), bool includeConfig=true)
Writes an XML header with optional configuration.
virtual bool compute(const E *from, const E *to, const V *const vehicle, SUMOTime msTime, std::vector< const E * > &into, bool silent=false)=0
Builds the route between the given edges using the minimum effort at the given time The definition of...