SUMO - Simulation of Urban MObility
MEVehicle.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-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 /****************************************************************************/
17 // A vehicle from the mesoscopic point of view
18 /****************************************************************************/
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #ifdef _MSC_VER
25 #include <windows_config.h>
26 #else
27 #include <config.h>
28 #endif
29 
30 #include <iostream>
31 #include <cassert>
32 #include <utils/common/StdDefs.h>
38 #include <microsim/MSGlobals.h>
39 #include <microsim/MSEdge.h>
40 #include <microsim/MSLane.h>
41 #include <microsim/MSNet.h>
42 #include <microsim/MSVehicleType.h>
43 #include <microsim/MSLink.h>
45 #include "MELoop.h"
46 #include "MEVehicle.h"
47 #include "MESegment.h"
48 
49 
50 // ===========================================================================
51 // method definitions
52 // ===========================================================================
54  MSVehicleType* type, const double speedFactor) :
55  MSBaseVehicle(pars, route, type, speedFactor),
56  mySegment(0),
57  myQueIndex(0),
58  myEventTime(SUMOTime_MIN),
59  myLastEntryTime(SUMOTime_MIN),
60  myBlockTime(SUMOTime_MAX) {
61  if (!(*myCurrEdge)->isTazConnector()) {
62  if ((*myCurrEdge)->allowedLanes(type->getVehicleClass()) == 0) {
63  throw ProcessError("Vehicle '" + pars->id + "' is not allowed to depart on any lane of its first edge.");
64  }
65  if (pars->departSpeedProcedure == DEPART_SPEED_GIVEN && pars->departSpeed > type->getMaxSpeed()) {
66  throw ProcessError("Departure speed for vehicle '" + pars->id +
67  "' is too high for the vehicle type '" + type->getID() + "'.");
68  }
69  }
70 }
71 
72 
73 double
74 MEVehicle::getBackPositionOnLane(const MSLane* /* lane */) const {
76 }
77 
78 
79 double
81 // the following interpolation causes problems with arrivals and calibrators
82 // const double fracOnSegment = MIN2(double(1), STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep() - myLastEntryTime) / STEPS2TIME(myEventTime - myLastEntryTime));
83  return mySegment == 0 ? 0 : (double(mySegment->getIndex()) /* + fracOnSegment */) * mySegment->getLength();
84 }
85 
86 
87 double
89  const MSLane* const lane = getEdge()->getLanes()[0];
91 }
92 
93 
94 double
96  const MSLane* const lane = getEdge()->getLanes()[0];
98 }
99 
100 
101 Position
102 MEVehicle::getPosition(const double offset) const {
103  const MSLane* const lane = getEdge()->getLanes()[0];
104  return lane->geometryPositionAtOffset(getPositionOnLane() + offset);
105 }
106 
107 
108 double
110  if (getWaitingTime() > 0) {
111  return 0;
112  } else {
113  return getAverageSpeed();
114  }
115 }
116 
117 
118 double
121 }
122 
123 
124 double
127  const double v = getSpeed();
128  return MIN2(link->getViaLaneOrLane()->getVehicleMaxSpeed(this),
129  (double)sqrt(2 * link->getLength() * getVehicleType().getCarFollowModel().getMaxAccel() + v * v));
130 }
131 
132 
133 double
134 MEVehicle::getConservativeSpeed(SUMOTime& earliestArrival) const {
135  earliestArrival = MAX2(myEventTime, earliestArrival - DELTA_T); // event times have subsecond resolution
136  return mySegment->getLength() / STEPS2TIME(earliestArrival - myLastEntryTime);
137 }
138 
139 
140 bool
142  // vehicle has just entered a new edge. Position is 0
143  if (myCurrEdge == myRoute->end() - 1) { // may happen during teleport
144  return true;
145  }
146  ++myCurrEdge;
147  if ((*myCurrEdge)->isVaporizing()) {
148  return true;
149  }
150  // update via
151  if (myParameter->via.size() > 0 && (*myCurrEdge)->getID() == myParameter->via.front()) {
152  myParameter->via.erase(myParameter->via.begin());
153  }
154  return hasArrived();
155 }
156 
157 
158 bool
160  // mySegment may be 0 due to teleporting or arrival
161  return myCurrEdge == myRoute->end() - 1 && (
162  (mySegment == 0)
165 }
166 
167 bool
169  return getSegment() != 0;
170 }
171 
172 
173 bool
175  return false; // parking attribute of a stop is not yet evaluated /implemented
176 }
177 
178 
179 bool
180 MEVehicle::replaceRoute(const MSRoute* newRoute, bool onInit, int offset, bool addStops, bool removeStops) {
181  UNUSED_PARAMETER(addStops); // @todo recheck!
182  UNUSED_PARAMETER(removeStops); // @todo recheck!
183  const ConstMSEdgeVector& edges = newRoute->getEdges();
184  // assert the vehicle may continue (must not be "teleported" or whatever to another position)
185  if (!onInit && !newRoute->contains(*myCurrEdge)) {
186  return false;
187  }
188  MSLink* oldLink = 0;
189  MSLink* newLink = 0;
190  if (mySegment != 0) {
191  oldLink = mySegment->getLink(this);
192  }
193  // rebuild in-vehicle route information
194  if (onInit) {
195  myCurrEdge = newRoute->begin();
196  } else {
197  myCurrEdge = find(edges.begin() + offset, edges.end(), *myCurrEdge);
198  }
199  // check whether the old route may be deleted (is not used by anyone else)
200  newRoute->addReference();
201  myRoute->release();
202  // assign new route
203  myRoute = newRoute;
204  if (mySegment != 0) {
205  newLink = mySegment->getLink(this);
206  }
207  // update approaching vehicle information
208  if (oldLink != 0 && oldLink != newLink) {
209  oldLink->removeApproaching(this);
210  MELoop::setApproaching(this, newLink);
211  }
212  // update arrival definition
214  // save information that the vehicle was rerouted
218  return true;
219 }
220 
221 
222 bool
223 MEVehicle::addStop(const SUMOVehicleParameter::Stop& stopPar, std::string& /*errorMsg*/, SUMOTime /* untilOffset */, bool /*collision*/,
224  MSRouteIterator* /* searchStart */) {
225  const MSEdge* const edge = MSEdge::dictionary(stopPar.lane.substr(0, stopPar.lane.rfind('_')));
226  assert(edge != 0);
227  MESegment* stopSeg = MSGlobals::gMesoNet->getSegmentForEdge(*edge, stopPar.endPos);
228  myStops[stopSeg] += stopPar.duration;
229  return true;
230 }
231 
232 
233 bool
235  return myStops.find(mySegment) != myStops.end();
236 }
237 
238 
239 bool
241  return false;
242 }
243 
244 
245 bool
246 MEVehicle::isStoppedInRange(double pos) const {
247  UNUSED_PARAMETER(pos);
248  return isStopped();
249 }
250 
251 
252 SUMOTime
253 MEVehicle::getStoptime(const MESegment* const seg) const {
254  if (myStops.find(seg) != myStops.end()) {
255  return myStops.find(seg)->second;
256  }
257  return 0;
258 }
259 
260 
261 const ConstMSEdgeVector
263  ConstMSEdgeVector result;
264  for (std::map<const MESegment* const, SUMOTime>::const_iterator iter = myStops.begin(); iter != myStops.end(); ++iter) {
265  result.push_back(&iter->first->getEdge());
266  }
267  return result;
268 }
269 
270 
271 bool
273  return mySegment == 0 || mySegment->isOpen(this);
274 }
275 
276 
277 double
279  if (mySegment == 0) {
280  return 0;
281  } else {
282  return STEPS2TIME(mySegment->getLinkPenalty(this));
283  }
284 }
285 
286 
287 void
289  for (MoveReminderCont::iterator i = myMoveReminders.begin(); i != myMoveReminders.end(); ++i) {
290  if (i->first == rem) {
292  (mySegment->getIndex() + 1) * mySegment->getLength(),
293  getLastEntryTime(), currentTime, exitTime, false);
294 #ifdef _DEBUG
295  if (myTraceMoveReminders) {
296  traceMoveReminder("notifyMove", i->first, i->second, true);
297  }
298 #endif
299  return;
300  }
301  }
302 }
303 
304 
305 void
306 MEVehicle::updateDetectors(SUMOTime currentTime, const bool isLeave, const MSMoveReminder::Notification reason) {
307  // segments of the same edge have the same reminder so no cleaning up must take place
308  const bool cleanUp = isLeave && (reason != MSMoveReminder::NOTIFICATION_SEGMENT);
309  for (MoveReminderCont::iterator rem = myMoveReminders.begin(); rem != myMoveReminders.end();) {
310  if (currentTime != getLastEntryTime()) {
311  rem->first->updateDetector(*this, mySegment->getIndex() * mySegment->getLength(),
312  (mySegment->getIndex() + 1) * mySegment->getLength(),
313  getLastEntryTime(), currentTime, getEventTime(), cleanUp);
314 #ifdef _DEBUG
315  if (myTraceMoveReminders) {
316  traceMoveReminder("notifyMove", rem->first, rem->second, true);
317  }
318 #endif
319  }
320  if (!isLeave || rem->first->notifyLeave(*this, mySegment->getLength(), reason)) {
321 #ifdef _DEBUG
322  if (isLeave && myTraceMoveReminders) {
323  traceMoveReminder("notifyLeave", rem->first, rem->second, true);
324  }
325 #endif
326  ++rem;
327  } else {
328 #ifdef _DEBUG
329  if (myTraceMoveReminders) {
330  traceMoveReminder("remove", rem->first, rem->second, false);
331  }
332 #endif
333  rem = myMoveReminders.erase(rem);
334  }
335  }
336 }
337 
338 
339 void
342  assert(mySegment == 0 || *myCurrEdge == &mySegment->getEdge());
343  std::vector<SUMOTime> internals;
344  internals.push_back(myDeparture);
345  internals.push_back((SUMOTime)distance(myRoute->begin(), myCurrEdge));
346  internals.push_back(mySegment == 0 ? (SUMOTime) - 1 : (SUMOTime)mySegment->getIndex());
347  internals.push_back((SUMOTime)getQueIndex());
348  internals.push_back(myEventTime);
349  internals.push_back(myLastEntryTime);
350  internals.push_back(myBlockTime);
351  out.writeAttr(SUMO_ATTR_STATE, toString(internals));
352  // save stops and parameters
353  for (std::map<const MESegment* const, SUMOTime>::const_iterator it = myStops.begin(); it != myStops.end(); ++it) {
354  out.openTag(SUMO_TAG_STOP);
355  out.writeAttr(SUMO_ATTR_LANE, it->first->getEdge().getLanes()[0]->getID());
356  out.writeAttr(SUMO_ATTR_ENDPOS, it->first->getIndex() * it->first->getLength());
357  out.writeAttr(SUMO_ATTR_DURATION, STEPS2TIME(it->second));
358  out.closeTag();
359  }
360  myParameter->writeParams(out);
361  for (std::vector<MSDevice*>::const_iterator dev = myDevices.begin(); dev != myDevices.end(); ++dev) {
362  (*dev)->saveState(out);
363  }
364  out.closeTag();
365 }
366 
367 
368 void
369 MEVehicle::loadState(const SUMOSAXAttributes& attrs, const SUMOTime offset) {
370  if (attrs.hasAttribute(SUMO_ATTR_POSITION)) {
371  throw ProcessError("Error: Invalid vehicles in state (may be a micro state)!");
372  }
373  int routeOffset;
374  int segIndex;
375  int queIndex;
376  std::istringstream bis(attrs.getString(SUMO_ATTR_STATE));
377  bis >> myDeparture;
378  bis >> routeOffset;
379  bis >> segIndex;
380  bis >> queIndex;
381  bis >> myEventTime;
382  bis >> myLastEntryTime;
383  bis >> myBlockTime;
384  if (hasDeparted()) {
385  myDeparture -= offset;
386  myEventTime -= offset;
387  myLastEntryTime -= offset;
388  myCurrEdge += routeOffset;
389  if (segIndex >= 0) {
391  while (seg->getIndex() != (int)segIndex) {
392  seg = seg->getNextSegment();
393  assert(seg != 0);
394  }
395  setSegment(seg, queIndex);
396  } else {
397  // on teleport
398  setSegment(0, 0);
399  assert(myEventTime != SUMOTime_MIN);
401  }
402  }
403  if (myBlockTime != SUMOTime_MAX) {
404  myBlockTime -= offset;
405  }
406 }
407 
408 
409 /****************************************************************************/
410 
void updateDetectorForWriting(MSMoveReminder *rem, SUMOTime currentTime, SUMOTime exitTime)
Updates a single vehicle detector if present.
Definition: MEVehicle.cpp:288
void loadState(const SUMOSAXAttributes &attrs, const SUMOTime offset)
Loads the state of this vehicle from the given description.
Definition: MEVehicle.cpp:369
MESegment * getNextSegment() const
Returns the following segment on the same edge (0 if it is the last).
Definition: MESegment.h:156
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:260
void updateDetector(SUMOVehicle &veh, double entryPos, double leavePos, SUMOTime entryTime, SUMOTime currentTime, SUMOTime leaveTime, bool cleanUp)
double getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the lane&#39;s maximum speed, given a vehicle&#39;s speed limit adaptation.
Definition: MSLane.h:475
virtual void setSegment(MESegment *s, int idx=0)
Sets the current segment the vehicle is at together with its que.
Definition: MEVehicle.h:220
double getAngle() const
Returns the vehicle&#39;s direction in degrees.
Definition: MEVehicle.cpp:88
bool isOpen(const MEVehicle *veh) const
Returns whether the vehicle may use the next link.
Definition: MESegment.cpp:425
double getLength() const
Returns the length of the segment in meters.
Definition: MESegment.h:164
MoveReminderCont myMoveReminders
Currently relevant move reminders.
const ConstMSEdgeVector & getEdges() const
Definition: MSRoute.h:127
MESegment * getSegmentForEdge(const MSEdge &e, double pos=0)
Get the segment for a given edge at a given position.
Definition: MELoop.cpp:289
bool hasDeparted() const
Returns whether this vehicle has already departed.
void release() const
deletes the route if there are no further references to it
Definition: MSRoute.cpp:104
double estimateLeaveSpeed(const MSLink *link) const
Returns the vehicle&#39;s estimated speed after driving accross the link.
Definition: MEVehicle.cpp:125
SUMOTime getLastEntryTime() const
Returns the time the vehicle entered the current segment.
Definition: MEVehicle.h:253
SUMOTime duration
The stopping duration.
bool mayProceed() const
Returns whether the vehicle is allowed to pass the next junction.
Definition: MEVehicle.cpp:272
int getIndex() const
Returns the running index of the segment in the edge (0 is the most upstream).
Definition: MESegment.h:148
Position getPosition(const double offset=0) const
Return current position (x/y, cartesian)
Definition: MEVehicle.cpp:102
double getSlope() const
Returns the slope of the road at vehicle&#39;s position.
Definition: MEVehicle.cpp:95
double myArrivalPos
The position on the destination lane where the vehicle stops.
Notification
Definition of a vehicle state.
const std::vector< MSLane * > & getLanes() const
Returns this edge&#39;s lanes.
Definition: MSEdge.h:167
SUMOTime getWaitingTime() const
Returns the duration for which the vehicle was blocked.
Definition: MEVehicle.h:276
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:167
T MAX2(T a, T b)
Definition: StdDefs.h:73
SUMOTime DELTA_T
Definition: SUMOTime.cpp:39
const PositionVector & getShape() const
Returns this lane&#39;s shape.
Definition: MSLane.h:439
const MSRoute * myRoute
This vehicle&#39;s route.
SUMOTime getEventTime() const
Returns the (planned) time at which the vehicle leaves his current cell.
Definition: MEVehicle.h:211
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
double rotationAtOffset(double pos) const
Returns the rotation at the given length.
bool isStoppedInRange(double pos) const
return whether the given position is within range of the current stop
Definition: MEVehicle.cpp:246
The vehicle changes the segment (meso only)
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:78
const SUMOVehicleParameter * myParameter
This vehicle&#39;s parameter.
The base class for microscopic and mesoscopic vehicles.
Definition: MSBaseVehicle.h:55
bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
Definition: MEVehicle.cpp:168
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list...
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:39
The speed is given.
The car-following model and parameter.
Definition: MSVehicleType.h:72
virtual void saveState(OutputDevice &out)
Saves the (common) state of a vehicle.
virtual std::string getString(int id) const =0
Returns the string-value of the named (by its enum-value) attribute.
void writeParams(OutputDevice &out) const
double getMaxAccel() const
Get the vehicle type&#39;s maximum acceleration [m/s^2].
Definition: MSCFModel.h:203
void calculateArrivalParams()
(Re-)Calculates the arrival position and lane from the vehicle parameters
The state of a link.
#define SUMOTime_MIN
Definition: SUMOTime.h:44
double departSpeed
(optional) The initial speed of the vehicle
A road/street connecting two junctions.
Definition: MSEdge.h:80
bool replaceRoute(const MSRoute *route, bool onInit=false, int offset=0, bool addStops=true, bool removeStops=true)
Replaces the current route by the given one.
Definition: MEVehicle.cpp:180
SUMOTime getLinkPenalty(const MEVehicle *veh) const
Returns the penalty time for passing a link (if using gMesoTLSPenalty > 0 or gMesoMinorPenalty > 0) ...
Definition: MESegment.cpp:698
DepartSpeedDefinition departSpeedProcedure
Information how the vehicle&#39;s initial speed shall be chosen.
const MSCFModel & getCarFollowModel() const
Returns the vehicle type&#39;s car following model definition (const version)
The vehicle got a new route.
Definition: MSNet.h:494
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:55
Encapsulated SAX-Attributes.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:45
#define SUMOTime_MAX
Definition: TraCIDefs.h:52
MESegment * getSegment() const
Returns the current segment the vehicle is on.
Definition: MEVehicle.h:229
const MSEdge * getEdge() const
Returns the edge the vehicle is currently at.
bool addStop(const SUMOVehicleParameter::Stop &stopPar, std::string &errorMsg, SUMOTime untilOffset=0, bool collision=false, MSRouteIterator *searchStart=0)
Adds a stop.
Definition: MEVehicle.cpp:223
ConstMSEdgeVector::const_iterator MSRouteIterator
Definition: MSRoute.h:64
bool isStopped() const
Returns whether the vehicle is at a stop.
Definition: MEVehicle.cpp:234
#define STEPS2TIME(x)
Definition: SUMOTime.h:64
double getMaxSpeed() const
Get vehicle&#39;s maximum speed [m/s].
bool hasArrived() const
Returns whether this vehicle has already arived (reached the arrivalPosition on its final edge) ...
Definition: MEVehicle.cpp:159
T MIN2(T a, T b)
Definition: StdDefs.h:67
#define POSITION_EPS
Definition: config.h:175
SUMOTime myLastEntryTime
The time the vehicle entered its current segment.
Definition: MEVehicle.h:356
double endPos
The stopping position end.
Something on a lane to be noticed about vehicle movement.
int getQueIndex() const
Returns the index of the que the vehicle is in.
Definition: MEVehicle.h:237
void saveState(OutputDevice &out)
Saves the states of a vehicle.
Definition: MEVehicle.cpp:340
double getConservativeSpeed(SUMOTime &earliestArrival) const
Returns the vehicle&#39;s estimated speed taking into account delays.
Definition: MEVehicle.cpp:134
MESegment * mySegment
The segment the vehicle is at.
Definition: MEVehicle.h:347
static void setApproaching(MEVehicle *veh, MSLink *link)
registers vehicle with the given link
Definition: MELoop.cpp:211
std::string lane
The lane to stop at.
std::vector< std::string > via
List of the via-edges the vehicle must visit.
bool moveRoutePointer()
Update when the vehicle enters a new edge in the move step.
Definition: MEVehicle.cpp:141
double slopeDegreeAtOffset(double pos) const
Returns the slope at the given length.
SUMOTime getStoptime(const MESegment *const seg) const
Returns how long to stop at the given segment.
Definition: MEVehicle.cpp:253
stop for vehicles
void addStops(const bool ignoreStopErrors)
Adds stops to the built vehicle.
Structure representing possible vehicle parameter.
const MSVehicleType & getVehicleType() const
Returns the vehicle&#39;s type definition.
MSLink * getLink(const MEVehicle *veh, bool tlsPenalty=false) const
Returns the link the given car will use when passing the next junction.
Definition: MESegment.cpp:394
A single mesoscopic segment (cell)
Definition: MESegment.h:56
Definition of vehicle stop (position and duration)
MEVehicle(SUMOVehicleParameter *pars, const MSRoute *route, MSVehicleType *type, const double speedFactor)
Constructor.
Definition: MEVehicle.cpp:53
void updateDetectors(SUMOTime currentTime, const bool isLeave, const MSMoveReminder::Notification reason=MSMoveReminder::NOTIFICATION_JUNCTION)
Updates all vehicle detectors.
Definition: MEVehicle.cpp:306
double interpolateLanePosToGeometryPos(double lanePos) const
Definition: MSLane.h:455
const std::string & getID() const
Returns the name of the vehicle type.
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
Definition: MSLane.h:461
void addReference() const
increments the reference counter for the route
Definition: MSRoute.cpp:98
std::map< const MESegment *const, SUMOTime > myStops
where to stop
Definition: MEVehicle.h:362
static MELoop * gMesoNet
mesoscopic simulation infrastructure
Definition: MSGlobals.h:112
int myNumberReroutes
The number of reroutings.
double getLength() const
Get vehicle&#39;s length [m].
void informVehicleStateListener(const SUMOVehicle *const vehicle, VehicleState to)
Informs all added listeners about a vehicle&#39;s state change.
Definition: MSNet.cpp:849
bool isParking() const
Returns whether the vehicle is parking.
Definition: MEVehicle.cpp:174
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
bool closeTag()
Closes the most recently opened tag.
double getPositionOnLane() const
Get the vehicle&#39;s position along the lane.
Definition: MEVehicle.cpp:80
SUMOTime myEventTime
The (planned) time of leaving the segment (cell)
Definition: MEVehicle.h:353
double getAverageSpeed() const
Returns the vehicle&#39;s estimated average speed on the segment assuming no further delays.
Definition: MEVehicle.cpp:119
long long int SUMOTime
Definition: TraCIDefs.h:51
MSRouteIterator myCurrEdge
Iterator to current route-edge.
double getCurrentLinkPenaltySeconds() const
Returns the delay that is accrued due to option –meso-tls-penalty or –meso-minor-penalty.
Definition: MEVehicle.cpp:278
MSRouteIterator begin() const
Returns the begin of the list of edges to pass.
Definition: MSRoute.cpp:73
double getSpeed() const
Returns the vehicle&#39;s estimated speed assuming no delays.
Definition: MEVehicle.cpp:109
const ConstMSEdgeVector getStopEdges() const
Returns the list of still pending stop edges.
Definition: MEVehicle.cpp:262
bool isStoppedTriggered() const
Returns whether the vehicle is on a triggered stop.
Definition: MEVehicle.cpp:240
SUMOTime myBlockTime
The time at which the vehicle was blocked on its current segment.
Definition: MEVehicle.h:359
const MSEdge & getEdge() const
Returns the edge this segment belongs to.
Definition: MESegment.h:270
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
std::vector< MSDevice * > myDevices
The devices this vehicle has.
void addLeaderCar(MEVehicle *veh, MSLink *link)
Adds the given car to the leading vehicles.
Definition: MELoop.cpp:204
MSRouteIterator end() const
Returns the end of the list of edges to pass.
Definition: MSRoute.cpp:79
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool contains(const MSEdge *const edge) const
Definition: MSRoute.h:109
SUMOTime myDeparture
The real departure time.
SUMOVehicleClass getVehicleClass() const
Get this vehicle type&#39;s vehicle class.
std::string id
The vehicle&#39;s id.
double getBackPositionOnLane(const MSLane *lane) const
Get the vehicle&#39;s position relative to the given lane.
Definition: MEVehicle.cpp:74