SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RONet.cpp
Go to the documentation of this file.
1 /****************************************************************************/
9 // The router's network representation
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <algorithm>
34 #include "ROEdge.h"
35 #include "RONode.h"
36 #include "RONet.h"
37 #include "RORoute.h"
38 #include "RORouteDef.h"
39 #include "ROVehicle.h"
45 #include <utils/common/ToString.h>
49 
50 #ifdef CHECK_MEMORY_LEAKS
51 #include <foreign/nvwa/debug_new.h>
52 #endif // CHECK_MEMORY_LEAKS
53 
54 
55 // ===========================================================================
56 // method definitions
57 // ===========================================================================
59  : myVehicleTypes(), myDefaultVTypeMayBeDeleted(true),
60  myRoutesOutput(0), myRouteAlternativesOutput(0), myTypesOutput(0),
61  myReadRouteNo(0), myDiscardedRouteNo(0), myWrittenRouteNo(0),
62  myHaveRestrictions(false),
63  myNumInternalEdges(0),
64  myErrorHandler(OptionsCont::getOptions().exists("ignore-errors")
65  && OptionsCont::getOptions().getBool("ignore-errors") ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()) {
67  type->onlyReferenced = true;
68  myVehicleTypes.add(type->id, type);
69 }
70 
71 
73  myNodes.clear();
74  myEdges.clear();
76  myRoutes.clear();
77  myVehicles.clear();
78 }
79 
80 
81 bool
83  if (!myEdges.add(edge->getID(), edge)) {
84  WRITE_ERROR("The edge '" + edge->getID() + "' occurs at least twice.");
85  delete edge;
86  return false;
87  }
88  if (edge->getType() == ROEdge::ET_INTERNAL) {
89  myNumInternalEdges += 1;
90  }
91  return true;
92 }
93 
94 
95 void
97  if (!myNodes.add(node->getID(), node)) {
98  WRITE_ERROR("The node '" + node->getID() + "' occurs at least twice.");
99  delete node;
100  }
101 }
102 
103 
104 void
105 RONet::addBusStop(const std::string& id, SUMOVehicleParameter::Stop* stop) {
106  std::map<std::string, SUMOVehicleParameter::Stop*>::const_iterator it = myBusStops.find(id);
107  if (it != myBusStops.end()) {
108  WRITE_ERROR("The bus stop '" + id + "' occurs at least twice.");
109  delete stop;
110  }
111  myBusStops[id] = stop;
112 }
113 
114 
115 bool
117  return myRoutes.add(def->getID(), def);
118 }
119 
120 
121 void
122 RONet::openOutput(const std::string& filename, const std::string altFilename, const std::string typeFilename) {
123  if (filename != "") {
126  myRoutesOutput->writeAttr("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance").writeAttr("xsi:noNamespaceSchemaLocation", "http://sumo.dlr.de/xsd/routes_file.xsd");
127  }
128  if (altFilename != "") {
131  myRouteAlternativesOutput->writeAttr("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance").writeAttr("xsi:noNamespaceSchemaLocation", "http://sumo.dlr.de/xsd/routes_file.xsd");
132  }
133  if (typeFilename != "") {
134  myTypesOutput = &OutputDevice::getDevice(typeFilename);
135  myTypesOutput->writeXMLHeader("routes", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/routes_file.xsd\"");
136  }
137 }
138 
139 
140 void
142  // end writing
143  if (myRoutesOutput != 0) {
145  }
146  // only if opened
147  if (myRouteAlternativesOutput != 0) {
149  }
150  // only if opened
151  if (myTypesOutput != 0) {
152  myTypesOutput->close();
153  }
155 #ifdef HAVE_FOX
156  if (myThreadPool.size() > 0) {
157  myThreadPool.clear();
158  return;
159  }
160 #endif
161  delete router;
162 }
163 
164 
165 
167 RONet::getVehicleTypeSecure(const std::string& id) {
168  // check whether the type was already known
170  if (id == DEFAULT_VTYPE_ID) {
172  }
173  if (type != 0) {
174  return type;
175  }
176  VTypeDistDictType::iterator it2 = myVTypeDistDict.find(id);
177  if (it2 != myVTypeDistDict.end()) {
178  return it2->second->get();
179  }
180  if (id == "") {
181  // ok, no vehicle type was given within the user input
182  // return the default type
185  }
186  return type;
187 }
188 
189 
190 bool
191 RONet::checkVType(const std::string& id) {
192  if (id == DEFAULT_VTYPE_ID) {
196  } else {
197  return false;
198  }
199  } else {
200  if (myVehicleTypes.get(id) != 0 || myVTypeDistDict.find(id) != myVTypeDistDict.end()) {
201  return false;
202  }
203  }
204  return true;
205 }
206 
207 
208 bool
210  if (checkVType(type->id)) {
211  myVehicleTypes.add(type->id, type);
212  } else {
213  WRITE_ERROR("The vehicle type '" + type->id + "' occurs at least twice.");
214  delete type;
215  return false;
216  }
217  return true;
218 }
219 
220 
221 bool
222 RONet::addVTypeDistribution(const std::string& id, RandomDistributor<SUMOVTypeParameter*>* vehTypeDistribution) {
223  if (checkVType(id)) {
224  myVTypeDistDict[id] = vehTypeDistribution;
225  return true;
226  }
227  return false;
228 }
229 
230 
231 bool
232 RONet::addVehicle(const std::string& id, ROVehicle* veh) {
233  if (myVehIDs.find(id) == myVehIDs.end() && myVehicles.add(id, veh)) {
234  myVehIDs.insert(id);
235  myReadRouteNo++;
236  return true;
237  }
238  WRITE_ERROR("The vehicle '" + id + "' occurs at least twice.");
239  return false;
240 }
241 
242 
243 bool
244 RONet::addFlow(SUMOVehicleParameter* flow, const bool randomize) {
245  if (randomize) {
246  myDepartures[flow->id].reserve(flow->repetitionNumber);
247  for (int i = 0; i < flow->repetitionNumber; ++i) {
248  myDepartures[flow->id].push_back(flow->depart + RandHelper::rand(flow->repetitionNumber * flow->repetitionOffset));
249  }
250  std::sort(myDepartures[flow->id].begin(), myDepartures[flow->id].end());
251  std::reverse(myDepartures[flow->id].begin(), myDepartures[flow->id].end());
252  }
253  return myFlows.add(flow->id, flow);
254 }
255 
256 
257 void
258 RONet::addPerson(const SUMOTime depart, const std::string desc) {
259  myPersons.insert(std::pair<const SUMOTime, const std::string>(depart, desc));
260 }
261 
262 
263 bool
265  const ROVehicle* const veh, const bool removeLoops,
266  MsgHandler* errorHandler) {
267  std::string noRouteMsg = "The vehicle '" + veh->getID() + "' has no valid route.";
268  RORouteDef* const routeDef = veh->getRouteDefinition();
269  // check if the route definition is valid
270  if (routeDef == 0) {
271  errorHandler->inform(noRouteMsg);
272  return false;
273  }
274  RORoute* current = routeDef->buildCurrentRoute(router, veh->getDepartureTime(), *veh);
275  if (current == 0 || current->size() == 0) {
276  delete current;
277  errorHandler->inform(noRouteMsg);
278  return false;
279  }
280  // check whether we have to evaluate the route for not containing loops
281  if (removeLoops) {
282  current->recheckForLoops();
283  // check whether the route is still valid
284  if (current->size() == 0) {
285  delete current;
286  errorHandler->inform(noRouteMsg + " (after removing loops)");
287  return false;
288  }
289  }
290  // add built route
291  routeDef->addAlternative(router, veh, current, veh->getDepartureTime());
292  return true;
293 }
294 
295 
296 void
298  std::vector<std::string> toRemove;
300  SUMOVehicleParameter* pars = i->second;
301  if (pars->repetitionProbability > 0) {
302  while (pars->depart < time) {
303  if (pars->repetitionEnd <= pars->depart) {
304  toRemove.push_back(i->first);
305  break;
306  }
307  if (
308  // only call rand if all other conditions are met
309  RandHelper::rand() < (pars->repetitionProbability * TS)) {
310  SUMOVehicleParameter* newPars = new SUMOVehicleParameter(*pars);
311  newPars->id = pars->id + "." + toString(pars->repetitionsDone);
312  newPars->depart = pars->depart;
313  pars->repetitionsDone++;
314  // try to build the vehicle
316  RORouteDef* route = getRouteDef(pars->routeid)->copy("!" + newPars->id);
317  ROVehicle* veh = new ROVehicle(*newPars, route, type, this);
318  addVehicle(newPars->id, veh);
319  delete newPars;
320  }
321  pars->depart += DELTA_T;
322  }
323  } else {
324  while (pars->repetitionsDone < pars->repetitionNumber) {
325  SUMOTime depart = static_cast<SUMOTime>(pars->depart + pars->repetitionsDone * pars->repetitionOffset);
326  if (myDepartures.find(pars->id) != myDepartures.end()) {
327  depart = myDepartures[pars->id].back();
328  }
329  if (depart >= time + DELTA_T) {
330  break;
331  }
332  if (myDepartures.find(pars->id) != myDepartures.end()) {
333  myDepartures[pars->id].pop_back();
334  }
335  SUMOVehicleParameter* newPars = new SUMOVehicleParameter(*pars);
336  newPars->id = pars->id + "." + toString(pars->repetitionsDone);
337  newPars->depart = depart;
338  pars->repetitionsDone++;
339  // try to build the vehicle
341  RORouteDef* route = getRouteDef(pars->routeid)->copy("!" + newPars->id);
342  ROVehicle* veh = new ROVehicle(*newPars, route, type, this);
343  addVehicle(newPars->id, veh);
344  delete newPars;
345  }
346  if (pars->repetitionsDone == pars->repetitionNumber) {
347  toRemove.push_back(i->first);
348  }
349  }
350  }
351  for (std::vector<std::string>::const_iterator i = toRemove.begin(); i != toRemove.end(); ++i) {
352  myFlows.erase(*i);
353  }
354 }
355 
356 
357 SUMOTime
359  SUMOTime time) {
360  checkFlows(time);
361  SUMOTime lastTime = -1;
362  const bool removeLoops = options.getBool("remove-loops");
363 #ifdef HAVE_FOX
364  const int maxNumThreads = options.getInt("routing-threads");
365 #endif
366  if (myVehicles.size() != 0) {
367  const std::map<std::string, ROVehicle*>& mmap = myVehicles.getMyMap();
368  for (std::map<std::string, ROVehicle*>::const_iterator i = mmap.begin(); i != mmap.end(); ++i) {
369  if (i->second->getDepart() >= time) {
370  // we cannot go through a sorted list here, because the priority queue in the myVehicles container is not fully sorted
371  continue;
372  }
373  i->second->setRoutingSuccess(false);
374 #ifdef HAVE_FOX
375  // add thread if necessary
376  const int numThreads = (int)myThreadPool.size();
377  if (numThreads < maxNumThreads && myThreadPool.isFull()) {
378  new WorkerThread(myThreadPool, numThreads == 0 ? &router : router.clone());
379  }
380  // add task
381  if (maxNumThreads > 0) {
382  myThreadPool.add(new RoutingTask(i->second, removeLoops, myErrorHandler));
383  continue;
384  }
385 #endif
386  i->second->setRoutingSuccess(computeRoute(router, i->second, removeLoops, myErrorHandler));
387  }
388 #ifdef HAVE_FOX
389  myThreadPool.waitAll();
390 #endif
391  }
392  // write all vehicles (and additional structures)
393  while (myVehicles.size() != 0 || myPersons.size() != 0) {
394  // get the next vehicle and person
395  const ROVehicle* const veh = myVehicles.getTopVehicle();
396  const SUMOTime vehicleTime = veh == 0 ? SUMOTime_MAX : veh->getDepart();
397  PersonMap::iterator person = myPersons.begin();
398  const SUMOTime personTime = person == myPersons.end() ? SUMOTime_MAX : person->first;
399  // check whether it shall not yet be computed
400  if (vehicleTime >= time && personTime >= time) {
401  lastTime = MIN2(vehicleTime, personTime);
402  break;
403  }
404  if (vehicleTime < personTime) {
405  // check whether to print the output
406  if (lastTime != vehicleTime && lastTime != -1) {
407  // report writing progress
408  if (options.getInt("stats-period") >= 0 && ((int) vehicleTime % options.getInt("stats-period")) == 0) {
409  WRITE_MESSAGE("Read: " + toString(myReadRouteNo) + ", Discarded: " + toString(myDiscardedRouteNo) + ", Written: " + toString(myWrittenRouteNo));
410  }
411  }
412  lastTime = vehicleTime;
413 
414  // ok, compute the route (try it)
415  if (veh->getRoutingSuccess()) {
416  // write the route
419  } else {
421  }
422  // delete routes and the vehicle
423  if (veh->getRouteDefinition()->getID()[0] == '!') {
424  if (!myRoutes.erase(veh->getRouteDefinition()->getID())) {
425  delete veh->getRouteDefinition();
426  }
427  }
428  myVehicles.erase(veh->getID());
429  } else {
430  myRoutesOutput->writePreformattedTag(person->second);
431  if (myRouteAlternativesOutput != 0) {
433  }
434  myPersons.erase(person);
435  }
436  }
437  return lastTime;
438 }
439 
440 
441 bool
443  return myVehicles.size() > 0 || myFlows.size() > 0 || myPersons.size() > 0;
444 }
445 
446 
447 size_t
449  return myEdges.size();
450 }
451 
452 
453 int
455  return myNumInternalEdges;
456 }
457 
458 
459 const std::map<std::string, ROEdge*>&
461  return myEdges.getMyMap();
462 }
463 
464 
465 bool
467  return myHaveRestrictions;
468 }
469 
470 
471 void
473  myHaveRestrictions = true;
474 }
475 
476 
477 #ifdef HAVE_FOX
478 // ---------------------------------------------------------------------------
479 // RONet::RoutingTask-methods
480 // ---------------------------------------------------------------------------
481 void
482 RONet::RoutingTask::run(FXWorkerThread* context) {
483  myVehicle->setRoutingSuccess(RONet::computeRoute(static_cast<WorkerThread*>(context)->getRouter(), myVehicle, myRemoveLoops, myErrorHandler));
484 }
485 #endif
486 
487 
488 /****************************************************************************/
489 
SUMOTime getDepartureTime() const
Returns the time the vehicle starts at, 0 for triggered vehicles.
Definition: ROVehicle.h:111
const std::string & getID() const
Returns the id of the vehicle.
Definition: ROVehicle.h:102
SUMOTime repetitionEnd
The time at which the flow ends (only needed when using repetitionProbability)
SUMOReal repetitionProbability
The probability for emitting a vehicle per second.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:257
OutputDevice * myRouteAlternativesOutput
The file to write the computed route alternatives into.
Definition: RONet.h:397
void close()
Closes the device and removes it from the dictionary.
EdgeType getType() const
Returns the type of the edge.
Definition: ROEdge.h:172
NamedObjectCont< SUMOVehicleParameter * > myFlows
Known flows.
Definition: RONet.h:384
int repetitionNumber
The number of times the vehicle shall be repeatedly inserted.
std::string vtypeid
The vehicle&#39;s type id.
int myNumInternalEdges
The number of internal edges in the dictionary.
Definition: RONet.h:415
void clear()
Deletes all vehicles stored; clears the lists.
size_t getEdgeNo() const
Returns the total number of edges the network contains including internal edges.
Definition: RONet.cpp:448
unsigned int size() const
Returns the number of edges in this route.
Definition: RORoute.h:145
bool checkVType(const std::string &id)
Checks whether the vehicle type (distribution) may be added.
Definition: RONet.cpp:191
bool erase(const std::string &id)
Removes the named item from the container.
virtual bool add(const std::string &id, T item)
Adds an item.
Structure representing possible vehicle parameter.
void addAlternative(SUMOAbstractRouter< ROEdge, ROVehicle > &router, const ROVehicle *const, RORoute *current, SUMOTime begin)
Adds an alternative to the list of routes.
Definition: RORouteDef.cpp:244
void addNode(RONode *node)
Definition: RONet.cpp:96
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:95
virtual SUMOAbstractRouter * clone() const =0
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
OutputDevice & writePreformattedTag(const std::string &val)
writes a preformatted tag to the device but ensures that any pending tags are closed ...
Definition: OutputDevice.h:303
static SUMOReal rand()
Returns a random real number in [0, 1)
Definition: RandHelper.h:62
int repetitionsDone
The number of times the vehicle was already inserted.
void recheckForLoops()
Checks whether this route contains loops and removes such.
Definition: RORoute.cpp:86
NamedObjectCont< ROEdge * > myEdges
Known edges.
Definition: RONet.h:361
SUMOTime getDepart() const
Returns the time the vehicle starts at, -1 for triggered vehicles.
Definition: ROVehicle.h:119
An internal edge which models vehicles driving across a junction. This is currently not used for rout...
Definition: ROEdge.h:90
unsigned int myDiscardedRouteNo
The number of discarded routes.
Definition: RONet.h:406
#define TS
Definition: SUMOTime.h:52
A map of named object pointers.
std::map< std::string, std::vector< SUMOTime > > myDepartures
Departure times for randomized flows.
Definition: RONet.h:391
OutputDevice * myTypesOutput
The file to write the vehicle types into.
Definition: RONet.h:400
SUMOReal repetitionOffset
The time offset between vehicle reinsertions.
const std::string DEFAULT_VTYPE_ID
virtual bool addVehicleType(SUMOVTypeParameter *type)
Adds a read vehicle type definition to the network.
Definition: RONet.cpp:209
virtual bool addVehicle(const std::string &id, ROVehicle *veh)
Definition: RONet.cpp:232
void saveAllAsXML(OutputDevice &os, OutputDevice *const altos, OutputDevice *const typeos, bool withExitTimes) const
Saves the complete vehicle description.
Definition: ROVehicle.cpp:116
const std::map< std::string, ROEdge * > & getEdgeMap() const
Definition: RONet.cpp:460
virtual bool add(const std::string &id, ROVehicle *item)
Adds a vehicle to the container.
void openOutput(const std::string &filename, const std::string altFilename, const std::string typeFilename)
Opens the output for computed routes.
Definition: RONet.cpp:122
T get(const std::string &id) const
Retrieves an item.
bool writeXMLHeader(const std::string &rootElement, const std::string &attrs="", const std::string &comment="")
Writes an XML header with optional configuration.
void checkFlows(SUMOTime time)
Definition: RONet.cpp:297
void clear()
Removes all items from the container (deletes them, too)
bool writeHeader(const SumoXMLTag &rootElement)
Definition: OutputDevice.h:189
const std::string & getID() const
Returns the id.
Definition: Named.h:60
bool addVTypeDistribution(const std::string &id, RandomDistributor< SUMOVTypeParameter * > *vehTypeDistribution)
Adds a vehicle type distribution.
Definition: RONet.cpp:222
bool getRoutingSuccess() const
Definition: ROVehicle.h:163
A vehicle as used by router.
Definition: ROVehicle.h:59
bool addRouteDef(RORouteDef *def)
Definition: RONet.cpp:116
bool myHaveRestrictions
Whether the network contains edges which not all vehicles may pass.
Definition: RONet.h:412
std::string routeid
The vehicle&#39;s route id.
OutputDevice * myRoutesOutput
The file to write the computed routes into.
Definition: RONet.h:394
virtual bool remove(const std::string &id)
Removes an item.
const ROVehicle * getTopVehicle() const
Returns the vehicle that departs most early.
NamedObjectCont< SUMOVTypeParameter * > myVehicleTypes
Known vehicle types.
Definition: RONet.h:367
SUMOTime depart
The vehicle&#39;s departure time.
void addPerson(const SUMOTime depart, const std::string desc)
Definition: RONet.cpp:258
virtual bool furtherStored()
Returns the information whether further vehicles are stored.
Definition: RONet.cpp:442
unsigned int size() const
Returns the number of items within the container.
T MIN2(T a, T b)
Definition: StdDefs.h:68
ROVehicleCont myVehicles
Known vehicles.
Definition: RONet.h:381
unsigned int myReadRouteNo
The number of read routes.
Definition: RONet.h:403
bool myDefaultVTypeMayBeDeleted
Whether no vehicle type was loaded.
Definition: RONet.h:375
NamedObjectCont< RORouteDef * > myRoutes
Known routes.
Definition: RONet.h:378
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:53
bool erase(const std::string &id)
Tries to remove (and delete) the named vehicle.
A basic edge for routing applications.
Definition: ROEdge.h:70
bool onlyReferenced
Information whether this is a type-stub, being only referenced but not defined (needed by routers) ...
int getInternalEdgeNumber() const
Returns the number of internal edges the network contains.
Definition: RONet.cpp:454
const IDMap & getMyMap() const
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:205
RONet()
Constructor.
Definition: RONet.cpp:58
Structure representing possible vehicle parameter.
void setRestrictionFound()
Definition: RONet.cpp:472
#define SUMOTime_MAX
Definition: SUMOTime.h:44
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
RORouteDef * copy(const std::string &id) const
Returns a deep copy of the route definition.
Definition: RORouteDef.cpp:367
Definition of vehicle stop (position and duration)
PersonMap myPersons
Definition: RONet.h:388
void inform(std::string msg, bool addType=true)
adds a new error to the list
Definition: MsgHandler.cpp:89
A storage for options typed value containers)
Definition: OptionsCont.h:108
bool hasRestrictions() const
Definition: RONet.cpp:466
VTypeDistDictType myVTypeDistDict
A distribution of vehicle types (probability-&gt;vehicle type)
Definition: RONet.h:372
Base class for a vehicle&#39;s route definition.
Definition: RORouteDef.h:63
std::string id
The vehicle type&#39;s id.
void addBusStop(const std::string &id, SUMOVehicleParameter::Stop *stop)
Definition: RONet.cpp:105
int SUMOTime
Definition: SUMOTime.h:43
virtual bool addEdge(ROEdge *edge)
Definition: RONet.cpp:82
static bool computeRoute(SUMOAbstractRouter< ROEdge, ROVehicle > &router, const ROVehicle *const veh, const bool removeLoops, MsgHandler *errorHandler)
Definition: RONet.cpp:264
std::set< std::string > myVehIDs
Known vehicle ids.
Definition: RONet.h:355
virtual ~RONet()
Destructor.
Definition: RONet.cpp:72
SUMOVTypeParameter * getVehicleTypeSecure(const std::string &id)
Retrieves the named vehicle type.
Definition: RONet.cpp:167
A thread repeatingly calculating incoming tasks.
MsgHandler * myErrorHandler
handler for ignorable error messages
Definition: RONet.h:418
Base class for nodes used by the router.
Definition: RONode.h:51
#define DELTA_T
Definition: SUMOTime.h:50
NamedObjectCont< RONode * > myNodes
Known nodes.
Definition: RONet.h:358
bool addFlow(SUMOVehicleParameter *flow, const bool randomize)
Definition: RONet.cpp:244
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
RORouteDef * getRouteDefinition() const
Returns the definition of the route the vehicle takes.
Definition: ROVehicle.h:82
SUMOTime saveAndRemoveRoutesUntil(OptionsCont &options, SUMOAbstractRouter< ROEdge, ROVehicle > &router, SUMOTime time)
Computes routes described by their definitions and saves them.
Definition: RONet.cpp:358
#define WRITE_MESSAGE(msg)
Definition: MsgHandler.h:201
void cleanup(SUMOAbstractRouter< ROEdge, ROVehicle > *router)
closes the file output for computed routes and deletes routers and associated threads if necessary ...
Definition: RONet.cpp:141
RORouteDef * getRouteDef(const std::string &name) const
Returns the named route definition.
Definition: RONet.h:236
vehicles ignoring classes
std::map< std::string, SUMOVehicleParameter::Stop * > myBusStops
Known bus stops.
Definition: RONet.h:364
A complete router&#39;s route.
Definition: RORoute.h:61
std::string id
The vehicle&#39;s id.
unsigned int myWrittenRouteNo
The number of written routes.
Definition: RONet.h:409