SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RORouteHandler.cpp
Go to the documentation of this file.
1 /****************************************************************************/
10 // Parser and container for routes during their loading
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
13 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <string>
35 #include <map>
36 #include <vector>
37 #include <iostream>
47 #include <utils/xml/XMLSubSys.h>
49 #include "RONet.h"
50 #include "RORouteHandler.h"
51 
52 #ifdef CHECK_MEMORY_LEAKS
53 #include <foreign/nvwa/debug_new.h>
54 #endif // CHECK_MEMORY_LEAKS
55 
56 
57 // ===========================================================================
58 // method definitions
59 // ===========================================================================
60 RORouteHandler::RORouteHandler(RONet& net, const std::string& file,
61  const bool tryRepair,
62  const bool emptyDestinationsAllowed,
63  const bool ignoreErrors) :
64  SUMORouteHandler(file),
65  myNet(net),
66  myActivePlan(0),
67  myTryRepair(tryRepair),
68  myEmptyDestinationsAllowed(emptyDestinationsAllowed),
69  myErrorOutput(ignoreErrors ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()),
70  myCurrentVTypeDistribution(0),
71  myCurrentAlternatives(0) {
72  myActiveRoute.reserve(100);
73 }
74 
75 
77 }
78 
79 
80 void
81 RORouteHandler::parseFromTo(std::string element,
82  const SUMOSAXAttributes& attrs) {
83  bool useTaz = OptionsCont::getOptions().getBool("with-taz");
84  if (useTaz && !myVehicleParameter->wasSet(VEHPARS_TAZ_SET)) {
85  WRITE_WARNING("Taz usage was requested but no taz present in " + element + " '" + myVehicleParameter->id + "'!");
86  useTaz = false;
87  } else if (!useTaz && !attrs.hasAttribute(SUMO_ATTR_FROM) && myVehicleParameter->wasSet(VEHPARS_TAZ_SET)) {
88  WRITE_WARNING("'from' attribute missing using taz for " + element + " '" + myVehicleParameter->id + "'!");
89  useTaz = true;
90  }
91  if (useTaz) {
92  const ROEdge* fromTaz = myNet.getEdge(myVehicleParameter->fromTaz + "-source");
93  if (fromTaz == 0) {
94  myErrorOutput->inform("Source taz '" + myVehicleParameter->fromTaz + "' not known for " + element + " '" + myVehicleParameter->id + "'!");
95  } else if (fromTaz->getNoFollowing() == 0) {
96  myErrorOutput->inform("Source taz '" + myVehicleParameter->fromTaz + "' has no outgoing edges for " + element + " '" + myVehicleParameter->id + "'!");
97  } else {
98  myActiveRoute.push_back(fromTaz);
99  }
100  const ROEdge* toTaz = myNet.getEdge(myVehicleParameter->toTaz + "-sink");
101  if (toTaz == 0) {
102  myErrorOutput->inform("Sink taz '" + myVehicleParameter->toTaz + "' not known for " + element + " '" + myVehicleParameter->id + "'!");
103  } else {
104  myActiveRoute.push_back(toTaz);
105  }
106  } else {
107  bool ok = true;
108  parseEdges(attrs.get<std::string>(SUMO_ATTR_FROM, myVehicleParameter->id.c_str(), ok),
109  myActiveRoute, "for " + element + " '" + myVehicleParameter->id + "'");
110  parseEdges(attrs.get<std::string>(SUMO_ATTR_TO, myVehicleParameter->id.c_str(), ok, !myEmptyDestinationsAllowed),
111  myActiveRoute, "for " + element + " '" + myVehicleParameter->id + "'");
112  }
114  if (myVehicleParameter->routeid == "") {
116  }
117  closeRoute(true);
118 }
119 
120 
121 
122 void
124  const SUMOSAXAttributes& attrs) {
125  SUMORouteHandler::myStartElement(element, attrs);
126  switch (element) {
127  case SUMO_TAG_PERSON:
128  myActivePlan = new OutputDevice_String(false, 1);
130  (*myActivePlan) << attrs;
131  break;
132  case SUMO_TAG_RIDE: {
134  (*myActivePlan) << attrs;
136  break;
137  }
138  case SUMO_TAG_WALK: {
140  (*myActivePlan) << attrs;
142  break;
143  }
144  case SUMO_TAG_FLOW:
146  parseFromTo("flow", attrs);
147  break;
148  case SUMO_TAG_TRIP: {
150  parseFromTo("trip", attrs);
151  closeVehicle();
152  }
153  break;
154  default:
155  break;
156  }
157  // parse embedded vtype information
158  if (myCurrentVType != 0 && element != SUMO_TAG_VTYPE) {
160  return;
161  }
162 }
163 
164 
165 void
167  bool ok = true;
168  myCurrentVTypeDistributionID = attrs.get<std::string>(SUMO_ATTR_ID, 0, ok);
169  if (ok) {
171  if (attrs.hasAttribute(SUMO_ATTR_VTYPES)) {
172  const std::string vTypes = attrs.get<std::string>(SUMO_ATTR_VTYPES, myCurrentVTypeDistributionID.c_str(), ok);
173  StringTokenizer st(vTypes);
174  while (st.hasNext()) {
175  SUMOVTypeParameter* type = myNet.getVehicleTypeSecure(st.next());
176  myCurrentVTypeDistribution->add(1., type);
177  }
178  }
179  }
180 }
181 
182 
183 void
185  if (myCurrentVTypeDistribution != 0) {
188  myErrorOutput->inform("Vehicle type distribution '" + myCurrentVTypeDistributionID + "' is empty.");
191  myErrorOutput->inform("Another vehicle type (or distribution) with the id '" + myCurrentVTypeDistributionID + "' exists.");
192  }
194  }
195 }
196 
197 
198 void
200  // check whether the id is really necessary
201  std::string rid;
202  if (myCurrentAlternatives != 0) {
204  rid = "distribution '" + myCurrentAlternatives->getID() + "'";
205  } else if (myVehicleParameter != 0) {
206  // ok, a vehicle is wrapping the route,
207  // we may use this vehicle's id as default
208  myVehicleParameter->routeid = myActiveRouteID = "!" + myVehicleParameter->id; // !!! document this
209  if (attrs.hasAttribute(SUMO_ATTR_ID)) {
210  WRITE_WARNING("Ids of internal routes are ignored (vehicle '" + myVehicleParameter->id + "').");
211  }
212  } else {
213  bool ok = true;
214  myActiveRouteID = attrs.get<std::string>(SUMO_ATTR_ID, 0, ok);
215  if (!ok) {
216  return;
217  }
218  rid = "'" + myActiveRouteID + "'";
219  }
220  if (myVehicleParameter != 0) { // have to do this here for nested route distributions
221  rid = "for vehicle '" + myVehicleParameter->id + "'";
222  }
223  bool ok = true;
224  if (attrs.hasAttribute(SUMO_ATTR_EDGES)) {
225  parseEdges(attrs.get<std::string>(SUMO_ATTR_EDGES, myActiveRouteID.c_str(), ok), myActiveRoute, rid);
226  }
227  myActiveRouteRefID = attrs.getOpt<std::string>(SUMO_ATTR_REFID, myActiveRouteID.c_str(), ok, "");
229  myErrorOutput->inform("Invalid reference to route '" + myActiveRouteRefID + "' in route " + rid + ".");
230  }
231  if (myCurrentAlternatives != 0 && !attrs.hasAttribute(SUMO_ATTR_PROB)) {
232  WRITE_WARNING("No probability for a route in '" + rid + "', using default.");
233  }
235  if (ok && myActiveRouteProbability < 0) {
236  myErrorOutput->inform("Invalid probability for route '" + myActiveRouteID + "'.");
237  }
239  ok = true;
240  myCurrentCosts = attrs.getOpt<SUMOReal>(SUMO_ATTR_COST, myActiveRouteID.c_str(), ok, -1);
241  if (ok && myCurrentCosts != -1 && myCurrentCosts < 0) {
242  myErrorOutput->inform("Invalid cost for route '" + myActiveRouteID + "'.");
243  }
244 }
245 
246 
247 void
250  switch (element) {
251  case SUMO_TAG_VTYPE: {
253  if (myCurrentVTypeDistribution != 0) {
255  }
256  }
257  myCurrentVType = 0;
258  }
259  break;
260  default:
261  break;
262  }
263 }
264 
265 
266 void
267 RORouteHandler::closeRoute(const bool mayBeDisconnected) {
268  if (myActiveRoute.size() == 0) {
269  if (myActiveRouteRefID != "" && myCurrentAlternatives != 0) {
271  myActiveRouteID = "";
272  myActiveRouteRefID = "";
273  return;
274  }
275  if (myVehicleParameter != 0) {
276  myErrorOutput->inform("Vehicle's '" + myVehicleParameter->id + "' route has no edges.");
277  } else {
278  myErrorOutput->inform("Route '" + myActiveRouteID + "' has no edges.");
279  }
280  myActiveRouteID = "";
281  myActiveRouteStops.clear();
282  return;
283  }
286  myActiveRoute.clear();
287  if (myCurrentAlternatives == 0) {
288  if (myNet.getRouteDef(myActiveRouteID) != 0) {
289  delete route;
290  if (myVehicleParameter != 0) {
291  myErrorOutput->inform("Another route for vehicle '" + myVehicleParameter->id + "' exists.");
292  } else {
293  myErrorOutput->inform("Another route (or distribution) with the id '" + myActiveRouteID + "' exists.");
294  }
295  myActiveRouteID = "";
296  myActiveRouteStops.clear();
297  return;
298  } else {
299  myCurrentAlternatives = new RORouteDef(myActiveRouteID, 0, mayBeDisconnected || myTryRepair);
303  }
304  } else {
306  }
307  myActiveRouteID = "";
308  myActiveRouteStops.clear();
309 }
310 
311 
312 void
314  // check whether the id is really necessary
315  bool ok = true;
316  std::string id;
317  if (myVehicleParameter != 0) {
318  // ok, a vehicle is wrapping the route,
319  // we may use this vehicle's id as default
320  myVehicleParameter->routeid = id = "!" + myVehicleParameter->id; // !!! document this
321  if (attrs.hasAttribute(SUMO_ATTR_ID)) {
322  WRITE_WARNING("Ids of internal route distributions are ignored (vehicle '" + myVehicleParameter->id + "').");
323  }
324  } else {
325  id = attrs.get<std::string>(SUMO_ATTR_ID, 0, ok);
326  if (!ok) {
327  return;
328  }
329  }
330  // try to get the index of the last element
331  int index = attrs.get<int>(SUMO_ATTR_LAST, id.c_str(), ok);
332  if (ok && index < 0) {
333  myErrorOutput->inform("Negative index of a route alternative (id='" + id + "').");
334  return;
335  }
336  // build the alternative cont
337  myCurrentAlternatives = new RORouteDef(id, index, myTryRepair);
338  if (attrs.hasAttribute(SUMO_ATTR_ROUTES)) {
339  ok = true;
340  StringTokenizer st(attrs.get<std::string>(SUMO_ATTR_ROUTES, id.c_str(), ok));
341  while (st.hasNext()) {
342  const std::string routeID = st.next();
343  const RORouteDef* route = myNet.getRouteDef(routeID);
344  if (route == 0) {
345  myErrorOutput->inform("Unknown route '" + routeID + "' in distribution '" + id + "'.");
346  } else {
348  }
349  }
350  }
351 }
352 
353 
354 void
356  if (myCurrentAlternatives != 0) {
358  myErrorOutput->inform("Route distribution '" + myCurrentAlternatives->getID() + "' is empty.");
359  delete myCurrentAlternatives;
360  } else if (!myNet.addRouteDef(myCurrentAlternatives)) {
361  myErrorOutput->inform("Another route (or distribution) with the id '" + myCurrentAlternatives->getID() + "' exists.");
362  delete myCurrentAlternatives;
363  }
365  }
366 }
367 
368 
369 void
371  // get the vehicle id
373  return;
374  }
375  // get vehicle type
377  // get the route
379  if (route == 0) {
380  myErrorOutput->inform("The route of the vehicle '" + myVehicleParameter->id + "' is not known.");
381  return;
382  }
383  if (route->getID()[0] != '!') {
384  route = route->copy("!" + myVehicleParameter->id);
385  }
386  // build the vehicle
387  if (!MsgHandler::getErrorInstance()->wasInformed()) {
388  ROVehicle* veh = new ROVehicle(*myVehicleParameter, route, type, &myNet);
391  }
392 }
393 
394 
395 void
400  delete myVehicleParameter;
401  myVehicleParameter = 0;
402  delete myActivePlan;
403  myActivePlan = 0;
404 }
405 
406 
407 void
409  // @todo: consider myScale?
411  delete myVehicleParameter;
412  myVehicleParameter = 0;
413  return;
414  }
415  // let's check whether vehicles had to depart before the simulation starts
417  const SUMOTime offsetToBegin = string2time(OptionsCont::getOptions().getString("begin")) - myVehicleParameter->depart;
421  delete myVehicleParameter;
422  myVehicleParameter = 0;
423  return;
424  }
425  }
428  if (type == 0) {
429  myErrorOutput->inform("The vehicle type '" + myVehicleParameter->vtypeid + "' for vehicle '" + myVehicleParameter->id + "' is not known.");
430  delete myVehicleParameter;
431  myVehicleParameter = 0;
432  return;
433  }
434  if (route == 0) {
435  myErrorOutput->inform("Vehicle '" + myVehicleParameter->id + "' has no route.");
436  delete myVehicleParameter;
437  myVehicleParameter = 0;
438  return;
439  }
440  myActiveRouteID = "";
441  myNet.addFlow(myVehicleParameter, OptionsCont::getOptions().getBool("randomize-flows"));
443  myVehicleParameter = 0;
444 }
445 
446 
447 void
449  if (myActivePlan) {
451  (*myActivePlan) << attrs;
453  return;
454  }
455  std::string errorSuffix;
456  if (myActiveRouteID != "") {
457  errorSuffix = " in route '" + myActiveRouteID + "'.";
458  } else {
459  errorSuffix = " in vehicle '" + myVehicleParameter->id + "'.";
460  }
462  bool ok = parseStop(stop, attrs, errorSuffix, myErrorOutput);
463  if (!ok) {
464  return;
465  }
466  // try to parse the assigned bus stop
467  if (stop.busstop != "") {
468  const SUMOVehicleParameter::Stop* busstop = myNet.getBusStop(stop.busstop);
469  if (busstop == 0) {
470  myErrorOutput->inform("Unknown bus stop '" + stop.busstop + "'" + errorSuffix);
471  } else {
472  stop.lane = busstop->lane;
473  stop.endPos = busstop->endPos;
474  stop.startPos = busstop->startPos;
475  }
476  } else {
477  // no, the lane and the position should be given
478  stop.lane = attrs.getOpt<std::string>(SUMO_ATTR_LANE, 0, ok, "");
479  if (!ok || stop.lane == "") {
480  myErrorOutput->inform("A stop must be placed on a bus stop or a lane" + errorSuffix);
481  return;
482  }
483  ROEdge* edge = myNet.getEdge(stop.lane.substr(0, stop.lane.rfind('_')));
484  if (edge == 0) {
485  myErrorOutput->inform("The lane '" + stop.lane + "' for a stop is not known" + errorSuffix);
486  return;
487  }
488  stop.endPos = attrs.getOpt<SUMOReal>(SUMO_ATTR_ENDPOS, 0, ok, edge->getLength());
489  stop.startPos = attrs.getOpt<SUMOReal>(SUMO_ATTR_STARTPOS, 0, ok, stop.endPos - 2 * POSITION_EPS);
490  const bool friendlyPos = attrs.getOpt<bool>(SUMO_ATTR_FRIENDLY_POS, 0, ok, false);
491  if (!ok || !checkStopPos(stop.startPos, stop.endPos, edge->getLength(), POSITION_EPS, friendlyPos)) {
492  myErrorOutput->inform("Invalid start or end position for stop" + errorSuffix);
493  return;
494  }
495  }
496  if (myVehicleParameter != 0) {
497  myVehicleParameter->stops.push_back(stop);
498  } else {
499  myActiveRouteStops.push_back(stop);
500  }
501 }
502 
503 
504 void
505 RORouteHandler::parseEdges(const std::string& desc, std::vector<const ROEdge*>& into,
506  const std::string& rid) {
507  if (desc[0] == BinaryFormatter::BF_ROUTE) {
508  std::istringstream in(desc, std::ios::binary);
509  char c;
510  in >> c;
511  FileHelpers::readEdgeVector(in, into, rid);
512  } else {
513  for (StringTokenizer st(desc); st.hasNext();) {
514  const std::string id = st.next();
515  const ROEdge* edge = myNet.getEdge(id);
516  if (edge == 0) {
517  myErrorOutput->inform("The edge '" + id + "' within the route " + rid + " is not known."
518  + "\n The route can not be build.");
519  } else {
520  into.push_back(edge);
521  }
522  }
523  }
524 }
525 
526 
527 /****************************************************************************/
RORouteDef * myCurrentAlternatives
The currently parsed route alternatives.
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
Definition: MsgHandler.cpp:80
virtual void myEndElement(int element)
Called when a closing tag occurs.
const bool myEmptyDestinationsAllowed
Information whether the "to" attribute is mandatory.
void closeVehicleTypeDistribution()
SUMOReal myCurrentCosts
The currently parsed route costs.
The time is given.
std::string next()
int repetitionNumber
The number of times the vehicle shall be repeatedly inserted.
std::vector< const ROEdge * > myActiveRoute
The current route.
void closePerson()
Ends the processing of a person.
std::string vtypeid
The vehicle's type id.
void openRouteDistribution(const SUMOSAXAttributes &attrs)
static void parseVTypeEmbedded(SUMOVTypeParameter &into, int element, const SUMOSAXAttributes &attrs, bool fromVType=false)
Parses an element embedded in vtype definition.
SUMOVehicleParameter * myVehicleParameter
Parameter of the current vehicle, trip, person, or flow.
Structure representing possible vehicle parameter.
bool add(SUMOReal prob, T val, bool checkDuplicates=true)
Adds a value with an assigned probability to the distribution.
void addAlternativeDef(const RORouteDef *alternative)
Adds an alternative loaded from the file.
Definition: RORouteDef.cpp:80
ROEdge * getEdge(const std::string &name) const
Retrieves an edge from the network.
Definition: RONet.h:100
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static bool checkStopPos(SUMOReal &startPos, SUMOReal &endPos, const SUMOReal laneLength, const SUMOReal minLength, const bool friendlyPos)
check start and end position of a stop
SUMOVTypeParameter * myCurrentVType
The currently parsed vehicle type.
int repetitionsDone
The number of times the vehicle was already inserted.
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
MsgHandler *const myErrorOutput
Depending on the "ignore-errors" option different outputs are used.
const SUMOReal DEFAULT_VEH_PROB
SUMOReal myActiveRouteProbability
The id of the current route.
virtual void myEndElement(int element)
Called when a closing tag occurs.
void registerLastDepart()
save last depart (only to be used if vehicle is not discarded)
void openVehicleTypeDistribution(const SUMOSAXAttributes &attrs)
std::string myActiveRouteID
The id of the current route.
SUMOReal repetitionOffset
The time offset between vehicle reinsertions.
void closeVehicle()
Ends the processing of a vehicle.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list...
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:196
virtual bool addVehicleType(SUMOVTypeParameter *type)
Adds a read vehicle type definition to the network.
Definition: RONet.cpp:206
RandomDistributor< SUMOVTypeParameter * > * myCurrentVTypeDistribution
The currently parsed distribution of vehicle types (probability->vehicle type)
virtual bool addVehicle(const std::string &id, ROVehicle *veh)
Definition: RONet.cpp:229
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:67
std::string toTaz
The vehicle's destination zone (district)
std::vector< Stop > stops
List of the stops the vehicle will make.
RORouteHandler(RONet &net, const std::string &file, const bool tryRepair, const bool emptyDestinationsAllowed, const bool ignoreErrors)
standard constructor
RONet & myNet
The current route.
const SUMOVehicleParameter::Stop * getBusStop(const std::string &id) const
Retrieves a bus stop from the network.
Definition: RONet.h:143
std::string busstop
(Optional) bus stop if one is assigned to the stop
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:219
A vehicle as used by router.
Definition: ROVehicle.h:58
bool addRouteDef(RORouteDef *def)
Definition: RONet.cpp:115
SUMOReal startPos
The stopping position start.
the edges of a route
std::string routeid
The vehicle's route id.
Encapsulated SAX-Attributes.
bool wasSet(int what) const
Returns whether the given parameter was set.
SUMOReal endPos
The stopping position end.
SUMOTime depart
The vehicle's departure time.
void addPerson(const SUMOTime depart, const std::string desc)
Definition: RONet.cpp:255
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
SUMOTime string2time(const std::string &r)
Definition: SUMOTime.cpp:48
void addStop(const SUMOSAXAttributes &attrs)
Processing of a stop.
std::string getString()
Returns the current content as a string.
#define POSITION_EPS
Definition: config.h:186
std::string fromTaz
The vehicle's origin zone (district)
A basic edge for routing applications.
Definition: ROEdge.h:67
void parseEdges(const std::string &desc, std::vector< const ROEdge * > &into, const std::string &rid)
Parse edges from strings.
std::string lane
The lane to stop at.
Parser for routes during their loading.
unsigned int getNoFollowing() const
Returns the number of edges this edge is connected to.
Definition: ROEdge.cpp:290
SUMOReal getOverallProb() const
Return the sum of the probabilites assigned to the members.
std::vector< SUMOVehicleParameter::Stop > myActiveRouteStops
List of the stops on the parsed route.
The router's network representation.
Definition: RONet.h:65
void openRoute(const SUMOSAXAttributes &attrs)
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
SUMOReal getLength() const
Returns the length of the edge.
Definition: ROEdge.h:160
RORouteDef * copy(const std::string &id) const
Returns a deep copy of the route definition.
Definition: RORouteDef.cpp:352
void parseFromTo(std::string element, const SUMOSAXAttributes &attrs)
Called for parsing from and to and the corresponding taz attributes.
SUMOReal defaultProbability
The probability when being added to a distribution without an explicit probability.
Definition of vehicle stop (position and duration)
bool parseStop(SUMOVehicleParameter::Stop &stop, const SUMOSAXAttributes &attrs, std::string errorSuffix, MsgHandler *const errorOutput)
parses attributes common to all stops
const bool myTryRepair
Information whether routes shall be repaired.
void inform(std::string msg, bool addType=true)
adds a new error to the list
Definition: MsgHandler.cpp:89
Base class for a vehicle's route definition.
Definition: RORouteDef.h:63
void addLoadedAlternative(RORoute *alternative)
Adds a single alternative loaded from the file An alternative may also be generated during DUA...
Definition: RORouteDef.cpp:74
void closeRoute(const bool mayBeDisconnected=false)
const int VEHPARS_TAZ_SET
OutputDevice_String * myActivePlan
The plan of the current person.
const RGBColor * myActiveRouteColor
The currently parsed route's color.
virtual ~RORouteHandler()
standard destructor
static void readEdgeVector(std::istream &in, std::vector< const E * > &edges, const std::string &rid)
Reads an edge vector binary.
Definition: FileHelpers.h:278
bool closeTag()
Closes the most recently opened tag.
#define SUMOReal
Definition: config.h:215
SUMOVTypeParameter * getVehicleTypeSecure(const std::string &id)
Retrieves the named vehicle type.
Definition: RONet.cpp:158
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue, bool report=true) const
Tries to read given attribute assuming it is an int.
void closeFlow()
Ends the processing of a flow.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
bool addFlow(SUMOVehicleParameter *flow, const bool randomize)
Definition: RONet.cpp:241
std::string myActiveRouteRefID
The id of the route the current route references to.
A color information.
RORouteDef * getRouteDef(const std::string &name) const
Returns the named route definition.
Definition: RONet.h:229
SUMOReal getOverallProb() const
Returns the sum of the probablities of the contained routes.
Definition: RORouteDef.cpp:364
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
A complete router's route.
Definition: RORoute.h:59
An output device that encapsulates an ofstream.
void closeRouteDistribution()
std::string myCurrentVTypeDistributionID
The id of the currently parsed vehicle type distribution.
std::string id
The vehicle's id.