Eclipse SUMO - Simulation of Urban MObility
MSDevice_Routing.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2007-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 /****************************************************************************/
18 // A device that performs vehicle rerouting based on current edge speeds
19 /****************************************************************************/
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <microsim/MSNet.h>
27 #include <microsim/MSLane.h>
28 #include <microsim/MSEdge.h>
29 #include <microsim/MSEdgeControl.h>
31 #include <microsim/MSGlobals.h>
38 #include "MSRoutingEngine.h"
39 #include "MSDevice_Routing.h"
40 
41 
42 // ===========================================================================
43 // method definitions
44 // ===========================================================================
45 // ---------------------------------------------------------------------------
46 // static initialisation methods
47 // ---------------------------------------------------------------------------
48 void
50  insertDefaultAssignmentOptions("rerouting", "Routing", oc);
51 
52  oc.doRegister("device.rerouting.period", new Option_String("0", "TIME"));
53  oc.addSynonyme("device.rerouting.period", "device.routing.period", true);
54  oc.addDescription("device.rerouting.period", "Routing", "The period with which the vehicle shall be rerouted");
55 
56  oc.doRegister("device.rerouting.pre-period", new Option_String("60", "TIME"));
57  oc.addSynonyme("device.rerouting.pre-period", "device.routing.pre-period", true);
58  oc.addDescription("device.rerouting.pre-period", "Routing", "The rerouting period before depart");
59 
60  oc.doRegister("device.rerouting.adaptation-weight", new Option_Float(0));
61  oc.addSynonyme("device.rerouting.adaptation-weight", "device.routing.adaptation-weight", true);
62  oc.addDescription("device.rerouting.adaptation-weight", "Routing", "The weight of prior edge weights for exponential moving average");
63 
64  oc.doRegister("device.rerouting.adaptation-steps", new Option_Integer(180));
65  oc.addSynonyme("device.rerouting.adaptation-steps", "device.routing.adaptation-steps", true);
66  oc.addDescription("device.rerouting.adaptation-steps", "Routing", "The number of steps for moving average weight of prior edge weights");
67 
68  oc.doRegister("device.rerouting.adaptation-interval", new Option_String("1", "TIME"));
69  oc.addSynonyme("device.rerouting.adaptation-interval", "device.routing.adaptation-interval", true);
70  oc.addDescription("device.rerouting.adaptation-interval", "Routing", "The interval for updating the edge weights");
71 
72  oc.doRegister("device.rerouting.with-taz", new Option_Bool(false));
73  oc.addSynonyme("device.rerouting.with-taz", "device.routing.with-taz", true);
74  oc.addSynonyme("device.rerouting.with-taz", "with-taz");
75  oc.addDescription("device.rerouting.with-taz", "Routing", "Use zones (districts) as routing start- and endpoints");
76 
77  oc.doRegister("device.rerouting.init-with-loaded-weights", new Option_Bool(false));
78  oc.addDescription("device.rerouting.init-with-loaded-weights", "Routing", "Use weight files given with option --weight-files for initializing edge weights");
79 
80  oc.doRegister("device.rerouting.threads", new Option_Integer(0));
81  oc.addDescription("device.rerouting.threads", "Routing", "The number of parallel execution threads used for rerouting");
82 
83  oc.doRegister("device.rerouting.synchronize", new Option_Bool(false));
84  oc.addDescription("device.rerouting.synchronize", "Routing", "Let rerouting happen at the same time for all vehicles");
85 
86  oc.doRegister("device.rerouting.output", new Option_FileName());
87  oc.addDescription("device.rerouting.output", "Routing", "Save adapting weights to FILE");
88 }
89 
90 
91 bool
93  bool ok = true;
94  if (!oc.isDefault("device.rerouting.adaptation-steps") && !oc.isDefault("device.rerouting.adaptation-weight")) {
95  WRITE_ERROR("Only one of the options 'device.rerouting.adaptation-steps' or 'device.rerouting.adaptation-weight' may be given.");
96  ok = false;
97  }
98  if (oc.getFloat("weights.random-factor") < 1) {
99  WRITE_ERROR("weights.random-factor cannot be less than 1");
100  ok = false;
101  }
102  if (string2time(oc.getString("device.rerouting.adaptation-interval")) < 0) {
103  WRITE_ERROR("Negative value for device.rerouting.adaptation-interval!");
104  ok = false;
105  }
106  if (oc.getFloat("device.rerouting.adaptation-weight") < 0. ||
107  oc.getFloat("device.rerouting.adaptation-weight") > 1.) {
108  WRITE_ERROR("The value for device.rerouting.adaptation-weight must be between 0 and 1!");
109  ok = false;
110  }
111 #ifndef HAVE_FOX
112  if (oc.getInt("device.rerouting.threads") > 1) {
113  WRITE_ERROR("Parallel routing is only possible when compiled with Fox.");
114  ok = false;
115  }
116 #endif
117  if (oc.getInt("threads") > 1 && oc.getInt("device.rerouting.threads") > 1 && oc.getInt("threads") != oc.getInt("device.rerouting.threads")) {
118  WRITE_WARNING("Adapting number of routing threads to number of simulation threads.");
119  }
120  return ok;
121 }
122 
123 
124 void
125 MSDevice_Routing::buildVehicleDevices(SUMOVehicle& v, std::vector<MSVehicleDevice*>& into) {
126  const OptionsCont& oc = OptionsCont::getOptions();
127  const bool equip = equippedByDefaultAssignmentOptions(oc, "rerouting", v, false);
128  if (v.getParameter().wasSet(VEHPARS_FORCE_REROUTE) || equip) {
129  // route computation is enabled
130  // for implicitly equipped vehicles (trips, flows), option probability
131  // can still be used to disable periodic rerouting after insertion for
132  // parts of the fleet
133  const SUMOTime period = equip || oc.isDefault("device.rerouting.probability") ? string2time(oc.getString("device.rerouting.period")) : 0;
134  const SUMOTime prePeriod = MAX2((SUMOTime)0, string2time(oc.getString("device.rerouting.pre-period")));
136  // build the device
137  into.push_back(new MSDevice_Routing(v, "routing_" + v.getID(), period, prePeriod));
138  }
139 }
140 
141 
142 // ---------------------------------------------------------------------------
143 // MSDevice_Routing-methods
144 // ---------------------------------------------------------------------------
145 MSDevice_Routing::MSDevice_Routing(SUMOVehicle& holder, const std::string& id,
146  SUMOTime period, SUMOTime preInsertionPeriod)
147  : MSVehicleDevice(holder, id), myPeriod(period), myPreInsertionPeriod(preInsertionPeriod), myLastRouting(-1), mySkipRouting(-1), myRerouteCommand(nullptr) {
149  // we do always a pre insertion reroute for trips to fill the best lanes of the vehicle with somehow meaningful values (especially for deaprtLane="best")
151  // if we don't update the edge weights, we might as well reroute now and hopefully use our threads better
152  const SUMOTime execTime = MSRoutingEngine::hasEdgeUpdates() ? holder.getParameter().depart : -1;
154  }
155 }
156 
157 
159  // make the rerouting command invalid if there is one
160  if (myRerouteCommand != nullptr) {
162  }
163 }
164 
165 
166 bool
169  // clean up pre depart rerouting
170  if (myRerouteCommand != nullptr) {
173  // pre-insertion rerouting was disabled. Reroute once if insertion was delayed
174  reroute(MSNet::getInstance()->getCurrentTimeStep());
175  }
176  myRerouteCommand = nullptr;
177  // build repetition trigger if routing shall be done more often
178  if (myPeriod > 0) {
181  if (OptionsCont::getOptions().getBool("device.rerouting.synchronize")) {
182  start -= start % myPeriod;
183  }
185  }
186  }
187  return false;
188 }
189 
190 
191 SUMOTime
193  if (mySkipRouting == currentTime) {
194  return DELTA_T;
195  }
196  if (myPreInsertionPeriod == 0) {
197  // the event will deschedule and destroy itself so it does not need to be stored
198  myRerouteCommand = nullptr;
199  }
200  const MSEdge* source = *myHolder.getRoute().begin();
201  const MSEdge* dest = myHolder.getRoute().getLastEdge();
202  if (source->isTazConnector() && dest->isTazConnector()) {
203  const MSRoute* cached = MSRoutingEngine::getCachedRoute(std::make_pair(source, dest));
204  if (cached != nullptr && cached->size() > 2) {
205  myHolder.replaceRoute(cached, "device.rerouting", true);
206  return myPreInsertionPeriod;
207  }
208  }
209  try {
210  reroute(currentTime, true);
211  } catch (ProcessError&) {
212  myRerouteCommand = nullptr;
213  throw;
214  }
215  // avoid repeated pre-insertion rerouting when the departure edge is fix and
216  // the departure lane does not depend on the route
218  myRerouteCommand = nullptr;
219  return 0;
220  }
221  return myPreInsertionPeriod;
222 }
223 
224 
225 SUMOTime
227  reroute(currentTime);
228  return myPeriod;
229 }
230 
231 
232 void
233 MSDevice_Routing::reroute(const SUMOTime currentTime, const bool onInit) {
235  //check whether the weights did change since the last reroute
237  return;
238  }
239  myLastRouting = currentTime;
240  MSRoutingEngine::reroute(myHolder, currentTime, "device.rerouting", onInit);
241 }
242 
243 
244 std::string
245 MSDevice_Routing::getParameter(const std::string& key) const {
246  if (StringUtils::startsWith(key, "edge:")) {
247  const std::string edgeID = key.substr(5);
248  const MSEdge* edge = MSEdge::dictionary(edgeID);
249  if (edge == nullptr) {
250  throw InvalidArgument("Edge '" + edgeID + "' is invalid for parameter retrieval of '" + deviceName() + "'");
251  }
252  return toString(MSRoutingEngine::getEffort(edge, &myHolder, 0));
253  } else if (key == "period") {
254  return time2string(myPeriod);
255  }
256  throw InvalidArgument("Parameter '" + key + "' is not supported for device of type '" + deviceName() + "'");
257 }
258 
259 
260 void
261 MSDevice_Routing::setParameter(const std::string& key, const std::string& value) {
262  double doubleValue;
263  try {
264  doubleValue = StringUtils::toDouble(value);
265  } catch (NumberFormatException&) {
266  throw InvalidArgument("Setting parameter '" + key + "' requires a number for device of type '" + deviceName() + "'");
267  }
268  if (StringUtils::startsWith(key, "edge:")) {
269  const std::string edgeID = key.substr(5);
270  const MSEdge* edge = MSEdge::dictionary(edgeID);
271  if (edge == nullptr) {
272  throw InvalidArgument("Edge '" + edgeID + "' is invalid for parameter setting of '" + deviceName() + "'");
273  }
274  MSRoutingEngine::setEdgeTravelTime(edge, doubleValue);
275  } else if (key == "period") {
276  const SUMOTime oldPeriod = myPeriod;
277  myPeriod = TIME2STEPS(doubleValue);
278  if (myPeriod <= 0) {
280  } else if (oldPeriod <= 0) {
281  // re-schedule routing command
283  }
284  } else {
285  throw InvalidArgument("Setting parameter '" + key + "' is not supported for device of type '" + deviceName() + "'");
286  }
287 }
288 
289 
290 void
293  out.writeAttr(SUMO_ATTR_ID, getID());
294  std::vector<std::string> internals;
295  internals.push_back(toString(myPeriod));
296  out.writeAttr(SUMO_ATTR_STATE, toString(internals));
297  out.closeTag();
298 }
299 
300 
301 void
303  std::istringstream bis(attrs.getString(SUMO_ATTR_STATE));
304  bis >> myPeriod;
305 }
306 
307 
308 /****************************************************************************/
SUMOTrafficObject
Representation of a vehicle or person.
Definition: SUMOTrafficObject.h:47
OptionsCont::getInt
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
Definition: OptionsCont.cpp:215
SUMOVehicleParameter::wasSet
bool wasSet(int what) const
Returns whether the given parameter was set.
Definition: SUMOVehicleParameter.h:312
SUMOVehicle::getDepartDelay
virtual SUMOTime getDepartDelay() const =0
MSEventControl::addEvent
virtual void addEvent(Command *operation, SUMOTime execTimeStep=-1)
Adds an Event.
Definition: MSEventControl.cpp:52
WRITE_WARNING
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:275
MSNet.h
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
Option_Bool
Definition: Option.h:538
SUMOSAXAttributes::getString
virtual std::string getString(int id) const =0
Returns the string-value of the named (by its enum-value) attribute.
SUMOVehicle::getParameter
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle's parameter (including departure definition)
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:63
DELTA_T
SUMOTime DELTA_T
Definition: SUMOTime.cpp:36
MSRoutingEngine::getLastAdaptation
static SUMOTime getLastAdaptation()
Information when the last edge weight adaptation occurred.
Definition: MSRoutingEngine.h:77
OptionsCont.h
StringUtils::toDouble
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
Definition: StringUtils.cpp:345
MSNet::getBeginOfTimestepEvents
MSEventControl * getBeginOfTimestepEvents()
Returns the event control for events executed at the begin of a time step.
Definition: MSNet.h:429
SUMOTrafficObject::getID
virtual const std::string & getID() const =0
Get the vehicle's ID.
VEHPARS_FORCE_REROUTE
const int VEHPARS_FORCE_REROUTE
Definition: SUMOVehicleParameter.h:62
WrappingCommand.h
MSDevice_Routing::~MSDevice_Routing
~MSDevice_Routing()
Destructor.
Definition: MSDevice_Routing.cpp:158
OptionsCont::getString
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
Definition: OptionsCont.cpp:201
WrappingCommand::deschedule
void deschedule()
Marks this Command as being descheduled.
Definition: WrappingCommand.h:78
MSDevice_Routing::deviceName
const std::string deviceName() const
return the name for this type of device
Definition: MSDevice_Routing.h:121
DEPART_LANE_BEST_FREE
@ DEPART_LANE_BEST_FREE
The least occupied lane from best lanes.
Definition: SUMOVehicleParameter.h:128
MSRoute::getLastEdge
const MSEdge * getLastEdge() const
returns the destination edge
Definition: MSRoute.cpp:87
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
SUMOVehicle
Representation of a vehicle.
Definition: SUMOVehicle.h:60
WrappingCommand< MSDevice_Routing >
MSDevice_Routing::myLastRouting
SUMOTime myLastRouting
The last time a routing took place.
Definition: MSDevice_Routing.h:213
MSDevice_Routing::myRerouteCommand
WrappingCommand< MSDevice_Routing > * myRerouteCommand
The (optional) command responsible for rerouting.
Definition: MSDevice_Routing.h:219
OptionsCont::getOptions
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:57
SUMO_ATTR_ID
@ SUMO_ATTR_ID
Definition: SUMOXMLDefinitions.h:378
MSEdge.h
MSVehicleDevice::myHolder
SUMOVehicle & myHolder
The vehicle that stores the device.
Definition: MSVehicleDevice.h:84
MSRoute
Definition: MSRoute.h:66
MSRoutingEngine::setEdgeTravelTime
static void setEdgeTravelTime(const MSEdge *const edge, const double travelTime)
adapt the known travel time for an edge
Definition: MSRoutingEngine.cpp:301
SUMOVehicleParameter::depart
SUMOTime depart
Definition: SUMOVehicleParameter.h:482
OutputDevice::closeTag
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
Definition: OutputDevice.cpp:253
MAX2
T MAX2(T a, T b)
Definition: StdDefs.h:79
NumberFormatException
Definition: UtilExceptions.h:95
SUMOVehicle::getRoute
virtual const MSRoute & getRoute() const =0
Returns the current route.
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
MSDevice_Routing::checkOptions
static bool checkOptions(OptionsCont &oc)
checks MSDevice_Routing-options
Definition: MSDevice_Routing.cpp:92
MSRoutingEngine::initEdgeWeights
static void initEdgeWeights()
initialize the edge weights if not done before
Definition: MSRoutingEngine.cpp:93
OptionsCont::addDescription
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
Definition: OptionsCont.cpp:469
MSRoutingEngine::getEffort
static double getEffort(const MSEdge *const e, const SUMOVehicle *const v, double t)
Returns the effort to pass an edge.
Definition: MSRoutingEngine.cpp:123
MSRoutingEngine::reroute
static void reroute(SUMOVehicle &vehicle, const SUMOTime currentTime, const std::string &info, const bool onInit=false, const bool silent=false, const MSEdgeVector &prohibited=MSEdgeVector())
initiate the rerouting, create router / thread pool on first use
Definition: MSRoutingEngine.cpp:269
MSDevice::insertDefaultAssignmentOptions
static void insertDefaultAssignmentOptions(const std::string &deviceName, const std::string &optionsTopic, OptionsCont &oc, const bool isPerson=false)
Adds common command options that allow to assign devices to vehicles.
Definition: MSDevice.cpp:126
TIME2STEPS
#define TIME2STEPS(x)
Definition: SUMOTime.h:58
OptionsCont::addSynonyme
void addSynonyme(const std::string &name1, const std::string &name2, bool isDeprecated=false)
Adds a synonyme for an options name (any order)
Definition: OptionsCont.cpp:95
MSDevice_Routing::saveState
void saveState(OutputDevice &out) const
Saves the state of the device.
Definition: MSDevice_Routing.cpp:291
MSNet::getCurrentTimeStep
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
Definition: MSNet.h:283
MSDevice_Routing::setParameter
void setParameter(const std::string &key, const std::string &value)
try to set the given parameter for this device. Throw exception for unsupported key
Definition: MSDevice_Routing.cpp:261
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
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.
MSDevice_Routing::wrappedRerouteCommandExecute
SUMOTime wrappedRerouteCommandExecute(SUMOTime currentTime)
Performs rerouting after a period.
Definition: MSDevice_Routing.cpp:226
OptionsCont::doRegister
void doRegister(const std::string &name, Option *v)
Adds an option under the given name.
Definition: OptionsCont.cpp:74
ProcessError
Definition: UtilExceptions.h:39
SUMO_TAG_DEVICE
@ SUMO_TAG_DEVICE
Definition: SUMOXMLDefinitions.h:271
time2string
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:67
Option_String
Definition: Option.h:399
StaticCommand.h
MSGlobals.h
MSDevice_Routing.h
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:78
StringUtils::startsWith
static bool startsWith(const std::string &str, const std::string prefix)
Checks whether a given string starts with the prefix.
Definition: StringUtils.cpp:174
MSMoveReminder::NOTIFICATION_DEPARTED
@ NOTIFICATION_DEPARTED
The vehicle has departed (was inserted into the network)
Definition: MSMoveReminder.h:93
MSRoutingEngine.h
string2time
SUMOTime string2time(const std::string &r)
Definition: SUMOTime.cpp:44
MSDevice_Routing::loadState
void loadState(const SUMOSAXAttributes &attrs)
Loads the state of the device from the given description.
Definition: MSDevice_Routing.cpp:302
OptionsCont::isDefault
bool isDefault(const std::string &name) const
Returns the information whether the named option has still the default value.
Definition: OptionsCont.cpp:163
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
MSRoutingEngine::initWeightUpdate
static void initWeightUpdate()
intialize period edge weight update
Definition: MSRoutingEngine.cpp:69
MSEdgeControl.h
OptionsCont::getFloat
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
Definition: OptionsCont.cpp:208
OutputDevice::openTag
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
Definition: OutputDevice.cpp:239
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
StringUtils.h
SUMO_ATTR_STATE
@ SUMO_ATTR_STATE
The state of a link.
Definition: SUMOXMLDefinitions.h:708
SUMOVehicleParameter::departLaneProcedure
DepartLaneDefinition departLaneProcedure
Information how the vehicle shall choose the lane to depart from.
Definition: SUMOVehicleParameter.h:491
MSRoutingEngine::hasEdgeUpdates
static bool hasEdgeUpdates()
returns whether any routing actions take place
Definition: MSRoutingEngine.h:72
MSNet::getInstance
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:167
MSDevice::equippedByDefaultAssignmentOptions
static bool equippedByDefaultAssignmentOptions(const OptionsCont &oc, const std::string &deviceName, DEVICEHOLDER &v, bool outputOptionSet, const bool isPerson=false)
Determines whether a vehicle should get a certain device.
Definition: MSDevice.h:203
MSDevice_Routing::myPreInsertionPeriod
SUMOTime myPreInsertionPeriod
The period with which a vehicle shall be rerouted before insertion.
Definition: MSDevice_Routing.h:210
InvalidArgument
Definition: UtilExceptions.h:56
Option_Float
Definition: Option.h:470
MSNet::getInsertionEvents
MSEventControl * getInsertionEvents()
Returns the event control for insertion events.
Definition: MSNet.h:449
MSDevice_Routing::insertOptions
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_Routing-options.
Definition: MSDevice_Routing.cpp:49
MSDevice_Routing::myPeriod
SUMOTime myPeriod
The period with which a vehicle shall be rerouted.
Definition: MSDevice_Routing.h:207
SUMOSAXAttributes.h
MSRoute::begin
MSRouteIterator begin() const
Returns the begin of the list of edges to pass.
Definition: MSRoute.cpp:69
config.h
Option_FileName
Definition: Option.h:783
MSDevice_Routing::reroute
void reroute(const SUMOTime currentTime, const bool onInit=false)
initiate the rerouting, create router / thread pool on first use
Definition: MSDevice_Routing.cpp:233
MSEventControl.h
MSLane.h
MSDevice_Routing::mySkipRouting
SUMOTime mySkipRouting
The time for which routing may be skipped because we cannot be inserted.
Definition: MSDevice_Routing.h:216
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
MSRoutingEngine::getCachedRoute
static const MSRoute * getCachedRoute(const std::pair< const MSEdge *, const MSEdge * > &key)
return the cached route or nullptr on miss
Definition: MSRoutingEngine.cpp:208
SUMOSAXAttributes
Encapsulated SAX-Attributes.
Definition: SUMOSAXAttributes.h:56
MSVehicleControl.h
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
Option_Integer
An integer-option.
Definition: Option.h:331
WRITE_ERROR
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:283
MSDevice_Routing::MSDevice_Routing
MSDevice_Routing(SUMOVehicle &holder, const std::string &id, SUMOTime period, SUMOTime preInsertionPeriod)
Constructor.
Definition: MSDevice_Routing.cpp:145
MSDevice_Routing::getParameter
std::string getParameter(const std::string &key) const
try to retrieve the given parameter from this device. Throw exception for unsupported key
Definition: MSDevice_Routing.cpp:245
MSDevice_Routing::preInsertionReroute
SUMOTime preInsertionReroute(const SUMOTime currentTime)
Performs rerouting before insertion into the network.
Definition: MSDevice_Routing.cpp:192
MSVehicleDevice
Abstract in-vehicle device.
Definition: MSVehicleDevice.h:54