Eclipse SUMO - Simulation of Urban MObility
MSBaseVehicle.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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // A base class for vehicle implementations
18 /****************************************************************************/
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <iostream>
27 #include <cassert>
28 #include <utils/common/StdDefs.h>
33 #include "MSGlobals.h"
34 #include "MSTransportable.h"
35 #include "MSVehicleControl.h"
36 #include "MSVehicleType.h"
37 #include "MSEdge.h"
38 #include "MSLane.h"
39 #include "MSMoveReminder.h"
40 #include "MSBaseVehicle.h"
41 #include "MSNet.h"
42 #include "devices/MSDevice.h"
45 #include "MSInsertionControl.h"
46 
47 //#define DEBUG_REROUTE
48 //#define DEBUG_COND (getID() == "follower")
49 //#define DEBUG_COND (true)
50 #define DEBUG_COND (isSelected())
51 
52 // ===========================================================================
53 // static members
54 // ===========================================================================
56 std::vector<MSTransportable*> MSBaseVehicle::myEmptyTransportableVector;
57 #ifdef _DEBUG
58 std::set<std::string> MSBaseVehicle::myShallTraceMoveReminders;
59 #endif
61 
62 
63 // ===========================================================================
64 // method definitions
65 // ===========================================================================
66 
67 double
69  throw ProcessError("getPreviousSpeed() is not available for non-MSVehicles.");
70 }
71 
72 
74  MSVehicleType* type, const double speedFactor) :
75  myParameter(pars),
76  myRoute(route),
77  myType(type),
78  myCurrEdge(route->begin()),
79  myChosenSpeedFactor(speedFactor),
80  myMoveReminders(0),
81  myPersonDevice(nullptr),
82  myContainerDevice(nullptr),
83  myDeparture(NOT_YET_DEPARTED),
84  myDepartPos(-1),
85  myArrivalPos(-1),
86  myArrivalLane(-1),
87  myNumberReroutes(0),
88  myNumericalID(myCurrentNumericalIndex++)
89 #ifdef _DEBUG
90  , myTraceMoveReminders(myShallTraceMoveReminders.count(pars->id) > 0)
91 #endif
92 {
93  if ((*myRoute->begin())->isTazConnector() || myRoute->getLastEdge()->isTazConnector()) {
95  }
96  if (!pars->wasSet(VEHPARS_FORCE_REROUTE)) {
99  std::string msg;
100  if (!hasValidRoute(msg)) {
101  msg = "Vehicle '" + pars->id + "' has no valid route. " + msg;
102  delete myParameter;
103  throw ProcessError(msg);
104  }
105  }
106  }
107  // init devices
108  try {
110  } catch (ProcessError&) {
111  for (MSVehicleDevice* dev : myDevices) {
112  delete dev;
113  }
114  delete myParameter;
115  throw;
116  }
118  for (MSVehicleDevice* dev : myDevices) {
119  myMoveReminders.push_back(std::make_pair(dev, 0.));
120  }
121 }
122 
123 
125  myRoute->release();
126  if (myParameter->repetitionNumber == 0) {
128  }
129  for (MSVehicleDevice* dev : myDevices) {
130  delete dev;
131  }
132  delete myParameter;
133 }
134 
135 
136 const std::string&
138  return myParameter->id;
139 }
140 
141 
144  return *myParameter;
145 }
146 
147 void
149  delete myParameter;
150  myParameter = newParameter;
151 }
152 
153 double
155  return myType->getMaxSpeed();
156 }
157 
158 
159 const MSEdge*
160 MSBaseVehicle::succEdge(int nSuccs) const {
161  if (myCurrEdge + nSuccs < myRoute->end() && std::distance(myCurrEdge, myRoute->begin()) <= nSuccs) {
162  return *(myCurrEdge + nSuccs);
163  } else {
164  return nullptr;
165  }
166 }
167 
168 
169 const MSEdge*
171  return *myCurrEdge;
172 }
173 
174 
175 void
176 MSBaseVehicle::reroute(SUMOTime t, const std::string& info, SUMOAbstractRouter<MSEdge, SUMOVehicle>& router, const bool onInit, const bool withTaz, const bool silent) {
177  // check whether to reroute
178  const MSEdge* source = withTaz && onInit ? MSEdge::dictionary(myParameter->fromTaz + "-source") : getRerouteOrigin();
179  if (source == nullptr) {
180  source = getRerouteOrigin();
181  }
182  const MSEdge* sink = withTaz ? MSEdge::dictionary(myParameter->toTaz + "-sink") : myRoute->getLastEdge();
183  if (sink == nullptr) {
184  sink = myRoute->getLastEdge();
185  }
186  ConstMSEdgeVector oldEdgesRemaining(source == *myCurrEdge ? myCurrEdge : myCurrEdge + 1, myRoute->end());
187  ConstMSEdgeVector edges;
188  ConstMSEdgeVector stops;
189  if (myParameter->via.size() == 0) {
190  double firstPos = -1;
191  double lastPos = -1;
192  stops = getStopEdges(firstPos, lastPos);
193  if (stops.size() > 0) {
194  const double sourcePos = onInit ? 0 : getPositionOnLane();
195  // avoid superfluous waypoints for first and last edge
196  const bool skipFirst = stops.front() == source && sourcePos < firstPos;
197  const bool skipLast = stops.back() == sink && myArrivalPos > lastPos;
198 #ifdef DEBUG_REROUTE
199  if (DEBUG_COND) {
200  std::cout << SIMTIME << " reroute " << info << " veh=" << getID() << " lane=" << getLane()->getID()
201  << " source=" << source->getID() << " sourcePos=" << sourcePos << " firstPos=" << firstPos << " arrivalPos=" << myArrivalPos << " lastPos=" << lastPos
202  << " route=" << toString(myRoute->getEdges()) << " stopEdges=" << toString(stops) << " skipFirst=" << skipFirst << " skipLast=" << skipLast << "\n";
203  }
204 #endif
205  if (stops.size() == 1 && (skipFirst || skipLast)) {
206  stops.clear();
207  } else {
208  if (skipFirst) {
209  stops.erase(stops.begin());
210  }
211  if (skipLast) {
212  stops.erase(stops.end() - 1);
213  }
214  }
215  }
216  } else {
217  // via takes precedence over stop edges
218  // XXX check for inconsistencies #2275
219  for (std::vector<std::string>::const_iterator it = myParameter->via.begin(); it != myParameter->via.end(); ++it) {
220  MSEdge* viaEdge = MSEdge::dictionary(*it);
221  if (viaEdge == source || viaEdge == sink) {
222  continue;
223  }
224  assert(viaEdge != 0);
225  if (!viaEdge->isTazConnector() && viaEdge->allowedLanes(getVClass()) == nullptr) {
226  throw ProcessError("Vehicle '" + getID() + "' is not allowed on any lane of via edge '" + viaEdge->getID() + "'.");
227  }
228  stops.push_back(viaEdge);
229  }
230  }
231 
232  for (MSRouteIterator s = stops.begin(); s != stops.end(); ++s) {
233  // !!! need to adapt t here
234  ConstMSEdgeVector into;
235  router.computeLooped(source, *s, this, t, into, silent);
236  if (into.size() > 0) {
237  into.pop_back();
238  edges.insert(edges.end(), into.begin(), into.end());
239  if ((*s)->isTazConnector()) {
240  source = into.back();
241  edges.pop_back();
242  } else {
243  source = *s;
244  }
245  } else {
246  std::string error = "Vehicle '" + getID() + "' has no valid route from edge '" + source->getID() + "' to stop edge '" + (*s)->getID() + "'.";
247  if (MSGlobals::gCheckRoutes || silent) {
248  throw ProcessError(error);
249  } else {
250  WRITE_WARNING(error);
251  edges.push_back(source);
252  }
253  source = *s;
254  }
255  }
256  router.compute(source, sink, this, t, edges, silent);
257  if (edges.empty() && silent) {
258  return;
259  }
260  if (!edges.empty() && edges.front()->isTazConnector()) {
261  edges.erase(edges.begin());
262  }
263  if (!edges.empty() && edges.back()->isTazConnector()) {
264  edges.pop_back();
265  }
266  const double routeCost = router.recomputeCosts(edges, this, t);
267  const double previousCost = onInit ? routeCost : router.recomputeCosts(oldEdgesRemaining, this, t);
268  const double savings = previousCost - routeCost;
269  //if (getID() == "43") std::cout << SIMTIME << " pCost=" << previousCost << " cost=" << routeCost
270  // << " onInit=" << onInit
271  // << " prevEdges=" << toString(oldEdgesRemaining)
272  // << " newEdges=" << toString(edges)
273  // << "\n";
274  replaceRouteEdges(edges, routeCost, savings, info, onInit);
275  // this must be called even if the route could not be replaced
276  if (onInit) {
277  if (edges.empty()) {
279  throw ProcessError("Vehicle '" + getID() + "' has no valid route.");
280  } else if (source->isTazConnector()) {
281  WRITE_WARNING("Removing vehicle '" + getID() + "' which has no valid route.");
283  return;
284  }
285  }
287  }
288 }
289 
290 
291 bool
292 MSBaseVehicle::replaceRouteEdges(ConstMSEdgeVector& edges, double cost, double savings, const std::string& info, bool onInit, bool check, bool removeStops) {
293  if (edges.empty()) {
294  WRITE_WARNING("No route for vehicle '" + getID() + "' found.");
295  return false;
296  }
297  // build a new id, first
298  std::string id = getID();
299  if (id[0] != '!') {
300  id = "!" + id;
301  }
302  if (myRoute->getID().find("!var#") != std::string::npos) {
303  id = myRoute->getID().substr(0, myRoute->getID().rfind("!var#") + 5) + toString(getNumberReroutes() + 1);
304  } else {
305  id = id + "!var#1";
306  }
307  int oldSize = (int)edges.size();
308  if (!onInit) {
309  const MSEdge* const origin = getRerouteOrigin();
310  if (origin != *myCurrEdge && edges.front() == origin) {
311  edges.insert(edges.begin(), *myCurrEdge);
312  oldSize = (int)edges.size();
313  }
314  edges.insert(edges.begin(), myRoute->begin(), myCurrEdge);
315  }
317  // re-assign stop iterators when rerouting to a new parkingArea
318  return true;
319  }
320  const RGBColor& c = myRoute->getColor();
321  MSRoute* newRoute = new MSRoute(id, edges, false, &c == &RGBColor::DEFAULT_COLOR ? nullptr : new RGBColor(c), std::vector<SUMOVehicleParameter::Stop>());
322  newRoute->setCosts(cost);
323  newRoute->setSavings(savings);
324  if (!MSRoute::dictionary(id, newRoute)) {
325  delete newRoute;
326  return false;
327  }
328 
329  std::string msg;
330  if (check && !hasValidRoute(msg, newRoute)) {
331  WRITE_WARNING("Invalid route replacement for vehicle '" + getID() + "'. " + msg);
333  newRoute->addReference();
334  newRoute->release();
335  return false;
336  }
337  }
338  if (!replaceRoute(newRoute, info, onInit, (int)edges.size() - oldSize, false, removeStops)) {
339  newRoute->addReference();
340  newRoute->release();
341  return false;
342  }
343  return true;
344 }
345 
346 
347 double
349  return 0;
350 }
351 
352 
353 double
355  return 0;
356 }
357 
358 
359 void
364 }
365 
366 
367 bool
369  return myDeparture != NOT_YET_DEPARTED;
370 }
371 
372 
373 bool
375  return succEdge(1) == nullptr;
376 }
377 
378 void
380  if (myPersonDevice == nullptr) {
382  myMoveReminders.push_back(std::make_pair(myPersonDevice, 0.));
384  const_cast<SUMOVehicleParameter*>(myParameter)->depart = MSNet::getInstance()->getCurrentTimeStep();
385  }
386  }
388 }
389 
390 void
392  if (myContainerDevice == nullptr) {
394  myMoveReminders.push_back(std::make_pair(myContainerDevice, 0.));
396  const_cast<SUMOVehicleParameter*>(myParameter)->depart = MSNet::getInstance()->getCurrentTimeStep();
397  }
398  }
400 }
401 
402 bool
403 MSBaseVehicle::hasValidRoute(std::string& msg, const MSRoute* route) const {
404  MSRouteIterator start = myCurrEdge;
405  if (route == nullptr) {
406  route = myRoute;
407  } else {
408  start = route->begin();
409  }
410  MSRouteIterator last = route->end() - 1;
411  // check connectivity, first
412  for (MSRouteIterator e = start; e != last; ++e) {
413  if ((*e)->allowedLanes(**(e + 1), myType->getVehicleClass()) == nullptr) {
414  msg = "No connection between edge '" + (*e)->getID() + "' and edge '" + (*(e + 1))->getID() + "'.";
415  return false;
416  }
417  }
418  last = route->end();
419  // check usable lanes, then
420  for (MSRouteIterator e = start; e != last; ++e) {
421  if ((*e)->prohibits(this)) {
422  msg = "Edge '" + (*e)->getID() + "' prohibits.";
423  return false;
424  }
425  }
426  return true;
427 }
428 
429 
430 void
432 #ifdef _DEBUG
433  if (myTraceMoveReminders) {
434  traceMoveReminder("add", rem, 0, true);
435  }
436 #endif
437  myMoveReminders.push_back(std::make_pair(rem, 0.));
438 }
439 
440 
441 void
443  for (MoveReminderCont::iterator r = myMoveReminders.begin(); r != myMoveReminders.end(); ++r) {
444  if (r->first == rem) {
445 #ifdef _DEBUG
446  if (myTraceMoveReminders) {
447  traceMoveReminder("remove", rem, 0, false);
448  }
449 #endif
450  myMoveReminders.erase(r);
451  return;
452  }
453  }
454 }
455 
456 
457 void
459  for (MoveReminderCont::iterator rem = myMoveReminders.begin(); rem != myMoveReminders.end();) {
460  if (rem->first->notifyEnter(*this, reason, enteredLane)) {
461 #ifdef _DEBUG
462  if (myTraceMoveReminders) {
463  traceMoveReminder("notifyEnter", rem->first, rem->second, true);
464  }
465 #endif
466  ++rem;
467  } else {
468 #ifdef _DEBUG
469  if (myTraceMoveReminders) {
470  traceMoveReminder("notifyEnter", rem->first, rem->second, false);
471  }
472 #endif
473  rem = myMoveReminders.erase(rem);
474  }
475  }
476 }
477 
478 
479 void
481  if (myRoute->getLastEdge()->isTazConnector()) {
482  return;
483  }
484  const std::vector<MSLane*>& lanes = myRoute->getLastEdge()->getLanes();
485  const double lastLaneLength = lanes[0]->getLength();
486  switch (myParameter->arrivalPosProcedure) {
487  case ARRIVAL_POS_GIVEN:
488  if (fabs(myParameter->arrivalPos) > lastLaneLength) {
489  WRITE_WARNING("Vehicle '" + getID() + "' will not be able to arrive at the given position!");
490  }
491  // Maybe we should warn the user about invalid inputs!
492  myArrivalPos = MIN2(myParameter->arrivalPos, lastLaneLength);
493  if (myArrivalPos < 0) {
494  myArrivalPos = MAX2(myArrivalPos + lastLaneLength, 0.);
495  }
496  break;
497  case ARRIVAL_POS_RANDOM:
498  myArrivalPos = RandHelper::rand(lastLaneLength);
499  break;
500  case ARRIVAL_POS_CENTER:
501  myArrivalPos = lastLaneLength / 2.;
502  break;
503  default:
504  myArrivalPos = lastLaneLength;
505  break;
506  }
508  if (myParameter->arrivalLane >= (int)lanes.size() || !lanes[myParameter->arrivalLane]->allowsVehicleClass(myType->getVehicleClass())) {
509  WRITE_WARNING("Vehicle '" + getID() + "' will not be able to arrive at the given lane '" + myRoute->getLastEdge()->getID() + "_" + toString(myParameter->arrivalLane) + "'!");
510  }
511  myArrivalLane = MIN2(myParameter->arrivalLane, (int)(lanes.size() - 1));
512  }
514  for (std::vector<MSLane*>::const_iterator l = lanes.begin(); l != lanes.end(); ++l) {
515  if (myParameter->arrivalSpeed <= (*l)->getVehicleMaxSpeed(this)) {
516  return;
517  }
518  }
519  WRITE_WARNING("Vehicle '" + getID() + "' will not be able to arrive with the given speed!");
520  }
521 }
522 
523 
524 double
526  return MAX2(0., MIN2(1., getVehicleType().getImpatience() +
528 }
529 
530 
532 MSBaseVehicle::getDevice(const std::type_info& type) const {
533  for (MSVehicleDevice* const dev : myDevices) {
534  if (typeid(*dev) == type) {
535  return dev;
536  }
537  }
538  return nullptr;
539 }
540 
541 
542 void
544  // this saves lots of departParameters which are only needed for vehicles that did not yet depart
545  // the parameters may hold the name of a vTypeDistribution but we are interested in the actual type
547  // params and stops must be written in child classes since they may wish to add additional attributes first
551  out.writeAttr(SUMO_ATTR_REROUTE, true);
552  }
553  // here starts the vehicle internal part (see loading)
554  // @note: remember to close the vehicle tag when calling this in a subclass!
555 }
556 
557 
558 void
559 MSBaseVehicle::addStops(const bool ignoreStopErrors) {
560  for (std::vector<SUMOVehicleParameter::Stop>::const_iterator i = myRoute->getStops().begin(); i != myRoute->getStops().end(); ++i) {
561  std::string errorMsg;
562  if (!addStop(*i, errorMsg, myParameter->depart) && !ignoreStopErrors) {
563  throw ProcessError(errorMsg);
564  }
565  if (errorMsg != "") {
566  WRITE_WARNING(errorMsg);
567  }
568  }
570  for (std::vector<SUMOVehicleParameter::Stop>::const_iterator i = myParameter->stops.begin(); i != myParameter->stops.end(); ++i) {
571  std::string errorMsg;
572  if (!addStop(*i, errorMsg, untilOffset) && !ignoreStopErrors) {
573  throw ProcessError(errorMsg);
574  }
575  if (errorMsg != "") {
576  WRITE_WARNING(errorMsg);
577  }
578  }
579 }
580 
581 
582 int
584  int boarded = myPersonDevice == nullptr ? 0 : myPersonDevice->size();
585  return boarded + myParameter->personNumber;
586 }
587 
588 std::vector<std::string>
590  std::vector<std::string> ret;
591  const std::vector<MSTransportable*>& persons = getPersons();
592  for (std::vector<MSTransportable*>::const_iterator it_p = persons.begin(); it_p != persons.end(); ++it_p) {
593  ret.push_back((*it_p)->getID());
594  }
595  return ret;
596 }
597 
598 int
600  int loaded = myContainerDevice == nullptr ? 0 : myContainerDevice->size();
601  return loaded + myParameter->containerNumber;
602 }
603 
604 
605 void
607  // this might be called from the MSTransportable destructor so we cannot do a dynamic cast to determine the type
608  if (myPersonDevice != nullptr) {
610  }
611  if (myContainerDevice != nullptr) {
613  }
614 }
615 
616 
617 const std::vector<MSTransportable*>&
619  if (myPersonDevice == nullptr) {
621  } else {
623  }
624 }
625 
626 
627 const std::vector<MSTransportable*>&
629  if (myContainerDevice == nullptr) {
631  } else {
633  }
634 }
635 
636 
637 
638 bool
639 MSBaseVehicle::hasDevice(const std::string& deviceName) const {
640  for (MSDevice* const dev : myDevices) {
641  if (dev->deviceName() == deviceName) {
642  return true;
643  }
644  }
645  return false;
646 }
647 
648 
649 void
650 MSBaseVehicle::createDevice(const std::string& deviceName) {
651  if (!hasDevice(deviceName)) {
652  if (deviceName == "rerouting") {
653  ((SUMOVehicleParameter*)myParameter)->setParameter("has." + deviceName + ".device", "true");
655  if (hasDeparted()) {
656  // vehicle already departed: disable pre-insertion rerouting and enable regular routing behavior
657  MSDevice_Routing* routingDevice = static_cast<MSDevice_Routing*>(getDevice(typeid(MSDevice_Routing)));
658  assert(routingDevice != 0);
659  routingDevice->notifyEnter(*this, MSMoveReminder::NOTIFICATION_DEPARTED);
660  }
661  } else {
662  throw InvalidArgument("Creating device of type '" + deviceName + "' is not supported");
663  }
664  }
665 }
666 
667 
668 std::string
669 MSBaseVehicle::getDeviceParameter(const std::string& deviceName, const std::string& key) const {
670  for (MSVehicleDevice* const dev : myDevices) {
671  if (dev->deviceName() == deviceName) {
672  return dev->getParameter(key);
673  }
674  }
675  throw InvalidArgument("No device of type '" + deviceName + "' exists");
676 }
677 
678 
679 void
680 MSBaseVehicle::setDeviceParameter(const std::string& deviceName, const std::string& key, const std::string& value) {
681  for (MSVehicleDevice* const dev : myDevices) {
682  if (dev->deviceName() == deviceName) {
683  dev->setParameter(key, value);
684  return;
685  }
686  }
687  throw InvalidArgument("No device of type '" + deviceName + "' exists");
688 }
689 
690 
691 void
693  assert(type != nullptr);
694  if (myType->isVehicleSpecific() && type != myType) {
696  }
697  myType = type;
698 }
699 
700 
703  if (myType->isVehicleSpecific()) {
704  return *myType;
705  }
706  MSVehicleType* type = myType->buildSingularType(myType->getID() + "@" + getID());
707  replaceVehicleType(type);
708  return *type;
709 }
710 
711 std::mt19937*
713  const MSLane* lane = getLane();
714  if (lane == nullptr) {
715  return getEdge()->getLanes()[0]->getRNG();
716  } else {
717  return lane->getRNG();
718  }
719 }
720 
721 #ifdef _DEBUG
722 void
723 MSBaseVehicle::initMoveReminderOutput(const OptionsCont& oc) {
724  if (oc.isSet("movereminder-output.vehicles")) {
725  const std::vector<std::string> vehicles = oc.getStringVector("movereminder-output.vehicles");
726  myShallTraceMoveReminders.insert(vehicles.begin(), vehicles.end());
727  }
728 }
729 
730 
731 void
732 MSBaseVehicle::traceMoveReminder(const std::string& type, MSMoveReminder* rem, double pos, bool keep) const {
733  OutputDevice& od = OutputDevice::getDeviceByOption("movereminder-output");
734  od.openTag("movereminder");
735  od.writeAttr(SUMO_ATTR_TIME, STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()));
736  od.writeAttr("veh", getID());
738  od.writeAttr("type", type);
739  od.writeAttr("pos", toString(pos));
740  od.writeAttr("keep", toString(keep));
741  od.closeTag();
742 }
743 #endif
744 
745 /****************************************************************************/
746 
MSRoute::checkDist
static void checkDist(const std::string &id)
Checks the distribution whether it is permanent and deletes it if not.
Definition: MSRoute.cpp:186
MSVehicleControl::vehicleDeparted
void vehicleDeparted(const SUMOVehicle &v)
Informs this control about a vehicle's departure.
Definition: MSVehicleControl.cpp:163
MSVehicleType
The car-following model and parameter.
Definition: MSVehicleType.h:66
SUMOAbstractRouter::compute
virtual bool compute(const E *from, const E *to, const V *const vehicle, SUMOTime msTime, std::vector< const E * > &into, bool silent=false)=0
Builds the route between the given edges using the minimum effort at the given time The definition of...
OptionsCont::isSet
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
Definition: OptionsCont.cpp:136
SUMOVehicleParameter::personNumber
int personNumber
The static number of persons in the vehicle when it departs (not including boarding persons)
Definition: SUMOVehicleParameter.h:644
RGBColor::DEFAULT_COLOR
static const RGBColor DEFAULT_COLOR
The default color (for vehicle types and vehicles)
Definition: RGBColor.h:204
MSDevice_Transportable::getTransportables
const std::vector< MSTransportable * > & getTransportables() const
Returns the list of transportables using this vehicle.
Definition: MSDevice_Transportable.h:135
SUMOVehicleParameter::containerNumber
int containerNumber
The static number of containers in the vehicle when it departs.
Definition: SUMOVehicleParameter.h:647
MSRoute::release
void release() const
deletes the route if there are no further references to it
Definition: MSRoute.cpp:101
MSVehicleType::buildSingularType
MSVehicleType * buildSingularType(const std::string &id) const
Duplicates the microsim vehicle type giving the newly created type the given id, marking it as vehicl...
Definition: MSVehicleType.cpp:355
SUMOTrafficObject::getWaitingTime
virtual SUMOTime getWaitingTime() const =0
ARRIVAL_POS_GIVEN
The arrival position is given.
Definition: SUMOVehicleParameter.h:228
MSBaseVehicle::getParameter
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
Definition: MSBaseVehicle.cpp:143
MSVehicleType::getID
const std::string & getID() const
Returns the name of the vehicle type.
Definition: MSVehicleType.h:94
SUMOVehicleParameter::wasSet
bool wasSet(int what) const
Returns whether the given parameter was set.
Definition: SUMOVehicleParameter.h:306
MSMoveReminder::getDescription
const std::string & getDescription() const
Definition: MSMoveReminder.h:228
MSBaseVehicle::hasDeparted
bool hasDeparted() const
Returns whether this vehicle has already departed.
Definition: MSBaseVehicle.cpp:368
MIN2
T MIN2(T a, T b)
Definition: StdDefs.h:74
SUMOVehicleParameter::parametersSet
int parametersSet
Information for the router which parameter were set, TraCI may modify this (whe changing color)
Definition: SUMOVehicleParameter.h:650
MSDevice_Routing
A device that performs vehicle rerouting based on current edge speeds.
Definition: MSDevice_Routing.h:61
WRITE_WARNING
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:239
MSBaseVehicle::getContainerNumber
int getContainerNumber() const
Returns the number of containers.
Definition: MSBaseVehicle.cpp:599
MSNet.h
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:83
MSBaseVehicle::setDeviceParameter
void setDeviceParameter(const std::string &deviceName, const std::string &key, const std::string &value)
try to set the given parameter from any of the vehicles devices, raise InvalidArgument if no device p...
Definition: MSBaseVehicle.cpp:680
SUMOVehicleParameter::arrivalSpeedProcedure
ArrivalSpeedDefinition arrivalSpeedProcedure
Information how the vehicle's end speed shall be chosen.
Definition: SUMOVehicleParameter.h:531
MSBaseVehicle::~MSBaseVehicle
virtual ~MSBaseVehicle()
Destructor.
Definition: MSBaseVehicle.cpp:124
MSBaseVehicle::MSBaseVehicle
MSBaseVehicle(SUMOVehicleParameter *pars, const MSRoute *route, MSVehicleType *type, const double speedFactor)
Constructor.
Definition: MSBaseVehicle.cpp:73
MSVehicleType::isVehicleSpecific
bool isVehicleSpecific() const
Returns whether this type belongs to a single vehicle only (was modified)
Definition: MSVehicleType.h:543
ARRIVAL_LANE_GIVEN
The arrival lane is given.
Definition: SUMOVehicleParameter.h:212
MSVehicleControl::removeVType
void removeVType(const MSVehicleType *vehType)
Definition: MSVehicleControl.cpp:306
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
ARRIVAL_POS_RANDOM
The arrival position is chosen randomly.
Definition: SUMOVehicleParameter.h:230
MSBaseVehicle::myDeparture
SUMOTime myDeparture
The real departure time.
Definition: MSBaseVehicle.h:532
MSRoute::end
MSRouteIterator end() const
Returns the end of the list of edges to pass.
Definition: MSRoute.cpp:76
MSRouteIterator
ConstMSEdgeVector::const_iterator MSRouteIterator
Definition: MSRoute.h:58
OptionsCont.h
MSBaseVehicle::myChosenSpeedFactor
double myChosenSpeedFactor
A precomputed factor by which the driver wants to be faster than the speed limit.
Definition: MSBaseVehicle.h:505
MSDevice_Transportable.h
MSBaseVehicle::myDevices
std::vector< MSVehicleDevice * > myDevices
The devices this vehicle has.
Definition: MSBaseVehicle.h:523
SUMO_ATTR_SPEEDFACTOR
Definition: SUMOXMLDefinitions.h:456
VEHPARS_FORCE_REROUTE
const int VEHPARS_FORCE_REROUTE
Definition: SUMOVehicleParameter.h:63
MsgHandler.h
SUMOVehicleParameter::repetitionOffset
SUMOTime repetitionOffset
The time offset between vehicle reinsertions.
Definition: SUMOVehicleParameter.h:544
MSBaseVehicle::getNumberReroutes
int getNumberReroutes() const
Returns the number of new routes this vehicle got.
Definition: MSBaseVehicle.h:299
MSNet::getInsertionControl
MSInsertionControl & getInsertionControl()
Returns the insertion control.
Definition: MSNet.h:390
MSRoute::getLastEdge
const MSEdge * getLastEdge() const
returns the destination edge
Definition: MSRoute.cpp:88
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:35
MSBaseVehicle::myRoute
const MSRoute * myRoute
This vehicle's route.
Definition: MSBaseVehicle.h:496
ConstMSEdgeVector
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:73
MSBaseVehicle::hasValidRoute
bool hasValidRoute(std::string &msg, const MSRoute *route=0) const
Validates the current or given route.
Definition: MSBaseVehicle.cpp:403
MSBaseVehicle::replaceParameter
void replaceParameter(const SUMOVehicleParameter *newParameter)
replace the vehicle parameter (deleting the old one)
Definition: MSBaseVehicle.cpp:148
OptionsCont::getOptions
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:58
SUMOVehicleParameter::departProcedure
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
Definition: SUMOVehicleParameter.h:479
MSBaseVehicle::myArrivalLane
int myArrivalLane
The destination lane where the vehicle stops.
Definition: MSBaseVehicle.h:541
MSRoute::setCosts
void setCosts(double costs)
Sets the costs of the route.
Definition: MSRoute.h:176
DEBUG_COND
#define DEBUG_COND
Definition: MSBaseVehicle.cpp:50
MSRoute::getEdges
const ConstMSEdgeVector & getEdges() const
Definition: MSRoute.h:121
MSBaseVehicle::getRerouteOrigin
virtual const MSEdge * getRerouteOrigin() const
Returns the starting point for reroutes (usually the current edge)
Definition: MSBaseVehicle.h:192
SUMO_ATTR_ID
Definition: SUMOXMLDefinitions.h:379
SUMOVehicleParameter
Structure representing possible vehicle parameter.
Definition: SUMOVehicleParameter.h:291
MSEdge.h
SUMOVehicle::NumericalID
long long int NumericalID
Definition: SUMOVehicle.h:63
MSTransportable
Definition: MSTransportable.h:59
MSInsertionControl.h
MSRoute::getColor
const RGBColor & getColor() const
Returns the color.
Definition: MSRoute.cpp:366
MSRoute
Definition: MSRoute.h:67
SUMOVehicleParameter::depart
SUMOTime depart
Definition: SUMOVehicleParameter.h:476
MSDevice.h
MSBaseVehicle::getMaxSpeed
double getMaxSpeed() const
Returns the maximum speed.
Definition: MSBaseVehicle.cpp:154
MSBaseVehicle::calculateArrivalParams
void calculateArrivalParams()
(Re-)Calculates the arrival position and lane from the vehicle parameters
Definition: MSBaseVehicle.cpp:480
MSMoveReminder
Something on a lane to be noticed about vehicle movement.
Definition: MSMoveReminder.h:64
OutputDevice::closeTag
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
Definition: OutputDevice.cpp:254
MSBaseVehicle::getStopEdges
virtual const ConstMSEdgeVector getStopEdges(double &firstPos, double &lastPos) const =0
Returns the list of still pending stop edges.
MSVehicleType.h
MSBaseVehicle::myParameter
const SUMOVehicleParameter * myParameter
This vehicle's parameter.
Definition: MSBaseVehicle.h:493
MSBaseVehicle::myArrivalPos
double myArrivalPos
The position on the destination lane where the vehicle stops.
Definition: MSBaseVehicle.h:538
MSBaseVehicle::getEdge
const MSEdge * getEdge() const
Returns the edge the vehicle is currently at.
Definition: MSBaseVehicle.cpp:170
MAX2
T MAX2(T a, T b)
Definition: StdDefs.h:80
SUMO_TAG_PARKING_ZONE_REROUTE
entry for an alternative parking zone
Definition: SUMOXMLDefinitions.h:199
OutputDevice::writeAttr
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:256
MSRoute::size
int size() const
Returns the number of edges to pass.
Definition: MSRoute.cpp:82
RGBColor
Definition: RGBColor.h:40
MSMoveReminder.h
MSBaseVehicle::createDevice
void createDevice(const std::string &deviceName)
create device of the given type
Definition: MSBaseVehicle.cpp:650
RandHelper::rand
static double rand(std::mt19937 *rng=0)
Returns a random real number in [0, 1)
Definition: RandHelper.h:60
MSBaseVehicle::saveState
virtual void saveState(OutputDevice &out)
Saves the (common) state of a vehicle.
Definition: MSBaseVehicle.cpp:543
SIMTIME
#define SIMTIME
Definition: SUMOTime.h:64
MSBaseVehicle::myPersonDevice
MSDevice_Transportable * myPersonDevice
The passengers this vehicle may have.
Definition: MSBaseVehicle.h:526
MSBaseVehicle::getDeviceParameter
std::string getDeviceParameter(const std::string &deviceName, const std::string &key) const
try to retrieve the given parameter from any of the vehicles devices, raise InvalidArgument if no dev...
Definition: MSBaseVehicle.cpp:669
MSBaseVehicle::getContainers
const std::vector< MSTransportable * > & getContainers() const
retrieve riding containers
Definition: MSBaseVehicle.cpp:628
StringUtils::endsWith
static bool endsWith(const std::string &str, const std::string suffix)
Checks whether a given string ends with the suffix.
Definition: StringUtils.cpp:148
SUMOVehicleParameter::arrivalLaneProcedure
ArrivalLaneDefinition arrivalLaneProcedure
Information how the vehicle shall choose the lane to arrive on.
Definition: SUMOVehicleParameter.h:513
MSBaseVehicle::getImpatience
double getImpatience() const
Returns this vehicles impatience.
Definition: MSBaseVehicle.cpp:525
SUMOAbstractRouter::computeLooped
bool computeLooped(const E *from, const E *to, const V *const vehicle, SUMOTime msTime, std::vector< const E * > &into, bool silent=false)
Builds the route between the given edges using the minimum effort at the given time if from == to,...
Definition: SUMOAbstractRouter.h:125
MSDevice::buildVehicleDevices
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
Definition: MSDevice.cpp:94
MSBaseVehicle::addPerson
virtual void addPerson(MSTransportable *person)
Adds a person to this vehicle.
Definition: MSBaseVehicle.cpp:379
MSNet::getCurrentTimeStep
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
Definition: MSNet.h:284
MSEdge::isTazConnector
bool isTazConnector() const
Definition: MSEdge.h:256
MSEdge::dictionary
static bool dictionary(const std::string &id, MSEdge *edge)
Inserts edge into the static dictionary Returns true if the key id isn't already in the dictionary....
Definition: MSEdge.cpp:804
STEPS2TIME
#define STEPS2TIME(x)
Definition: SUMOTime.h:57
SUMOVehicle::getLane
virtual MSLane * getLane() const =0
Returns the lane the vehicle is on.
SUMOVehicleParameter::id
std::string id
The vehicle's id.
Definition: SUMOVehicleParameter.h:462
SUMO_ATTR_ROUTE
Definition: SUMOXMLDefinitions.h:441
SUMOVehicle::replaceRoute
virtual bool replaceRoute(const MSRoute *route, const std::string &info, bool onInit=false, int offset=0, bool addStops=true, bool removeStops=true)=0
Replaces the current route by the given one.
MSBaseVehicle::myDepartPos
double myDepartPos
The real depart position.
Definition: MSBaseVehicle.h:535
OutputDevice.h
SUMOVehicleParameter::arrivalPos
double arrivalPos
(optional) The position the vehicle shall arrive on
Definition: SUMOVehicleParameter.h:516
SUMOVehicleParameter::fromTaz
std::string fromTaz
The vehicle's origin zone (district)
Definition: SUMOVehicleParameter.h:558
MSInsertionControl::descheduleDeparture
void descheduleDeparture(const SUMOVehicle *veh)
stops trying to emit the given vehicle (and delete it)
Definition: MSInsertionControl.cpp:272
MSDevice
Abstract in-vehicle / in-person device.
Definition: MSDevice.h:64
ProcessError
Definition: UtilExceptions.h:40
SUMOVehicleParameter::arrivalPosProcedure
ArrivalPosDefinition arrivalPosProcedure
Information how the vehicle shall choose the arrival position.
Definition: SUMOVehicleParameter.h:519
MSGlobals.h
MSDevice_Routing.h
SUMOVehicleParameter::repetitionsDone
int repetitionsDone
The number of times the vehicle was already inserted.
Definition: SUMOVehicleParameter.h:541
MSDevice_Transportable::buildVehicleDevices
static MSDevice_Transportable * buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into, const bool isContainer)
Build devices for the given vehicle, if needed.
Definition: MSDevice_Transportable.cpp:44
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:90
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:76
DEPART_TRIGGERED
The departure is person triggered.
Definition: SUMOVehicleParameter.h:98
MSBaseVehicle::getAcceleration
virtual double getAcceleration() const
Returns the vehicle's acceleration.
Definition: MSBaseVehicle.cpp:348
MSGlobals::gCheckRoutes
static bool gCheckRoutes
Definition: MSGlobals.h:79
SUMOVehicleParameter::routeid
std::string routeid
The vehicle's route id.
Definition: SUMOVehicleParameter.h:465
MSBaseVehicle::getVehicleType
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
Definition: MSBaseVehicle.h:118
MSMoveReminder::NOTIFICATION_DEPARTED
The vehicle has departed (was inserted into the network)
Definition: MSMoveReminder.h:91
MSEdge::allowedLanes
const std::vector< MSLane * > * allowedLanes(const MSEdge &destination, SUMOVehicleClass vclass=SVC_IGNORING) const
Get the allowed lanes to reach the destination-edge.
Definition: MSEdge.cpp:398
ARRIVAL_SPEED_GIVEN
The speed is given.
Definition: SUMOVehicleParameter.h:268
SUMOVehicleParameter::arrivalLane
int arrivalLane
Definition: SUMOVehicleParameter.h:510
MSDevice_Transportable::removeTransportable
void removeTransportable(MSTransportable *transportable)
Remove a passenger (TraCI)
Definition: MSDevice_Transportable.cpp:177
SUMO_TAG_VEHICLE
description of a vehicle
Definition: SUMOXMLDefinitions.h:120
SUMO_ATTR_TIME
trigger: the time of the step
Definition: SUMOXMLDefinitions.h:673
MSBaseVehicle::replaceRouteEdges
bool replaceRouteEdges(ConstMSEdgeVector &edges, double cost, double savings, const std::string &info, bool onInit=false, bool check=false, bool removeStops=true)
Replaces the current route by the given edges.
Definition: MSBaseVehicle.cpp:292
MSPerson.h
MSBaseVehicle::getSlope
virtual double getSlope() const
Returns the slope of the road at vehicle's position.
Definition: MSBaseVehicle.cpp:354
SUMOVehicleParameter::write
void write(OutputDevice &dev, const OptionsCont &oc, const SumoXMLTag tag=SUMO_TAG_VEHICLE, const std::string &typeID="") const
Writes the parameters as a beginning element.
Definition: SUMOVehicleParameter.cpp:66
MSDevice_Routing::notifyEnter
bool notifyEnter(SUMOTrafficObject &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Computes a new route on vehicle insertion.
Definition: MSDevice_Routing.cpp:165
SUMOAbstractRouter< MSEdge, SUMOVehicle >
MSBaseVehicle::addStops
void addStops(const bool ignoreStopErrors)
Adds stops to the built vehicle.
Definition: MSBaseVehicle.cpp:559
MSGlobals::gTimeToImpatience
static SUMOTime gTimeToImpatience
Definition: MSGlobals.h:66
OutputDevice::openTag
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
Definition: OutputDevice.cpp:240
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
MSBaseVehicle::getPersonIDList
std::vector< std::string > getPersonIDList() const
Returns the list of persons.
Definition: MSBaseVehicle.cpp:589
MSNet::getInstance
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:168
MSBaseVehicle::myCurrEdge
MSRouteIterator myCurrEdge
Iterator to current route-edge.
Definition: MSBaseVehicle.h:502
MSDevice_Transportable::addTransportable
void addTransportable(MSTransportable *transportable)
Add a passenger.
Definition: MSDevice_Transportable.cpp:164
SUMOVehicleParameter::via
std::vector< std::string > via
List of the via-edges the vehicle must visit.
Definition: SUMOVehicleParameter.h:641
MSBaseVehicle::myEmptyTransportableVector
static std::vector< MSTransportable * > myEmptyTransportableVector
Definition: MSBaseVehicle.h:551
MSBaseVehicle::hasDevice
bool hasDevice(const std::string &deviceName) const
check whether the vehicle is equiped with a device of the given type
Definition: MSBaseVehicle.cpp:639
MSDevice_Transportable::size
int size() const
Return the number of passengers / containers.
Definition: MSDevice_Transportable.h:127
SUMO_ATTR_REROUTE
Definition: SUMOXMLDefinitions.h:646
SUMOAbstractRouter::recomputeCosts
double recomputeCosts(const std::vector< const E * > &edges, const V *const v, SUMOTime msTime, double *lengthp=nullptr) const
Definition: SUMOAbstractRouter.h:189
InvalidArgument
Definition: UtilExceptions.h:57
MSTransportable.h
MSBaseVehicle::getPersons
const std::vector< MSTransportable * > & getPersons() const
retrieve riding persons
Definition: MSBaseVehicle.cpp:618
SUMOVehicle::addStop
virtual bool addStop(const SUMOVehicleParameter::Stop &stopPar, std::string &errorMsg, SUMOTime untilOffset=0, bool collision=false, ConstMSEdgeVector::const_iterator *searchStart=0)=0
Adds a stop.
MSBaseVehicle::succEdge
const MSEdge * succEdge(int nSuccs) const
Returns the nSuccs'th successor of edge the vehicle is currently at.
Definition: MSBaseVehicle.cpp:160
MSBaseVehicle::getVClass
SUMOVehicleClass getVClass() const
Returns the vehicle's access class.
Definition: MSBaseVehicle.h:126
MSBaseVehicle::getSingularType
MSVehicleType & getSingularType()
Replaces the current vehicle type with a new one used by this vehicle only.
Definition: MSBaseVehicle.cpp:702
MSBaseVehicle::getPersonNumber
int getPersonNumber() const
Returns the number of persons.
Definition: MSBaseVehicle.cpp:583
MSRoute::getStops
const std::vector< SUMOVehicleParameter::Stop > & getStops() const
Returns the stops.
Definition: MSRoute.cpp:375
MSBaseVehicle::getID
const std::string & getID() const
Returns the name of the vehicle.
Definition: MSBaseVehicle.cpp:137
MSBaseVehicle::hasArrived
virtual bool hasArrived() const
Returns whether this vehicle has already arived (by default this is true if the vehicle has reached i...
Definition: MSBaseVehicle.cpp:374
MSEdge::getLanes
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
Definition: MSEdge.h:165
MSBaseVehicle::addReminder
void addReminder(MSMoveReminder *rem)
Adds a MoveReminder dynamically.
Definition: MSBaseVehicle.cpp:431
MSVehicleType::getMaxSpeed
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
Definition: MSVehicleType.h:162
MSRoute::begin
MSRouteIterator begin() const
Returns the begin of the list of edges to pass.
Definition: MSRoute.cpp:70
MSBaseVehicle::onDepart
void onDepart()
Called when the vehicle is inserted into the network.
Definition: MSBaseVehicle.cpp:360
MSBaseVehicle::getPreviousSpeed
double getPreviousSpeed() const
Returns the vehicle's previous speed.
Definition: MSBaseVehicle.cpp:68
MSRoute::dictionary
static bool dictionary(const std::string &id, const MSRoute *route)
Adds a route to the dictionary.
Definition: MSRoute.cpp:114
config.h
MSBaseVehicle::myCurrentNumericalIndex
static NumericalID myCurrentNumericalIndex
Definition: MSBaseVehicle.h:556
StdDefs.h
MSLane::getRNG
std::mt19937 * getRNG() const
return the associated RNG
Definition: MSLane.h:223
MSRoute::setSavings
void setSavings(double savings)
Sets the savings of the route.
Definition: MSRoute.h:183
SUMOVehicleParameter::toTaz
std::string toTaz
The vehicle's destination zone (district)
Definition: SUMOVehicleParameter.h:561
ARRIVAL_POS_CENTER
Half the road length.
Definition: SUMOVehicleParameter.h:232
MSBaseVehicle::removeReminder
void removeReminder(MSMoveReminder *rem)
Removes a MoveReminder dynamically.
Definition: MSBaseVehicle.cpp:442
SUMOTime_MAX
#define SUMOTime_MAX
Definition: SUMOTime.h:36
MSRoute::addReference
void addReference() const
increments the reference counter for the route
Definition: MSRoute.cpp:95
MSLane.h
MSBaseVehicle::removeTransportable
void removeTransportable(MSTransportable *t)
removes a person or container
Definition: MSBaseVehicle.cpp:606
MSBaseVehicle.h
SUMOTrafficObject::getPositionOnLane
virtual double getPositionOnLane() const =0
Get the vehicle's position along the lane.
MSBaseVehicle::reroute
void reroute(SUMOTime t, const std::string &info, SUMOAbstractRouter< MSEdge, SUMOVehicle > &router, const bool onInit=false, const bool withTaz=false, const bool silent=false)
Performs a rerouting using the given router.
Definition: MSBaseVehicle.cpp:176
SUMOVehicleParameter::repetitionNumber
int repetitionNumber
Definition: SUMOVehicleParameter.h:538
MSBaseVehicle::myType
MSVehicleType * myType
This vehicle's type.
Definition: MSBaseVehicle.h:499
MSVehicleType::getVehicleClass
SUMOVehicleClass getVehicleClass() const
Get this vehicle type's vehicle class.
Definition: MSVehicleType.h:185
MSDevice_Routing::buildVehicleDevices
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
Definition: MSDevice_Routing.cpp:123
SUMOVehicleParameter::stops
std::vector< Stop > stops
List of the stops the vehicle will make, TraCI may add entries here.
Definition: SUMOVehicleParameter.h:638
MSBaseVehicle::getDevice
MSVehicleDevice * getDevice(const std::type_info &type) const
Returns a device of the given type if it exists or 0.
Definition: MSBaseVehicle.cpp:532
MSBaseVehicle::NOT_YET_DEPARTED
static const SUMOTime NOT_YET_DEPARTED
Definition: MSBaseVehicle.h:549
MSBaseVehicle::myContainerDevice
MSDevice_Transportable * myContainerDevice
The containers this vehicle may have.
Definition: MSBaseVehicle.h:529
MSBaseVehicle::myMoveReminders
MoveReminderCont myMoveReminders
Currently relevant move reminders.
Definition: MSBaseVehicle.h:519
MSVehicleControl.h
MSBaseVehicle::activateReminders
virtual void activateReminders(const MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
"Activates" all current move reminder
Definition: MSBaseVehicle.cpp:458
Named::getID
const std::string & getID() const
Returns the id.
Definition: Named.h:77
MSMoveReminder::Notification
Notification
Definition of a vehicle state.
Definition: MSMoveReminder.h:89
OutputDevice::getDeviceByOption
static OutputDevice & getDeviceByOption(const std::string &name)
Returns the device described by the option.
Definition: OutputDevice.cpp:117
OptionsCont::getStringVector
std::vector< std::string > getStringVector(const std::string &name) const
Returns the list of string-vector-value of the named option (only for Option_String)
Definition: OptionsCont.cpp:921
MSNet::getVehicleControl
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Definition: MSNet.h:337
SUMOVehicleParameter::arrivalSpeed
double arrivalSpeed
(optional) The final speed of the vehicle (not used yet)
Definition: SUMOVehicleParameter.h:528
MSBaseVehicle::replaceVehicleType
void replaceVehicleType(MSVehicleType *type)
Replaces the current vehicle type by the one given.
Definition: MSBaseVehicle.cpp:692
MSBaseVehicle::getRNG
std::mt19937 * getRNG() const
Definition: MSBaseVehicle.cpp:712
MSVehicleDevice
Abstract in-vehicle device.
Definition: MSVehicleDevice.h:55
MSBaseVehicle::addContainer
virtual void addContainer(MSTransportable *container)
Adds a container to this vehicle.
Definition: MSBaseVehicle.cpp:391