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();
88 const bool pickup2 = std::find(route2.begin(), route2.end(), first->from) != route2.end();
89 const bool dropoff2 = std::find(route2.begin(), route2.end(), last->
to) != route2.end();
93 <<
" pickup=" << pickup <<
" startFirst=" << pickup2
94 <<
" dropoff=" << dropoff <<
" endLast=" << dropoff2
97 if ((pickup || pickup2) && (dropoff || dropoff2)) {
98 std::vector<const Reservation*>::iterator resSeqIt = sequence.begin();
99 EdgePosVector::iterator edgeIt = posSequence.begin();
104 resSeqIt = sequence.insert(resSeqIt, res2) + 1;
105 edgeIt = posSequence.insert(edgeIt, std::make_pair(res2->
from, res2->
fromPos)) + 1;
109 sequence.insert(resSeqIt, res2);
110 posSequence.insert(edgeIt, std::make_pair(res2->
to, res2->
toPos));
113 sequence.push_back(res2);
114 posSequence.push_back(std::make_pair(res2->
to, res2->
toPos));
116 toRemove.push_back(res2);
117 it2 = reservations.erase(it2);
119 capacityLeft -= (int)res2->
persons.size();
120 if (capacityLeft == 0) {
124 first = sequence.front();
125 last = sequence.back();
132 if (sequence.size() > 2) {
154 resIt = reservations.erase(resIt);
155 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...