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