SUMO - Simulation of Urban MObility
MSDevice_Vehroutes.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2009-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
20 // A device which collects info on the vehicle trip
21 /****************************************************************************/
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include <microsim/MSGlobals.h>
33 #include <microsim/MSNet.h>
34 #include <microsim/MSLane.h>
35 #include <microsim/MSEdge.h>
36 #include <microsim/MSRoute.h>
37 #include <microsim/MSVehicle.h>
38 #include <microsim/MSVehicleType.h>
43 #include "MSDevice_Vehroutes.h"
44 
45 
46 // ===========================================================================
47 // static member variables
48 // ===========================================================================
52 bool MSDevice_Vehroutes::mySorted = false;
57 std::map<const SUMOTime, int> MSDevice_Vehroutes::myDepartureCounts;
58 std::map<const SUMOTime, std::map<const std::string, std::string> > MSDevice_Vehroutes::myRouteInfos;
59 
60 
61 // ===========================================================================
62 // method definitions
63 // ===========================================================================
64 // ---------------------------------------------------------------------------
65 // static initialisation methods
66 // ---------------------------------------------------------------------------
67 void
69  if (OptionsCont::getOptions().isSet("vehroute-output")) {
70  OutputDevice::createDeviceByOption("vehroute-output", "routes", "routes_file.xsd");
71  mySaveExits = OptionsCont::getOptions().getBool("vehroute-output.exit-times");
72  myLastRouteOnly = OptionsCont::getOptions().getBool("vehroute-output.last-route");
73  myDUAStyle = OptionsCont::getOptions().getBool("vehroute-output.dua");
74  mySorted = myDUAStyle || OptionsCont::getOptions().getBool("vehroute-output.sorted");
75  myIntendedDepart = OptionsCont::getOptions().getBool("vehroute-output.intended-depart");
76  myRouteLength = OptionsCont::getOptions().getBool("vehroute-output.route-length");
77  mySkipPTLines = OptionsCont::getOptions().getBool("vehroute-output.skip-ptlines");
79  }
80 }
81 
82 
84 MSDevice_Vehroutes::buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*>& into, int maxRoutes) {
85  if (maxRoutes < std::numeric_limits<int>::max()) {
86  return new MSDevice_Vehroutes(v, "vehroute_" + v.getID(), maxRoutes);
87  }
88  if (OptionsCont::getOptions().isSet("vehroute-output")) {
89  if (myLastRouteOnly) {
90  maxRoutes = 0;
91  }
92  myStateListener.myDevices[&v] = new MSDevice_Vehroutes(v, "vehroute_" + v.getID(), maxRoutes);
93  into.push_back(myStateListener.myDevices[&v]);
94  return myStateListener.myDevices[&v];
95  }
96  return 0;
97 }
98 
99 
100 // ---------------------------------------------------------------------------
101 // MSDevice_Vehroutes::StateListener-methods
102 // ---------------------------------------------------------------------------
103 void
105  if (to == MSNet::VEHICLE_STATE_NEWROUTE) {
106  myDevices[vehicle]->addRoute();
107  }
108 }
109 
110 
111 // ---------------------------------------------------------------------------
112 // MSDevice_Vehroutes-methods
113 // ---------------------------------------------------------------------------
114 MSDevice_Vehroutes::MSDevice_Vehroutes(SUMOVehicle& holder, const std::string& id, int maxRoutes) :
115  MSDevice(holder, id),
116  myCurrentRoute(&holder.getRoute()),
117  myMaxRoutes(maxRoutes),
118  myLastSavedAt(0),
119  myDepartLane(-1),
120  myDepartPos(-1),
121  myDepartSpeed(-1),
122  myDepartPosLat(0),
123  myStopOut(false, 2) {
125 }
126 
127 
129  for (std::vector<RouteReplaceInfo>::iterator i = myReplacedRoutes.begin(); i != myReplacedRoutes.end(); ++i) {
130  (*i).route->release();
131  }
134 }
135 
136 
137 bool
140  if (mySorted && myStateListener.myDevices[&veh] == this) {
142  myDepartureCounts[departure]++;
143  }
144  if (!MSGlobals::gUseMesoSim) {
145  myDepartLane = static_cast<MSVehicle&>(veh).getLane()->getIndex();
146  myDepartPosLat = static_cast<MSVehicle&>(veh).getLateralPositionOnLane();
147  }
148  myDepartSpeed = veh.getSpeed();
150  }
151  return mySaveExits;
152 }
153 
154 
155 bool
156 MSDevice_Vehroutes::notifyLeave(SUMOVehicle& veh, double /*lastPos*/, MSMoveReminder::Notification reason, const MSLane* /* enteredLane */) {
157  if (mySaveExits && reason != NOTIFICATION_LANE_CHANGE) {
158  if (reason != NOTIFICATION_TELEPORT && myLastSavedAt == veh.getEdge()) { // need to check this for internal lanes
160  } else if (myLastSavedAt != veh.getEdge()) {
161  myExits.push_back(MSNet::getInstance()->getCurrentTimeStep());
162  myLastSavedAt = veh.getEdge();
163  }
164  }
165  return mySaveExits;
166 }
167 
168 
169 void
171  stop.pars.write(myStopOut);
172 }
173 
174 
175 void
177  if (index == 0 && myReplacedRoutes[index].route->size() == 2 &&
178  myReplacedRoutes[index].route->getEdges().front()->isTazConnector() &&
179  myReplacedRoutes[index].route->getEdges().back()->isTazConnector()) {
180  return;
181  }
182  // check if a previous route shall be written
184  if (index >= 0) {
185  assert((int)myReplacedRoutes.size() > index);
186  // write edge on which the vehicle was when the route was valid
187  os << " replacedOnEdge=\"";
188  if (myReplacedRoutes[index].edge) {
189  os << myReplacedRoutes[index].edge->getID();
190  }
191  // write the time at which the route was replaced
192  os << "\" replacedAtTime=\"" << time2string(myReplacedRoutes[index].time) << "\" probability=\"0\" edges=\"";
193  // get the route
194  int i = index;
195  while (i > 0 && myReplacedRoutes[i - 1].edge) {
196  i--;
197  }
198  const MSEdge* lastEdge = 0;
199  for (; i < index; ++i) {
200  myReplacedRoutes[i].route->writeEdgeIDs(os, lastEdge, myReplacedRoutes[i].edge);
201  lastEdge = myReplacedRoutes[i].edge;
202  }
203  myReplacedRoutes[index].route->writeEdgeIDs(os, lastEdge);
204  } else {
205  os << " edges=\"";
206  const MSEdge* lastEdge = 0;
207  int numWritten = 0;
208  if (myHolder.getNumberReroutes() > 0) {
209  assert((int)myReplacedRoutes.size() <= myHolder.getNumberReroutes());
210  int i = (int)myReplacedRoutes.size();
211  while (i > 0 && myReplacedRoutes[i - 1].edge) {
212  i--;
213  }
214  for (; i < (int)myReplacedRoutes.size(); ++i) {
215  numWritten += myReplacedRoutes[i].route->writeEdgeIDs(os, lastEdge, myReplacedRoutes[i].edge);
216  lastEdge = myReplacedRoutes[i].edge;
217  }
218  }
219  const MSEdge* upTo = 0;
220  if (mySaveExits) {
221  int remainingWithExitTime = (int)myExits.size() - numWritten;
222  assert(remainingWithExitTime >= 0);
223  assert(remainingWithExitTime <= (int)myCurrentRoute->size());
224  if (remainingWithExitTime < (int)myCurrentRoute->size()) {
225  upTo = *(myCurrentRoute->begin() + remainingWithExitTime);
226  }
227  }
228  myCurrentRoute->writeEdgeIDs(os, lastEdge, upTo);
229  if (mySaveExits) {
230  os << "\" exitTimes=\"";
231  for (std::vector<SUMOTime>::const_iterator it = myExits.begin(); it != myExits.end(); ++it) {
232  if (it != myExits.begin()) {
233  os << " ";
234  }
235  os << time2string(*it);
236  }
237  }
238  }
239  (os << "\"").closeTag();
240 }
241 
242 
243 void
245  writeOutput(true);
246 }
247 
248 
249 void
250 MSDevice_Vehroutes::writeOutput(const bool hasArrived) const {
251  if (mySkipPTLines && myHolder.getParameter().line != "") {
252  return;
253  }
254  OutputDevice& routeOut = OutputDevice::getDeviceByOption("vehroute-output");
255  OutputDevice_String od(routeOut.isBinary(), 1);
258  if (!MSGlobals::gUseMesoSim) {
259  if (tmp.wasSet(VEHPARS_DEPARTLANE_SET)) {
260  tmp.departLaneProcedure = DEPART_LANE_GIVEN;
261  tmp.departLane = myDepartLane;
262  }
263  if (tmp.wasSet(VEHPARS_DEPARTPOSLAT_SET)) {
264  tmp.departPosLatProcedure = DEPART_POSLAT_GIVEN;
265  tmp.departPosLat = myDepartPosLat;
266  }
267  }
268  if (tmp.wasSet(VEHPARS_DEPARTPOS_SET)) {
269  tmp.departPosProcedure = DEPART_POS_GIVEN;
270  tmp.departPos = myDepartPos;
271  }
272  if (tmp.wasSet(VEHPARS_DEPARTSPEED_SET)) {
273  tmp.departSpeedProcedure = DEPART_SPEED_GIVEN;
274  tmp.departSpeed = myDepartSpeed;
275  }
276  const std::string typeID = myHolder.getVehicleType().getID() != DEFAULT_VTYPE_ID ? myHolder.getVehicleType().getID() : "";
277  tmp.write(od, OptionsCont::getOptions(), SUMO_TAG_VEHICLE, typeID);
278  if (hasArrived) {
279  od.writeAttr("arrival", time2string(MSNet::getInstance()->getCurrentTimeStep()));
280  if (myRouteLength) {
281  const bool includeInternalLengths = MSGlobals::gUsingInternalLanes && MSNet::getInstance()->hasInternalLinks();
283  myHolder.getRoute().begin(), myHolder.getCurrentRouteEdge(), includeInternalLengths);
284  od.writeAttr("routeLength", routeLength);
285  }
286  }
287  if (myDUAStyle) {
289  if (routeDist != 0) {
290  const std::vector<const MSRoute*>& routes = routeDist->getVals();
291  unsigned index = 0;
292  while (index < routes.size() && routes[index] != myCurrentRoute) {
293  ++index;
294  }
295  od.openTag(SUMO_TAG_ROUTE_DISTRIBUTION).writeAttr(SUMO_ATTR_LAST, index);
296  const std::vector<double>& probs = routeDist->getProbs();
297  for (int i = 0; i < (int)routes.size(); ++i) {
298  od.setPrecision();
299  od.openTag(SUMO_TAG_ROUTE).writeAttr(SUMO_ATTR_COST, routes[i]->getCosts());
300  od.setPrecision(8);
301  od.writeAttr(SUMO_ATTR_PROB, probs[i]);
302  od.setPrecision();
303  od << " edges=\"";
304  routes[i]->writeEdgeIDs(od, *routes[i]->begin());
305  (od << "\"").closeTag();
306  }
307  od.closeTag();
308  } else {
309  writeXMLRoute(od);
310  }
311  } else {
312  if (myReplacedRoutes.size() > 0) {
313  od.openTag(SUMO_TAG_ROUTE_DISTRIBUTION);
314  for (int i = 0; i < (int)myReplacedRoutes.size(); ++i) {
315  writeXMLRoute(od, i);
316  }
317  }
318  writeXMLRoute(od);
319  if (myReplacedRoutes.size() > 0) {
320  od.closeTag();
321  }
322  }
324  // stopEnded is never called by mesosim
325  for (std::vector<SUMOVehicleParameter::Stop>::const_iterator i = myHolder.getRoute().getStops().begin(); i != myHolder.getRoute().getStops().end(); ++i) {
326  i->write(od);
327  }
328  for (std::vector<SUMOVehicleParameter::Stop>::const_iterator i = myHolder.getParameter().stops.begin(); i != myHolder.getParameter().stops.end(); ++i) {
329  i->write(od);
330  }
331  }
332  od << myStopOut.getString();
334  od.closeTag();
335  od.lf();
336  if (mySorted) {
337  myRouteInfos[tmp.depart][myHolder.getID()] = od.getString();
338  myDepartureCounts[tmp.depart]--;
339  std::map<const SUMOTime, int>::iterator it = myDepartureCounts.begin();
340  while (it != myDepartureCounts.end() && it->second == 0) {
341  std::map<const std::string, std::string>& infos = myRouteInfos[it->first];
342  for (std::map<const std::string, std::string>::const_iterator it2 = infos.begin(); it2 != infos.end(); ++it2) {
343  routeOut << it2->second;
344  }
345  myRouteInfos.erase(it->first);
346  myDepartureCounts.erase(it);
347  it = myDepartureCounts.begin();
348  }
349  } else {
350  routeOut << od.getString();
351  }
352 }
353 
354 
355 const MSRoute*
357  if (index < (int)myReplacedRoutes.size()) {
358  return myReplacedRoutes[index].route;
359  } else {
360  return 0;
361  }
362 }
363 
364 
365 void
367  if (myMaxRoutes > 0) {
368  if (myHolder.hasDeparted()) {
370  } else {
371  myReplacedRoutes.push_back(RouteReplaceInfo(0, MSNet::getInstance()->getCurrentTimeStep(), myCurrentRoute));
372  }
373  if ((int)myReplacedRoutes.size() > myMaxRoutes) {
374  myReplacedRoutes.front().route->release();
375  myReplacedRoutes.erase(myReplacedRoutes.begin());
376  }
377  } else {
379  }
382 }
383 
384 
385 void
387  for (std::map<const SUMOVehicle*, MSDevice_Vehroutes*, ComparatorIdLess >::const_iterator it = myStateListener.myDevices.begin();
388  it != myStateListener.myDevices.end(); ++it) {
389  if (it->first->hasDeparted()) {
390  it->second->writeOutput(false);
391  }
392  }
393 }
394 
395 
396 void
399  out.writeAttr(SUMO_ATTR_ID, getID());
400  std::vector<std::string> internals;
401  if (!MSGlobals::gUseMesoSim) {
402  internals.push_back(toString(myDepartLane));
403  internals.push_back(toString(myDepartPosLat));
404  }
405  internals.push_back(toString(myDepartSpeed));
406  internals.push_back(toString(myDepartPos));
407  internals.push_back(toString(myReplacedRoutes.size()));
408  for (int i = 0; i < (int)myReplacedRoutes.size(); ++i) {
409  const std::string replacedOnEdge = myReplacedRoutes[i].edge == 0 ? "!NULL" : myReplacedRoutes[i].edge->getID();
410  internals.push_back(replacedOnEdge);
411  internals.push_back(toString(myReplacedRoutes[i].time));
412  internals.push_back(myReplacedRoutes[i].route->getID());
413  }
414  out.writeAttr(SUMO_ATTR_STATE, toString(internals));
415  out.closeTag();
416 }
417 
418 
419 void
421  std::istringstream bis(attrs.getString(SUMO_ATTR_STATE));
422  if (!MSGlobals::gUseMesoSim) {
423  bis >> myDepartLane;
424  bis >> myDepartPosLat;
425  }
426  bis >> myDepartSpeed;
427  bis >> myDepartPos;
428  int size;
429  bis >> size;
430  for (int i = 0; i < size; ++i) {
431  std::string edgeID;
432  SUMOTime time;
433  std::string routeID;
434  bis >> edgeID;
435  bis >> time;
436  bis >> routeID;
437  myReplacedRoutes.push_back(RouteReplaceInfo(MSEdge::dictionary(edgeID), time, MSRoute::dictionary(routeID)));
438  }
439 }
440 
441 
442 /****************************************************************************/
static std::map< const SUMOTime, int > myDepartureCounts
Map needed to sort vehicles by departure time.
const MSLane * getLane() const
Returns the lane the reminder works on.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:260
const int myMaxRoutes
The maximum number of routes to report.
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:83
The position is given.
virtual bool hasDeparted() const =0
Returns whether this vehicle has departed.
virtual double getArrivalPos() const =0
Returns this vehicle&#39;s desired arrivalPos for its current route (may change on reroute) ...
const MSRoute * myCurrentRoute
The currently used route.
static StateListener myStateListener
A class that is notified about reroutings.
void release() const
deletes the route if there are no further references to it
Definition: MSRoute.cpp:104
virtual const MSRoute & getRoute() const =0
Returns the current route.
Represents a generic random distribution.
void vehicleStateChanged(const SUMOVehicle *const vehicle, MSNet::VehicleState to)
Called if a vehicle changes its state.
SUMOVehicle & myHolder
The vehicle that stores the device.
Definition: MSDevice.h:188
distribution of a route
static bool myDUAStyle
A shortcut for the Option "vehroute-output.dua".
const SUMOVehicleParameter::Stop pars
The stop parameter.
Definition: MSVehicle.h:917
std::string getString() const
Returns the current content as a string.
The position is given.
virtual const MSEdge * getEdge() const =0
Returns the edge the vehicle is currently at.
Notification
Definition of a vehicle state.
double getDistanceBetween(double fromPos, double toPos, const MSEdge *fromEdge, const MSEdge *toEdge, bool includeInternal=true) const
Compute the distance between 2 given edges on this route, including the length of internal lanes...
Definition: MSRoute.cpp:280
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:59
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:167
static bool dictionary(const std::string &id, MSEdge *edge)
Inserts edge into the static dictionary Returns true if the key id isn&#39;t already in the dictionary...
Definition: MSEdge.cpp:744
const std::vector< T > & getVals() const
Returns the members of the distribution.
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Does nothing, returns true only if exit times should be collected.
std::vector< SUMOTime > myExits
The times the vehicle exites an edge.
static bool mySorted
A shortcut for the Option "vehroute-output.sorted".
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static RandomDistributor< const MSRoute * > * distDictionary(const std::string &id)
Returns the named route distribution.
Definition: MSRoute.cpp:160
const std::string & getID() const
Returns the id.
Definition: Named.h:74
int size() const
Returns the number of edges to pass.
Definition: MSRoute.cpp:85
const std::string DEFAULT_VTYPE_ID
static bool mySaveExits
A shortcut for the Option "vehroute-output.exit-times".
void addVehicleStateListener(VehicleStateListener *listener)
Adds a vehicle states listener.
Definition: MSNet.cpp:832
void writeXMLRoute(OutputDevice &os, int index=-1) const
Called on route output.
begin/end of the description of a route
The speed is given.
static bool myIntendedDepart
A shortcut for the Option "vehroute-output.intended-depart".
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:64
The lane is given.
virtual std::string getString(int id) const =0
Returns the string-value of the named (by its enum-value) attribute.
std::vector< Stop > stops
List of the stops the vehicle will make, TraCI may add entries here.
void writeParams(OutputDevice &out) const
The state of a link.
void generateOutput() const
Called on writing vehroutes output.
static void init()
Static intialization.
A road/street connecting two junctions.
Definition: MSEdge.h:80
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
The vehicle changes lanes (micro only)
int myDepartLane
The lane the vehicle departed at.
static bool myLastRouteOnly
A shortcut for the Option "vehroute-output.last-route".
int getIndex() const
Returns the lane&#39;s index.
Definition: MSLane.h:520
The vehicle got a new route.
Definition: MSNet.h:494
void addRoute()
Called on route change.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:55
const std::vector< double > & getProbs() const
Returns the probabilities assigned to the members of the distribution.
Representation of a vehicle.
Definition: SUMOVehicle.h:66
Encapsulated SAX-Attributes.
std::map< const SUMOVehicle *, MSDevice_Vehroutes *, ComparatorIdLess > myDevices
A map for internal notification.
const int VEHPARS_DEPARTSPEED_SET
virtual int getNumberReroutes() const =0
Returns the number of new routes this vehicle got.
double myDepartPosLat
The lateral depart position.
std::vector< RouteReplaceInfo > myReplacedRoutes
Prior routes.
const int VEHPARS_DEPARTPOSLAT_SET
SUMOTime depart
The vehicle&#39;s departure time.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
Definition: MSNet.h:253
bool hasInternalLinks() const
return whether the network contains internal links
Definition: MSNet.h:587
A class that is notified about reroutings.
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
Definition: MSGlobals.h:75
int writeEdgeIDs(OutputDevice &os, const MSEdge *const from, const MSEdge *const upTo=0) const
Output the edge ids up to but not including the id of the given edge.
Definition: MSRoute.cpp:221
static void generateOutputForUnfinished()
generate vehroute output for vehicles which are still in the network
static bool mySkipPTLines
A shortcut for the Option "vehroute-output.skip-ptlines".
void writeOutput(const bool hasArrived) const
Called on writing vehroutes output.
std::string line
The vehicle&#39;s line (mainly for public transport)
static bool myRouteLength
A shortcut for the Option "vehroute-output.route-length".
VehicleState
Definition of a vehicle state.
Definition: MSNet.h:482
void saveState(OutputDevice &out) const
Saves the state of the device.
bool notifyLeave(SUMOVehicle &veh, double lastPos, Notification reason, const MSLane *enteredLane=0)
Saves exit times if needed.
Abstract in-vehicle device.
Definition: MSDevice.h:70
void write(OutputDevice &dev) const
Writes the stop as XML.
virtual double getDepartPos() const =0
Returns this vehicle&#39;s real departure position.
The vehicle has departed (was inserted into the network)
Structure representing possible vehicle parameter.
virtual SUMOTime getDeparture() const =0
Returns this vehicle&#39;s real departure time.
double myDepartSpeed
The speed on departure.
virtual double getPositionOnLane() const =0
Get the vehicle&#39;s position along the lane.
static OutputDevice & getDeviceByOption(const std::string &name)
Returns the device described by the option.
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle&#39;s parameter (including departure definition)
MSDevice_Vehroutes(SUMOVehicle &holder, const std::string &id, int maxRoutes)
Constructor.
const std::string & getID() const
Returns the name of the vehicle type.
const int VEHPARS_DEPARTLANE_SET
OutputDevice_String myStopOut
void addReference() const
increments the reference counter for the route
Definition: MSRoute.cpp:98
A device which collects info on the vehicle trip (mainly on departure and arrival) ...
static MSDevice_Vehroutes * buildVehicleDevices(SUMOVehicle &v, std::vector< MSDevice *> &into, int maxRoutes=std::numeric_limits< int >::max())
Build devices for the given vehicle, if needed.
description of a vehicle
static bool createDeviceByOption(const std::string &optionName, const std::string &rootElement="", const std::string &schemaFile="")
Creates the device using the output definition stored in the named option.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
bool closeTag()
Closes the most recently opened tag.
void loadState(const SUMOSAXAttributes &attrs)
Loads the state of the device from the given description.
long long int SUMOTime
Definition: TraCIDefs.h:51
const MSRoute * getRoute(int index) const
Called on route retrieval.
MSRouteIterator begin() const
Returns the begin of the list of edges to pass.
Definition: MSRoute.cpp:73
static std::map< const SUMOTime, std::map< const std::string, std::string > > myRouteInfos
const int VEHPARS_DEPARTPOS_SET
virtual const ConstMSEdgeVector::const_iterator & getCurrentRouteEdge() const =0
Returns an iterator pointing to the current edge in this vehicles route.
virtual double getSpeed() const =0
Returns the vehicle&#39;s current speed.
bool isBinary() const
Returns whether we have a binary output.
Definition: OutputDevice.h:248
double myDepartPos
The lane the vehicle departed at.
static bool gUseMesoSim
Definition: MSGlobals.h:97
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
const std::vector< SUMOVehicleParameter::Stop > & getStops() const
Returns the stops.
Definition: MSRoute.cpp:366
virtual const std::string & getID() const =0
Get the vehicle&#39;s ID.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
An output device that encapsulates an ofstream.
The vehicle is being teleported.
void stopEnded(const MSVehicle::Stop &stop)
Definition of vehicle stop (position and duration)
Definition: MSVehicle.h:901
const MSEdge * myLastSavedAt
The last edge the exit time was saved for.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle&#39;s type.
static bool dictionary(const std::string &id, const MSRoute *route)
Adds a route to the dictionary.
Definition: MSRoute.cpp:117
~MSDevice_Vehroutes()
Destructor.
Information about a replaced route.