Eclipse SUMO - Simulation of Urban MObility
RORouteDef.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2002-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // Base class for a vehicle's route definition
17 /****************************************************************************/
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include <string>
26 #include <iterator>
27 #include <algorithm>
29 #include <utils/common/ToString.h>
30 #include <utils/common/Named.h>
36 #include "ROEdge.h"
37 #include "RORoute.h"
40 #include "RORouteDef.h"
41 #include "ROVehicle.h"
42 
43 // ===========================================================================
44 // static members
45 // ===========================================================================
46 bool RORouteDef::myUsingJTRR(false);
47 
48 // ===========================================================================
49 // method definitions
50 // ===========================================================================
51 RORouteDef::RORouteDef(const std::string& id, const int lastUsed,
52  const bool tryRepair, const bool mayBeDisconnected) :
53  Named(StringUtils::convertUmlaute(id)),
54  myPrecomputed(nullptr), myLastUsed(lastUsed), myTryRepair(tryRepair), myMayBeDisconnected(mayBeDisconnected) {
55 }
56 
57 
59  for (std::vector<RORoute*>::iterator i = myAlternatives.begin(); i != myAlternatives.end(); i++) {
60  if (myRouteRefs.count(*i) == 0) {
61  delete *i;
62  }
63  }
64 }
65 
66 
67 void
69  myAlternatives.push_back(alt);
70 }
71 
72 
73 void
75  std::copy(alt->myAlternatives.begin(), alt->myAlternatives.end(),
76  back_inserter(myAlternatives));
77  std::copy(alt->myAlternatives.begin(), alt->myAlternatives.end(),
78  std::inserter(myRouteRefs, myRouteRefs.end()));
79 }
80 
81 
82 RORoute*
84  SUMOTime begin, const ROVehicle& veh) const {
85  if (myPrecomputed == nullptr) {
86  preComputeCurrentRoute(router, begin, veh);
87  }
88  return myPrecomputed;
89 }
90 
91 
92 void
94  SUMOTime begin, const ROVehicle& veh) const {
95  myNewRoute = false;
97  assert(myAlternatives[0]->getEdgeVector().size() > 0);
98  MsgHandler* mh = (OptionsCont::getOptions().getBool("ignore-errors") ?
100  if (myAlternatives[0]->getFirst()->prohibits(&veh) && (!oc.getBool("repair.from")
101  // do not try to reassign starting edge for trip input
102  || myMayBeDisconnected || myAlternatives[0]->getEdgeVector().size() < 2)) {
103  mh->inform("Vehicle '" + veh.getID() + "' is not allowed to depart on edge '" +
104  myAlternatives[0]->getFirst()->getID() + "'.");
105  return;
106  } else if (myAlternatives[0]->getLast()->prohibits(&veh) && (!oc.getBool("repair.to")
107  // do not try to reassign destination edge for trip input
108  || myMayBeDisconnected || myAlternatives[0]->getEdgeVector().size() < 2)) {
109  // this check is not strictly necessary unless myTryRepair is set.
110  // However, the error message is more helpful than "no connection found"
111  mh->inform("Vehicle '" + veh.getID() + "' is not allowed to arrive on edge '" +
112  myAlternatives[0]->getLast()->getID() + "'.");
113  return;
114  }
115  const bool skipTripRouting = (oc.exists("write-trips") && oc.getBool("write-trips")
117  if ((myTryRepair && !skipTripRouting) || myUsingJTRR) {
118  ConstROEdgeVector newEdges;
119  if (repairCurrentRoute(router, begin, veh, myAlternatives[0]->getEdgeVector(), newEdges)) {
120  if (myAlternatives[0]->getEdgeVector() != newEdges) {
121  if (!myMayBeDisconnected) {
122  WRITE_WARNING("Repaired route of vehicle '" + veh.getID() + "'.");
123  }
124  myNewRoute = true;
125  RGBColor* col = myAlternatives[0]->getColor() != nullptr ? new RGBColor(*myAlternatives[0]->getColor()) : nullptr;
126  myPrecomputed = new RORoute(myID, 0, myAlternatives[0]->getProbability(), newEdges, col, myAlternatives[0]->getStops());
127  } else {
129  }
130  }
131  return;
132  }
134  || OptionsCont::getOptions().getBool("remove-loops")) {
136  } else {
137  // build a new route to test whether it is better
138  ConstROEdgeVector oldEdges;
139  oldEdges.push_back(myAlternatives[0]->getFirst());
140  oldEdges.push_back(myAlternatives[0]->getLast());
141  ConstROEdgeVector edges;
142  repairCurrentRoute(router, begin, veh, oldEdges, edges);
143  // check whether the same route was already used
144  int cheapest = -1;
145  for (int i = 0; i < (int)myAlternatives.size(); i++) {
146  if (edges == myAlternatives[i]->getEdgeVector()) {
147  cheapest = i;
148  break;
149  }
150  }
151  if (cheapest >= 0) {
152  myPrecomputed = myAlternatives[cheapest];
153  } else {
154  RGBColor* col = myAlternatives[0]->getColor() != nullptr ? new RGBColor(*myAlternatives[0]->getColor()) : nullptr;
155  myPrecomputed = new RORoute(myID, 0, 1, edges, col, myAlternatives[0]->getStops());
156  myNewRoute = true;
157  }
158  }
159 }
160 
161 
162 bool
164  SUMOTime begin, const ROVehicle& veh,
165  ConstROEdgeVector oldEdges, ConstROEdgeVector& newEdges) const {
166  MsgHandler* mh = (OptionsCont::getOptions().getBool("ignore-errors") ?
168  const int initialSize = (int)oldEdges.size();
169  if (initialSize == 1) {
170  if (myUsingJTRR) {
172  router.compute(oldEdges.front(), nullptr, &veh, begin, newEdges);
173  } else {
174  newEdges = oldEdges;
175  }
176  } else {
177  if (oldEdges.front()->prohibits(&veh)) {
178  // option repair.from is in effect
179  const std::string& frontID = oldEdges.front()->getID();
180  for (ConstROEdgeVector::iterator i = oldEdges.begin(); i != oldEdges.end();) {
181  if ((*i)->prohibits(&veh) || (*i)->isInternal()) {
182  i = oldEdges.erase(i);
183  } else {
184  WRITE_MESSAGE("Changing invalid starting edge '" + frontID
185  + "' to '" + (*i)->getID() + "' for vehicle '" + veh.getID() + "'.");
186  break;
187  }
188  }
189  }
190  if (oldEdges.size() == 0) {
191  mh->inform("Could not find new starting edge for vehicle '" + veh.getID() + "'.");
192  return false;
193  }
194  if (oldEdges.back()->prohibits(&veh)) {
195  // option repair.to is in effect
196  const std::string& backID = oldEdges.back()->getID();
197  // oldEdges cannot get empty here, otherwise we would have left the stage when checking "from"
198  while (oldEdges.back()->prohibits(&veh) || oldEdges.back()->isInternal()) {
199  oldEdges.pop_back();
200  }
201  WRITE_MESSAGE("Changing invalid destination edge '" + backID
202  + "' to edge '" + oldEdges.back()->getID() + "' for vehicle '" + veh.getID() + "'.");
203  }
204  ConstROEdgeVector mandatory = veh.getMandatoryEdges(oldEdges.front(), oldEdges.back());
205  assert(mandatory.size() >= 2);
206  // removed prohibited
207  for (ConstROEdgeVector::iterator i = oldEdges.begin(); i != oldEdges.end();) {
208  if ((*i)->prohibits(&veh) || (*i)->isInternal()) {
209  // no need to check the mandatories here, this was done before
210  i = oldEdges.erase(i);
211  } else {
212  ++i;
213  }
214  }
215  // reconnect remaining edges
216  if (mandatory.size() > oldEdges.size() && initialSize > 2) {
217  WRITE_MESSAGE("There are stop edges which were not part of the original route for vehicle '" + veh.getID() + "'.");
218  }
219  const ConstROEdgeVector& targets = mandatory.size() > oldEdges.size() ? mandatory : oldEdges;
220  newEdges.push_back(*(targets.begin()));
221  ConstROEdgeVector::iterator nextMandatory = mandatory.begin() + 1;
222  int lastMandatory = 0;
223  for (ConstROEdgeVector::const_iterator i = targets.begin() + 1;
224  i != targets.end() && nextMandatory != mandatory.end(); ++i) {
225  if ((*(i - 1))->isConnectedTo(*i, &veh)) {
226  newEdges.push_back(*i);
227  } else {
228  if (initialSize > 2) {
229  // only inform if the input is (probably) not a trip
230  WRITE_MESSAGE("Edge '" + (*(i - 1))->getID() + "' not connected to edge '" + (*i)->getID() + "' for vehicle '" + veh.getID() + "'.");
231  }
232  const ROEdge* const last = newEdges.back();
233  newEdges.pop_back();
234  if (!router.compute(last, *i, &veh, begin, newEdges)) {
235  // backtrack: try to route from last mandatory edge to next mandatory edge
236  // XXX add option for backtracking in smaller increments
237  // (i.e. previous edge to edge after *i)
238  // we would then need to decide whether we have found a good
239  // tradeoff between faithfulness to the input data and detour-length
240  ConstROEdgeVector edges;
241  if (lastMandatory >= (int)newEdges.size() || last == newEdges[lastMandatory] || !router.compute(newEdges[lastMandatory], *nextMandatory, &veh, begin, edges)) {
242  mh->inform("Mandatory edge '" + (*i)->getID() + "' not reachable by vehicle '" + veh.getID() + "'.");
243  return false;
244  }
245  while (*i != *nextMandatory) {
246  ++i;
247  }
248  newEdges.erase(newEdges.begin() + lastMandatory + 1, newEdges.end());
249  std::copy(edges.begin() + 1, edges.end(), back_inserter(newEdges));
250  }
251  }
252  if (*i == *nextMandatory) {
253  nextMandatory++;
254  lastMandatory = (int)newEdges.size() - 1;
255  }
256  }
257  }
258  return true;
259 }
260 
261 
262 void
264  const ROVehicle* const veh, RORoute* current, SUMOTime begin) {
265  if (myTryRepair || myUsingJTRR) {
266  if (myNewRoute) {
267  delete myAlternatives[0];
268  myAlternatives[0] = current;
269  }
270  const double costs = router.recomputeCosts(current->getEdgeVector(), veh, begin);
271  if (costs < 0) {
272  throw ProcessError("Route '" + getID() + "' (vehicle '" + veh->getID() + "') is not valid.");
273  }
274  current->setCosts(costs);
275  return;
276  }
277  // add the route when it's new
278  if (myNewRoute) {
279  myAlternatives.push_back(current);
280  }
281  // recompute the costs and (when a new route was added) scale the probabilities
282  const double scale = double(myAlternatives.size() - 1) / double(myAlternatives.size());
283  for (std::vector<RORoute*>::iterator i = myAlternatives.begin(); i != myAlternatives.end(); i++) {
284  RORoute* alt = *i;
285  // recompute the costs for all routes
286  const double newCosts = router.recomputeCosts(alt->getEdgeVector(), veh, begin);
287  if (newCosts < 0.) {
288  throw ProcessError("Route '" + current->getID() + "' (vehicle '" + veh->getID() + "') is not valid.");
289  }
290  assert(myAlternatives.size() != 0);
291  if (myNewRoute) {
292  if (*i == current) {
293  // set initial probability and costs
294  alt->setProbability((double)(1.0 / (double) myAlternatives.size()));
295  alt->setCosts(newCosts);
296  } else {
297  // rescale probs for all others
298  alt->setProbability(alt->getProbability() * scale);
299  }
300  }
302  }
303  assert(myAlternatives.size() != 0);
306  // remove with probability of 0 (not mentioned in Gawron)
307  for (std::vector<RORoute*>::iterator i = myAlternatives.begin(); i != myAlternatives.end();) {
308  if ((*i)->getProbability() == 0) {
309  delete *i;
310  i = myAlternatives.erase(i);
311  } else {
312  i++;
313  }
314  }
315  }
316  if ((int)myAlternatives.size() > RouteCostCalculator<RORoute, ROEdge, ROVehicle>::getCalculator().getMaxRouteNumber()) {
317  // only keep the routes with highest probability
318  sort(myAlternatives.begin(), myAlternatives.end(), ComparatorProbability());
319  for (std::vector<RORoute*>::iterator i = myAlternatives.begin() + RouteCostCalculator<RORoute, ROEdge, ROVehicle>::getCalculator().getMaxRouteNumber(); i != myAlternatives.end(); i++) {
320  delete *i;
321  }
323  // rescale probabilities
324  double newSum = 0;
325  for (std::vector<RORoute*>::iterator i = myAlternatives.begin(); i != myAlternatives.end(); i++) {
326  newSum += (*i)->getProbability();
327  }
328  assert(newSum > 0);
329  // @note newSum may be larger than 1 for numerical reasons
330  for (std::vector<RORoute*>::iterator i = myAlternatives.begin(); i != myAlternatives.end(); i++) {
331  (*i)->setProbability((*i)->getProbability() / newSum);
332  }
333  }
334 
335  // find the route to use
336  double chosen = RandHelper::rand();
337  int pos = 0;
338  for (std::vector<RORoute*>::iterator i = myAlternatives.begin(); i != myAlternatives.end() - 1; i++, pos++) {
339  chosen -= (*i)->getProbability();
340  if (chosen <= 0) {
341  myLastUsed = pos;
342  return;
343  }
344  }
345  myLastUsed = pos;
346 }
347 
348 
349 const ROEdge*
351  return myAlternatives[0]->getLast();
352 }
353 
354 
357  bool asAlternatives, bool withExitTimes) const {
358  if (asAlternatives) {
360  for (int i = 0; i != (int)myAlternatives.size(); i++) {
361  myAlternatives[i]->writeXMLDefinition(dev, veh, true, withExitTimes);
362  }
363  dev.closeTag();
364  return dev;
365  } else {
366  return myAlternatives[myLastUsed]->writeXMLDefinition(dev, veh, false, withExitTimes);
367  }
368 }
369 
370 
371 RORouteDef*
372 RORouteDef::copyOrigDest(const std::string& id) const {
373  RORouteDef* result = new RORouteDef(id, 0, true, true);
374  RORoute* route = myAlternatives[0];
375  RGBColor* col = route->getColor() != nullptr ? new RGBColor(*route->getColor()) : nullptr;
376  ConstROEdgeVector edges;
377  edges.push_back(route->getFirst());
378  edges.push_back(route->getLast());
379  result->addLoadedAlternative(new RORoute(id, 0, 1, edges, col, route->getStops()));
380  return result;
381 }
382 
383 
384 RORouteDef*
385 RORouteDef::copy(const std::string& id, const SUMOTime stopOffset) const {
386  RORouteDef* result = new RORouteDef(id, 0, myTryRepair, myMayBeDisconnected);
387  for (std::vector<RORoute*>::const_iterator i = myAlternatives.begin(); i != myAlternatives.end(); i++) {
388  RORoute* route = *i;
389  RGBColor* col = route->getColor() != nullptr ? new RGBColor(*route->getColor()) : nullptr;
390  RORoute* newRoute = new RORoute(id, 0, 1, route->getEdgeVector(), col, route->getStops());
391  newRoute->addStopOffset(stopOffset);
392  result->addLoadedAlternative(newRoute);
393  }
394  return result;
395 }
396 
397 
398 double
400  double sum = 0.;
401  for (std::vector<RORoute*>::const_iterator i = myAlternatives.begin(); i != myAlternatives.end(); i++) {
402  sum += (*i)->getProbability();
403  }
404  return sum;
405 }
406 
407 
408 /****************************************************************************/
RORouteDef::addAlternative
void addAlternative(SUMOAbstractRouter< ROEdge, ROVehicle > &router, const ROVehicle *const, RORoute *current, SUMOTime begin)
Adds an alternative to the list of routes.
Definition: RORouteDef.cpp:263
SUMOAbstractRouter::compute
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...
RORoute::getLast
const ROEdge * getLast() const
Returns the last edge in the route.
Definition: RORoute.h:102
ToString.h
RORoute::getProbability
double getProbability() const
Returns the probability the driver will take this route with.
Definition: RORoute.h:122
WRITE_WARNING
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:275
RORouteDef::buildCurrentRoute
RORoute * buildCurrentRoute(SUMOAbstractRouter< ROEdge, ROVehicle > &router, SUMOTime begin, const ROVehicle &veh) const
Triggers building of the complete route (via preComputeCurrentRoute) or returns precomputed route.
Definition: RORouteDef.cpp:83
RORouteDef::myTryRepair
const bool myTryRepair
Definition: RORouteDef.h:162
Named
Base class for objects which have an id.
Definition: Named.h:56
ROVehicle::getDepartureTime
SUMOTime getDepartureTime() const
Returns the time the vehicle starts at, 0 for triggered vehicles.
Definition: ROVehicle.h:94
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:63
RouteCostCalculator.h
SUMO_ATTR_LAST
Definition: SUMOXMLDefinitions.h:626
SUMO_TAG_ROUTE_DISTRIBUTION
distribution of a route
Definition: SUMOXMLDefinitions.h:214
OptionsCont.h
MsgHandler.h
RORouteDef::addAlternativeDef
void addAlternativeDef(const RORouteDef *alternative)
Adds an alternative loaded from the file.
Definition: RORouteDef.cpp:74
MsgHandler::inform
virtual void inform(std::string msg, bool addType=true)
adds a new error to the list
Definition: MsgHandler.cpp:118
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
RORoute::getEdgeVector
const ConstROEdgeVector & getEdgeVector() const
Returns the list of edges this route consists of.
Definition: RORoute.h:154
OptionsCont::exists
bool exists(const std::string &name) const
Returns the information whether the named option is known.
Definition: OptionsCont.cpp:129
OptionsCont::getBool
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
Definition: OptionsCont.cpp:222
OptionsCont::getOptions
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:57
RORouteDef
Base class for a vehicle's route definition.
Definition: RORouteDef.h:55
RORoute::setCosts
void setCosts(double costs)
Sets the costs of the route.
Definition: RORoute.cpp:65
RouteCostCalculator::getCalculator
static RouteCostCalculator< R, E, V > & getCalculator()
Definition: RouteCostCalculator.h:107
ROVehicle
A vehicle as used by router.
Definition: ROVehicle.h:52
RORoute::getColor
const RGBColor * getColor() const
Returns this route's color.
Definition: RORoute.h:162
ROVehicle.h
RORouteDef.h
RORoute.h
RORouteDef::getOverallProb
double getOverallProb() const
Returns the sum of the probablities of the contained routes.
Definition: RORouteDef.cpp:399
RORouteDef::preComputeCurrentRoute
void preComputeCurrentRoute(SUMOAbstractRouter< ROEdge, ROVehicle > &router, SUMOTime begin, const ROVehicle &veh) const
Builds the complete route (or chooses her from the list of alternatives, when existing)
Definition: RORouteDef.cpp:93
OutputDevice::closeTag
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
Definition: OutputDevice.cpp:253
OutputDevice::writeAttr
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:255
RGBColor
Definition: RGBColor.h:39
RandHelper::rand
static double rand(std::mt19937 *rng=0)
Returns a random real number in [0, 1)
Definition: RandHelper.h:53
MsgHandler
Definition: MsgHandler.h:38
RouteCostCalculator
Abstract base class providing static factory method.
Definition: RouteCostCalculator.h:43
MsgHandler::getWarningInstance
static MsgHandler * getWarningInstance()
Returns the instance to add warnings to.
Definition: MsgHandler.cpp:68
Named.h
ROVehicle::getMandatoryEdges
ConstROEdgeVector getMandatoryEdges(const ROEdge *requiredStart, const ROEdge *requiredEnd) const
compute mandatory edges
Definition: ROVehicle.cpp:165
RORoutable::getID
const std::string & getID() const
Returns the id of the routable.
Definition: RORoutable.h:93
RORouteDef::writeXMLDefinition
OutputDevice & writeXMLDefinition(OutputDevice &dev, const ROVehicle *const veh, bool asAlternatives, bool withExitTimes) const
Saves the built route / route alternatives.
Definition: RORouteDef.cpp:356
OutputDevice.h
ProcessError
Definition: UtilExceptions.h:39
RORouteDef::myRouteRefs
std::set< RORoute * > myRouteRefs
Routes which are deleted someplace else.
Definition: RORouteDef.h:157
RORoute
A complete router's route.
Definition: RORoute.h:54
RORouteDef::myNewRoute
bool myNewRoute
Information whether a new route was generated.
Definition: RORouteDef.h:160
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
RORouteDef::myMayBeDisconnected
const bool myMayBeDisconnected
Definition: RORouteDef.h:163
RORouteDef::myLastUsed
int myLastUsed
Index of the route used within the last step.
Definition: RORouteDef.h:151
RORouteDef::myPrecomputed
RORoute * myPrecomputed
precomputed route for out-of-order computation
Definition: RORouteDef.h:148
RouteCostCalculator::keepRoutes
bool keepRoutes() const
Definition: RouteCostCalculator.h:61
RORouteDef::addLoadedAlternative
void addLoadedAlternative(RORoute *alternative)
Adds a single alternative loaded from the file An alternative may also be generated during DUA.
Definition: RORouteDef.cpp:68
RORoute::addStopOffset
void addStopOffset(const SUMOTime offset)
Adapts the until time of all stops by the given offset.
Definition: RORoute.h:189
SUMOAbstractRouter< ROEdge, ROVehicle >
RORouteDef::ComparatorProbability
Definition: RORouteDef.h:169
RORoute::setProbability
void setProbability(double prob)
Sets the probability of the route.
Definition: RORoute.cpp:71
StringUtils
Some static methods for string processing.
Definition: StringUtils.h:39
OutputDevice::openTag
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
Definition: OutputDevice.cpp:239
RORouteDef::getDestination
const ROEdge * getDestination() const
Definition: RORouteDef.cpp:350
StringUtils.h
SUMOAbstractRouter::recomputeCosts
double recomputeCosts(const std::vector< const E * > &edges, const V *const v, SUMOTime msTime, double *lengthp=nullptr) const
Definition: SUMOAbstractRouter.h:195
RORoute::getFirst
const ROEdge * getFirst() const
Returns the first edge in the route.
Definition: RORoute.h:93
ROEdge
A basic edge for routing applications.
Definition: ROEdge.h:72
RORouteDef::~RORouteDef
virtual ~RORouteDef()
Destructor.
Definition: RORouteDef.cpp:58
RORouteDef::copyOrigDest
RORouteDef * copyOrigDest(const std::string &id) const
Returns a origin-destination copy of the route definition.
Definition: RORouteDef.cpp:372
config.h
RandHelper.h
MsgHandler::getErrorInstance
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
Definition: MsgHandler.cpp:81
RORouteDef::copy
RORouteDef * copy(const std::string &id, const SUMOTime stopOffset) const
Returns a deep copy of the route definition.
Definition: RORouteDef.cpp:385
Named::myID
std::string myID
The name of the object.
Definition: Named.h:133
SUMOAbstractRouter.h
Named::getID
const std::string & getID() const
Returns the id.
Definition: Named.h:76
ROEdge.h
WRITE_MESSAGE
#define WRITE_MESSAGE(msg)
Definition: MsgHandler.h:277
RORouteDef::RORouteDef
RORouteDef(const std::string &id, const int lastUsed, const bool tryRepair, const bool mayBeDisconnected)
Constructor.
Definition: RORouteDef.cpp:51
RORouteDef::myUsingJTRR
static bool myUsingJTRR
Definition: RORouteDef.h:165
ConstROEdgeVector
std::vector< const ROEdge * > ConstROEdgeVector
Definition: ROEdge.h:56
RORouteDef::repairCurrentRoute
bool repairCurrentRoute(SUMOAbstractRouter< ROEdge, ROVehicle > &router, SUMOTime begin, const ROVehicle &veh, ConstROEdgeVector oldEdges, ConstROEdgeVector &newEdges) const
Builds the complete route (or chooses her from the list of alternatives, when existing)
Definition: RORouteDef.cpp:163
RORoute::getStops
const std::vector< SUMOVehicleParameter::Stop > & getStops() const
Returns the list of stops this route contains.
Definition: RORoute.h:183
RORouteDef::myAlternatives
std::vector< RORoute * > myAlternatives
The alternatives.
Definition: RORouteDef.h:154