SUMO - Simulation of Urban MObility
MSDevice_Routing.cpp
Go to the documentation of this file.
1 /****************************************************************************/
11 // A device that performs vehicle rerouting based on current edge speeds
12 /****************************************************************************/
13 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
14 // Copyright (C) 2007-2016 DLR (http://www.dlr.de/) and contributors
15 /****************************************************************************/
16 //
17 // This file is part of SUMO.
18 // SUMO is free software: you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation, either version 3 of the License, or
21 // (at your option) any later version.
22 //
23 /****************************************************************************/
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include "MSDevice_Routing.h"
35 #include <microsim/MSNet.h>
36 #include <microsim/MSLane.h>
37 #include <microsim/MSEdge.h>
38 #include <microsim/MSEdgeControl.h>
39 #include <microsim/MSGlobals.h>
45 #include <utils/vehicle/CHRouter.h>
47 
48 #ifdef CHECK_MEMORY_LEAKS
49 #include <foreign/nvwa/debug_new.h>
50 #endif // CHECK_MEMORY_LEAKS
51 
52 
53 // ===========================================================================
54 // static member variables
55 // ===========================================================================
56 std::vector<SUMOReal> MSDevice_Routing::myEdgeEfforts;
62 std::map<std::pair<const MSEdge*, const MSEdge*>, const MSRoute*> MSDevice_Routing::myCachedRoutes;
66 #ifdef HAVE_FOX
67 FXWorkerThread::Pool MSDevice_Routing::myThreadPool;
68 #endif
69 
70 
71 // ===========================================================================
72 // method definitions
73 // ===========================================================================
74 // ---------------------------------------------------------------------------
75 // static initialisation methods
76 // ---------------------------------------------------------------------------
77 void
79  insertDefaultAssignmentOptions("rerouting", "Routing", oc);
80 
81  oc.doRegister("device.rerouting.period", new Option_String("0", "TIME"));
82  oc.addSynonyme("device.rerouting.period", "device.routing.period", true);
83  oc.addDescription("device.rerouting.period", "Routing", "The period with which the vehicle shall be rerouted");
84 
85  oc.doRegister("device.rerouting.pre-period", new Option_String("1", "TIME"));
86  oc.addSynonyme("device.rerouting.pre-period", "device.routing.pre-period", true);
87  oc.addDescription("device.rerouting.pre-period", "Routing", "The rerouting period before depart");
88 
89  oc.doRegister("device.rerouting.adaptation-weight", new Option_Float(.5));
90  oc.addSynonyme("device.rerouting.adaptation-weight", "device.routing.adaptation-weight", true);
91  oc.addDescription("device.rerouting.adaptation-weight", "Routing", "The weight of prior edge weights");
92 
93  oc.doRegister("device.rerouting.adaptation-interval", new Option_String("1", "TIME"));
94  oc.addSynonyme("device.rerouting.adaptation-interval", "device.routing.adaptation-interval", true);
95  oc.addDescription("device.rerouting.adaptation-interval", "Routing", "The interval for updating the edge weights");
96 
97  oc.doRegister("device.rerouting.with-taz", new Option_Bool(false));
98  oc.addSynonyme("device.rerouting.with-taz", "device.routing.with-taz", true);
99  oc.addSynonyme("device.rerouting.with-taz", "with-taz");
100  oc.addDescription("device.rerouting.with-taz", "Routing", "Use zones (districts) as routing start- and endpoints");
101 
102  oc.doRegister("device.rerouting.init-with-loaded-weights", new Option_Bool(false));
103  oc.addDescription("device.rerouting.init-with-loaded-weights", "Routing", "Use given weight files for initializing edge weights");
104 
105  oc.doRegister("device.rerouting.shortest-path-file", new Option_FileName());
106  oc.addDescription("device.rerouting.shortest-path-file", "Routing", "Initialize lookup table for astar from the given distance matrix");
107 
108  oc.doRegister("device.rerouting.threads", new Option_Integer(0));
109  oc.addDescription("device.rerouting.threads", "Routing", "The number of parallel execution threads used for rerouting");
110 
111  oc.doRegister("device.rerouting.output", new Option_FileName());
112  oc.addDescription("device.rerouting.output", "Routing", "Save adapting weights to FILE");
113 
115  myEdgeEfforts.clear();
117  myLastAdaptation = -1;
118 }
119 
120 
121 void
122 MSDevice_Routing::buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*>& into) {
124  bool needRerouting = v.getParameter().wasSet(VEHPARS_FORCE_REROUTE);
125  needRerouting |= equippedByDefaultAssignmentOptions(oc, "rerouting", v);
126  if (!needRerouting && oc.getFloat("device.rerouting.probability") == 0 && !oc.isSet("device.rerouting.explicit")) {
127  // no route computation is modelled
128  return;
129  }
130  if (needRerouting) {
131  // route computation is enabled
132  myWithTaz = oc.getBool("device.rerouting.with-taz");
133  const SUMOTime period = string2time(oc.getString("device.rerouting.period"));
134  const SUMOTime prePeriod = string2time(oc.getString("device.rerouting.pre-period"));
135  // initialise edge efforts if not done before
136  if (myEdgeEfforts.size() == 0) {
138  const bool useLoaded = oc.getBool("device.rerouting.init-with-loaded-weights");
139  const SUMOReal currentSecond = SIMTIME;
140  for (MSEdgeVector::const_iterator i = edges.begin(); i != edges.end(); ++i) {
141  while ((*i)->getNumericalID() >= (int)myEdgeEfforts.size()) {
142  myEdgeEfforts.push_back(0);
143  }
144  if (useLoaded) {
145  myEdgeEfforts[(*i)->getNumericalID()] = MSNet::getTravelTime(*i, 0, currentSecond);
146  } else {
147  myEdgeEfforts[(*i)->getNumericalID()] = (*i)->getCurrentTravelTime();
148  }
149  }
151  myRandomizeWeightsFactor = oc.getFloat("weights.random-factor");
152  if (myRandomizeWeightsFactor < 1) {
153  WRITE_ERROR("weights.random-factor cannot be less than 1");
154  }
155 #ifndef HAVE_FOX
156  if (oc.getInt("device.rerouting.threads") > 1) {
157  WRITE_ERROR("Parallel routing is only possible when compiled with Fox.");
158  }
159 #endif
160  }
161  // make the weights be updated
162  if (myAdaptationInterval == -1) {
163  myAdaptationInterval = string2time(oc.getString("device.rerouting.adaptation-interval"));
164  if (myAdaptationInterval < 0) {
165  WRITE_ERROR("Negative value for device.rerouting.adaptation-interval!");
166  }
167  myAdaptationWeight = oc.getFloat("device.rerouting.adaptation-weight");
168  if (myAdaptationWeight < 0. || myAdaptationWeight > 1.) {
169  WRITE_ERROR("The value for device.rerouting.adaptation-weight must be between 0 and 1!");
170  }
171  if (myAdaptationWeight < 1. && myAdaptationInterval > 0) {
175  } else if (period > 0) {
176  WRITE_WARNING("Rerouting is useless if the edge weights do not get updated!");
177  }
178  OutputDevice::createDeviceByOption("device.rerouting.output", "weights", "meandata_file.xsd");
179  }
180  // build the device
181  into.push_back(new MSDevice_Routing(v, "routing_" + v.getID(), period, prePeriod));
182  }
183 }
184 
185 
186 // ---------------------------------------------------------------------------
187 // MSDevice_Routing-methods
188 // ---------------------------------------------------------------------------
189 MSDevice_Routing::MSDevice_Routing(SUMOVehicle& holder, const std::string& id,
190  SUMOTime period, SUMOTime preInsertionPeriod)
191  : MSDevice(holder, id), myPeriod(period), myPreInsertionPeriod(preInsertionPeriod), myLastRouting(-1), mySkipRouting(-1), myRerouteCommand(0) {
192  // we do always a pre insertion reroute to fill the best lanes of the vehicle with somehow meaningful values (especially for deaprtLane="best")
194  // if we don't update the edge weights, we might as well reroute now and hopefully use our threads better
195  const SUMOTime execTime = myEdgeWeightSettingCommand == 0 ? 0 : holder.getParameter().depart;
197  myRerouteCommand, execTime,
199 }
200 
201 
203  // make the rerouting command invalid if there is one
204  if (myRerouteCommand != 0 && MSNet::getInstance()->getInsertionEvents() != 0) {
206  }
207 }
208 
209 
210 bool
213  // clean up pre depart rerouting
214  if (myPreInsertionPeriod > 0) {
216  }
217  myRerouteCommand = 0;
218  // build repetition trigger if routing shall be done more often
219  if (myPeriod > 0) {
222  myRerouteCommand, myPeriod + MSNet::getInstance()->getCurrentTimeStep(),
224  }
225  }
226  return false;
227 }
228 
229 
230 SUMOTime
232  if (mySkipRouting == currentTime) {
233  return DELTA_T;
234  }
235  const MSEdge* source = *myHolder.getRoute().begin();
236  const MSEdge* dest = myHolder.getRoute().getLastEdge();
238  const std::pair<const MSEdge*, const MSEdge*> key = std::make_pair(source, dest);
239  if (myCachedRoutes.find(key) != myCachedRoutes.end()) {
240  if (myCachedRoutes[key]->size() > 2) {
242  return myPreInsertionPeriod;
243  } else {
244  WRITE_WARNING("No route for vehicle '" + myHolder.getID() + "' found.");
245  return myPreInsertionPeriod;
246  }
247  }
248  }
249  reroute(currentTime, true);
250  return myPreInsertionPeriod;
251 }
252 
253 
254 SUMOTime
256  reroute(currentTime);
257  return myPeriod;
258 }
259 
260 
261 SUMOReal
262 MSDevice_Routing::getEffort(const MSEdge* const e, const SUMOVehicle* const v, SUMOReal) {
263  const int id = e->getNumericalID();
264  if (id < (int)myEdgeEfforts.size()) {
265  SUMOReal effort = MAX2(myEdgeEfforts[id], e->getMinimumTravelTime(v));
266  if (myRandomizeWeightsFactor != 1) {
268  }
269  return effort;
270  }
271  return 0;
272 }
273 
274 
275 SUMOReal
277  return edge->getLength() / getEffort(edge, 0, 0);
278 }
279 
280 
281 SUMOTime
283  if (MSNet::getInstance()->getVehicleControl().getDepartedVehicleNo() == 0) {
284  return myAdaptationInterval;
285  }
286  std::map<std::pair<const MSEdge*, const MSEdge*>, const MSRoute*>::iterator it = myCachedRoutes.begin();
287  for (; it != myCachedRoutes.end(); ++it) {
288  it->second->release();
289  }
290  myCachedRoutes.clear();
291  const SUMOReal newWeightFactor = (SUMOReal)(1. - myAdaptationWeight);
293  for (MSEdgeVector::const_iterator i = edges.begin(); i != edges.end(); ++i) {
294  const int id = (*i)->getNumericalID();
295  const SUMOReal currTT = (*i)->getCurrentTravelTime();
296  if (currTT != myEdgeEfforts[id]) {
297  myEdgeEfforts[id] = myEdgeEfforts[id] * myAdaptationWeight + currTT * newWeightFactor;
298  }
299  }
300  myLastAdaptation = currentTime + DELTA_T; // because we run at the end of the time step
301  if (OptionsCont::getOptions().isSet("device.rerouting.output")) {
302  OutputDevice& dev = OutputDevice::getDeviceByOption("device.rerouting.output");
304  dev.writeAttr(SUMO_ATTR_ID, "device.rerouting");
305  dev.writeAttr(SUMO_ATTR_BEGIN, STEPS2TIME(currentTime));
307  for (MSEdgeVector::const_iterator i = edges.begin(); i != edges.end(); ++i) {
308  const int id = (*i)->getNumericalID();
309  dev.openTag(SUMO_TAG_EDGE);
310  dev.writeAttr(SUMO_ATTR_ID, (*i)->getID());
311  dev.writeAttr("traveltime", myEdgeEfforts[id]);
312  dev.closeTag();
313  }
314  dev.closeTag();
315  }
316  return myAdaptationInterval;
317 }
318 
319 
320 void
321 MSDevice_Routing::reroute(const SUMOTime currentTime, const bool onInit) {
322  //check whether the weights did change since the last reroute
324  return;
325  }
326  myLastRouting = currentTime;
327 #ifdef HAVE_FOX
328  const bool needThread = (myRouter == 0 && myThreadPool.isFull());
329 #else
330  const bool needThread = true;
331 #endif
332  if (needThread && myRouter == 0) {
334  const std::string routingAlgorithm = oc.getString("routing-algorithm");
335  const bool mayHaveRestrictions = MSNet::getInstance()->hasPermissions() || oc.getInt("remote-port") != 0;
336  if (routingAlgorithm == "dijkstra") {
337  if (mayHaveRestrictions) {
340  } else {
343  }
344  } else if (routingAlgorithm == "astar") {
345  if (mayHaveRestrictions) {
347  const AStar::LookupTable* lookup = 0;
348  if (oc.isSet("device.rerouting.shortest-path-file")) {
349  lookup = AStar::createLookupTable(oc.getString("device.rerouting.shortest-path-file"), (int)MSEdge::getAllEdges().size());
350  }
351  myRouter = new AStar(MSEdge::getAllEdges(), true, &MSDevice_Routing::getEffort, lookup);
352  } else {
354  const AStar::LookupTable* lookup = 0;
355  if (oc.isSet("device.rerouting.shortest-path-file")) {
356  lookup = AStar::createLookupTable(oc.getString("device.rerouting.shortest-path-file"), (int)MSEdge::getAllEdges().size());
357  }
358  myRouter = new AStar(MSEdge::getAllEdges(), true, &MSDevice_Routing::getEffort, lookup);
359  }
360  } else if (routingAlgorithm == "CH") {
362  if (mayHaveRestrictions) {
364  MSEdge::getAllEdges(), true, &MSDevice_Routing::getEffort, myHolder.getVClass(), weightPeriod, true);
365  } else {
367  MSEdge::getAllEdges(), true, &MSDevice_Routing::getEffort, myHolder.getVClass(), weightPeriod, false);
368  }
369  } else if (routingAlgorithm == "CHWrapper") {
370  const SUMOTime begin = string2time(oc.getString("begin"));
373  MSEdge::getAllEdges(), true, &MSDevice_Routing::getEffort, begin, weightPeriod);
374  } else {
375  throw ProcessError("Unknown routing algorithm '" + routingAlgorithm + "'!");
376  }
377  }
378 #ifdef HAVE_FOX
379  if (needThread) {
380  const int numThreads = OptionsCont::getOptions().getInt("device.rerouting.threads");
381  if (myThreadPool.size() < numThreads) {
382  new WorkerThread(myThreadPool, myRouter);
383  }
384  if (myThreadPool.size() < numThreads) {
385  myRouter = 0;
386  }
387  }
388  if (myThreadPool.size() > 0) {
389  myThreadPool.add(new RoutingTask(myHolder, currentTime, onInit));
390  return;
391  }
392 #endif
393  myHolder.reroute(currentTime, *myRouter, onInit, myWithTaz);
394 }
395 
396 
399  if (myRouterWithProhibited == 0) {
402  }
403  myRouterWithProhibited->prohibit(prohibited);
404  return *myRouterWithProhibited;
405 }
406 
407 
408 
409 void
411  delete myRouterWithProhibited;
413 #ifdef HAVE_FOX
414  if (myThreadPool.size() > 0) {
415  // we cannot wait for the static destructor to do the cleanup
416  // because the output devices are gone by then
417  myThreadPool.clear();
418  // router deletion is done in thread destructor
419  myRouter = 0;
420  return;
421  }
422 #endif
423  delete myRouter;
424  myRouter = 0;
425 }
426 
427 
428 #ifdef HAVE_FOX
429 void
430 MSDevice_Routing::waitForAll() {
431  if (myThreadPool.size() > 0) {
432  myThreadPool.waitAll();
433  }
434 }
435 
436 
437 // ---------------------------------------------------------------------------
438 // MSDevice_Routing::RoutingTask-methods
439 // ---------------------------------------------------------------------------
440 void
441 MSDevice_Routing::RoutingTask::run(FXWorkerThread* context) {
442  myVehicle.reroute(myTime, static_cast<WorkerThread*>(context)->getRouter(), myOnInit, myWithTaz);
443  const MSEdge* source = *myVehicle.getRoute().begin();
444  const MSEdge* dest = myVehicle.getRoute().getLastEdge();
446  const std::pair<const MSEdge*, const MSEdge*> key = std::make_pair(source, dest);
447  lock();
449  MSDevice_Routing::myCachedRoutes[key] = &myVehicle.getRoute();
450  myVehicle.getRoute().addReference();
451  }
452  unlock();
453  }
454 }
455 #endif
456 
457 
458 /****************************************************************************/
459 
Computes the shortest path through a contracted network.
Definition: CHRouter.h:74
SUMOTime myPeriod
The period with which a vehicle shall be rerouted.
void doRegister(const std::string &name, Option *v)
Adds an option under the given name.
Definition: OptionsCont.cpp:86
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:257
long long int SUMOTime
Definition: SUMOTime.h:43
const int VEHPARS_FORCE_REROUTE
SUMOTime mySkipRouting
The time for which routing may be skipped because we cannot be inserted.
virtual const MSRoute & getRoute() const =0
Returns the current route.
static SUMOTime adaptEdgeEfforts(SUMOTime currentTime)
Adapt edge efforts by the current edge states.
SUMOVehicle & myHolder
The vehicle that stores the device.
Definition: MSDevice.h:153
static SUMOTime myAdaptationInterval
At which time interval the edge weights get updated.
const MSEdge * getLastEdge() const
returns the destination edge
Definition: MSRoute.cpp:96
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
SUMOTime myLastRouting
The last time a routing took place.
MSDevice_Routing(SUMOVehicle &holder, const std::string &id, SUMOTime period, SUMOTime preInsertionPeriod)
Constructor.
Notification
Definition of a vehicle state.
static SUMOReal rand()
Returns a random real number in [0, 1)
Definition: RandHelper.h:62
Computes the shortest path through a network using the A* algorithm.
Definition: AStarRouter.h:71
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSDevice * > &into)
Build devices for the given vehicle, if needed.
SUMOTime myPreInsertionPeriod
The period with which a vehicle shall be rerouted before insertion.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:160
T MAX2(T a, T b)
Definition: StdDefs.h:75
SUMOTime DELTA_T
Definition: SUMOTime.cpp:39
SUMOTime wrappedRerouteCommandExecute(SUMOTime currentTime)
Performs rerouting after a period.
SUMOReal getFloat(const std::string &name) const
Returns the SUMOReal-value of the named option (only for Option_Float)
static Command * myEdgeWeightSettingCommand
The weights adaptation/overwriting command.
Base (microsim) event class.
Definition: Command.h:61
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
Definition: MSNet.h:255
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:200
Computes the shortest path through a network using the Dijkstra algorithm.
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:69
#define SIMTIME
Definition: SUMOTime.h:70
void addSynonyme(const std::string &name1, const std::string &name2, bool isDeprecated=false)
Adds a synonyme for an options name (any order)
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
A road/street connecting two junctions.
Definition: MSEdge.h:80
virtual SUMOVehicleClass getVClass() const =0
Returns the vehicle&#39;s access class.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_Routing-options.
static bool myWithTaz
whether taz shall be used at initial rerouting
SUMOReal getLength() const
return the length of the edge
Definition: MSEdge.h:562
void reroute(const SUMOTime currentTime, const bool onInit=false)
initiate the rerouting, create router / thread pool on first use
#define max(a, b)
Definition: polyfonts.c:65
The edge is a district edge.
Definition: MSEdge.h:99
Representation of a vehicle.
Definition: SUMOVehicle.h:65
bool wasSet(int what) const
Returns whether the given parameter was set.
MSEventControl * getBeginOfTimestepEvents()
Returns the event control for events executed at the begin of a time step.
Definition: MSNet.h:389
virtual void reroute(SUMOTime t, SUMOAbstractRouter< MSEdge, SUMOVehicle > &router, const bool onInit=false, const bool withTaz=false)=0
Performs a rerouting using the given router.
static SUMOReal getTravelTime(const MSEdge *const e, const SUMOVehicle *const v, SUMOReal t)
Returns the travel time to pass an edge.
Definition: MSNet.cpp:142
static std::map< std::pair< const MSEdge *, const MSEdge * >, const MSRoute * > myCachedRoutes
The container of pre-calculated routes.
SUMOTime depart
The vehicle&#39;s departure time.
#define STEPS2TIME(x)
Definition: SUMOTime.h:65
A wrapper for a Command function.
Definition: StaticCommand.h:49
SUMOTime string2time(const std::string &r)
Definition: SUMOTime.cpp:46
WrappingCommand< MSDevice_Routing > * myRerouteCommand
The (optional) command responsible for rerouting.
static void insertDefaultAssignmentOptions(const std::string &deviceName, const std::string &optionsTopic, OptionsCont &oc)
Adds common command options that allow to assign devices to vehicles.
Definition: MSDevice.cpp:86
virtual SUMOTime addEvent(Command *operation, SUMOTime execTimeStep, AdaptType type)
Adds an Event.
static SUMOReal getEffort(const MSEdge *const e, const SUMOVehicle *const v, SUMOReal t)
Returns the effort to pass an edge.
MSEventControl * getEndOfTimestepEvents()
Returns the event control for events executed at the end of a time step.
Definition: MSNet.h:399
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:206
Abstract in-vehicle device.
Definition: MSDevice.h:69
static bool equippedByDefaultAssignmentOptions(const OptionsCont &oc, const std::string &deviceName, SUMOVehicle &v)
Determines whether a vehicle should get a certain device.
Definition: MSDevice.cpp:100
static SUMOReal getAssumedSpeed(const MSEdge *edge)
return current travel speed assumption
A pool of worker threads which distributes the tasks and collects the results.
EdgeBasicFunction getPurpose() const
Returns the edge type (EdgeBasicFunction)
Definition: MSEdge.h:242
The vehicle has departed (was inserted into the network)
static std::vector< SUMOReal > myEdgeEfforts
The container of edge efforts.
An integer-option.
Definition: Option.h:313
int getNumericalID() const
Returns the numerical id of the edge.
Definition: MSEdge.h:264
void deschedule()
Marks this Command as being descheduled.
static SUMOAbstractRouter< MSEdge, SUMOVehicle > * myRouter
The router to use.
static const MSEdgeVector & getAllEdges()
Returns all edges with a numerical id.
Definition: MSEdge.cpp:611
static OutputDevice & getDeviceByOption(const std::string &name)
Returns the device described by the option.
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle&#39;s parameter (including departure definition)
A storage for options typed value containers)
Definition: OptionsCont.h:108
virtual bool replaceRoute(const MSRoute *route, bool onInit=false, int offset=0)=0
Replaces the current route by the given one.
MSEventControl * getInsertionEvents()
Returns the event control for insertion events.
Definition: MSNet.h:409
void prohibit(const std::vector< E * > &toProhibit)
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason)
Computes a new route on vehicle insertion.
static bool createDeviceByOption(const std::string &optionName, const std::string &rootElement="", const std::string &schemaFile="")
Creates the device using the output definition stored in the named option.
~MSDevice_Routing()
Destructor.
Patch the time in a way that it is at least as high as the simulation begin time. ...
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
static void cleanup()
deletes the router instance
bool closeTag()
Closes the most recently opened tag.
#define SUMOReal
Definition: config.h:213
SUMOReal getMinimumTravelTime(const SUMOVehicle *const veh) const
returns the minimum travel time for the given vehicle
Definition: MSEdge.h:437
A thread repeatingly calculating incoming tasks.
MSEdgeControl & getEdgeControl()
Returns the edge control.
Definition: MSNet.h:339
static AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > > * myRouterWithProhibited
The router to use by rerouter elements.
static SUMOReal myAdaptationWeight
Information which weight prior edge efforts have.
std::vector< MSEdge * > MSEdgeVector
Definition: MSEdge.h:77
static SUMOReal myRandomizeWeightsFactor
Whether to disturb edge weights dynamically.
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
bool hasPermissions() const
Returns whether the network has specific vehicle class permissions.
Definition: MSNet.h:175
static SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const MSEdgeVector &prohibited=MSEdgeVector())
return the router instance
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
static SUMOTime myLastAdaptation
Information when the last edge weight adaptation occured.
virtual const std::string & getID() const =0
Get the vehicle&#39;s ID.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
MSRouteIterator begin() const
Returns the begin of the list of edges to pass.
Definition: MSRoute.cpp:78
SUMOTime preInsertionReroute(const SUMOTime currentTime)
Performs rerouting before insertion into the network.
const MSEdgeVector & getEdges() const
Returns loaded edges.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
Computes the shortest path through a contracted network.