Eclipse SUMO - Simulation of Urban MObility
MSRoutingEngine.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 /****************************************************************************/
19 // A device that performs vehicle rerouting based on current edge speeds
20 /****************************************************************************/
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include "MSRoutingEngine.h"
28 #include <microsim/MSNet.h>
29 #include <microsim/MSLane.h>
30 #include <microsim/MSEdge.h>
31 #include <microsim/MSEdgeControl.h>
33 #include <microsim/MSGlobals.h>
42 #include <utils/router/CHRouter.h>
44 
45 
46 // ===========================================================================
47 // static member variables
48 // ===========================================================================
49 std::vector<double> MSRoutingEngine::myEdgeSpeeds;
50 std::vector<std::vector<double> > MSRoutingEngine::myPastEdgeSpeeds;
60 std::map<std::pair<const MSEdge*, const MSEdge*>, const MSRoute*> MSRoutingEngine::myCachedRoutes;
62 #ifdef HAVE_FOX
63 FXWorkerThread::Pool MSRoutingEngine::myThreadPool;
64 #endif
65 
66 
67 // ===========================================================================
68 // method definitions
69 // ===========================================================================
70 // ---------------------------------------------------------------------------
71 // static initialisation methods
72 // ---------------------------------------------------------------------------
73 void
75  if (myAdaptationInterval == -1) {
77  myEdgeSpeeds.clear();
79  myAdaptationSteps = -1;
80  myLastAdaptation = -1;
82  myWithTaz = oc.getBool("device.rerouting.with-taz");
83  myAdaptationInterval = string2time(oc.getString("device.rerouting.adaptation-interval"));
84  myAdaptationWeight = oc.getFloat("device.rerouting.adaptation-weight");
85  const SUMOTime period = string2time(oc.getString("device.rerouting.period"));
86  if (myAdaptationWeight < 1. && myAdaptationInterval > 0) {
89  } else if (period > 0) {
90  WRITE_WARNING("Rerouting is useless if the edge weights do not get updated!");
91  }
92  OutputDevice::createDeviceByOption("device.rerouting.output", "weights", "meandata_file.xsd");
93  }
94 }
95 
96 // ---------------------------------------------------------------------------
97 // MSRoutingEngine-methods
98 // ---------------------------------------------------------------------------
99 void
101  if (myEdgeSpeeds.empty()) {
102  const OptionsCont& oc = OptionsCont::getOptions();
103  if (myAdaptationWeight == 0 || !oc.isDefault("device.rerouting.adaptation-steps")) {
104  myAdaptationSteps = oc.getInt("device.rerouting.adaptation-steps");
105  }
106  const bool useLoaded = oc.getBool("device.rerouting.init-with-loaded-weights");
107  const double currentSecond = SIMTIME;
108  for (const MSEdge* const edge : MSNet::getInstance()->getEdgeControl().getEdges()) {
109  while (edge->getNumericalID() >= (int)myEdgeSpeeds.size()) {
110  myEdgeSpeeds.push_back(0);
111  if (myAdaptationSteps > 0) {
112  myPastEdgeSpeeds.push_back(std::vector<double>());
113  }
114  }
115  if (useLoaded) {
116  myEdgeSpeeds[edge->getNumericalID()] = edge->getLength() / MSNet::getTravelTime(edge, nullptr, currentSecond);
117  } else {
118  myEdgeSpeeds[edge->getNumericalID()] = edge->getMeanSpeed();
119  }
120  if (myAdaptationSteps > 0) {
121  myPastEdgeSpeeds[edge->getNumericalID()] = std::vector<double>(myAdaptationSteps, myEdgeSpeeds[edge->getNumericalID()]);
122  }
123  }
125  }
126 }
127 
128 
129 double
130 MSRoutingEngine::getEffort(const MSEdge* const e, const SUMOVehicle* const v, double) {
131  const int id = e->getNumericalID();
132  if (id < (int)myEdgeSpeeds.size()) {
134  }
135  return 0.;
136 }
137 
138 
139 double
140 MSRoutingEngine::getEffortExtra(const MSEdge* const e, const SUMOVehicle* const v, double t) {
141  if (e->getBidiEdge() != nullptr && !e->getBidiEdge()->getLanes()[0]->isEmpty()) {
142  // using std::numeric_limits<double>::max() causing router warnings
143  return e->getLength() / NUMERICAL_EPS;
144  }
145  double effort = getEffort(e, v, t);
146  if (gWeightsRandomFactor != 1.) {
147  effort *= RandHelper::rand(1., gWeightsRandomFactor);
148  }
149  return effort;
150 }
151 
152 
153 double
155  return edge->getLength() / myEffortFunc(edge, nullptr, 0);
156 }
157 
158 
159 SUMOTime
161  initEdgeWeights();
162  if (MSNet::getInstance()->getVehicleControl().getDepartedVehicleNo() == 0) {
163  return myAdaptationInterval;
164  }
165  std::map<std::pair<const MSEdge*, const MSEdge*>, const MSRoute*>::iterator it = myCachedRoutes.begin();
166  for (; it != myCachedRoutes.end(); ++it) {
167  it->second->release();
168  }
169  myCachedRoutes.clear();
171  if (myAdaptationSteps > 0) {
172  // moving average
173  for (MSEdgeVector::const_iterator i = edges.begin(); i != edges.end(); ++i) {
174  if ((*i)->isDelayed()) {
175  const int id = (*i)->getNumericalID();
176  const double currSpeed = (*i)->getMeanSpeed();
178  myPastEdgeSpeeds[id][myAdaptationStepsIndex] = currSpeed;
179  }
180  }
182  } else {
183  // exponential moving average
184  const double newWeightFactor = (double)(1. - myAdaptationWeight);
185  for (MSEdgeVector::const_iterator i = edges.begin(); i != edges.end(); ++i) {
186  if ((*i)->isDelayed()) {
187  const int id = (*i)->getNumericalID();
188  const double currSpeed = (*i)->getMeanSpeed();
189  if (currSpeed != myEdgeSpeeds[id]) {
190  myEdgeSpeeds[id] = myEdgeSpeeds[id] * myAdaptationWeight + currSpeed * newWeightFactor;
191  }
192  }
193  }
194  }
195  myLastAdaptation = currentTime + DELTA_T; // because we run at the end of the time step
196  if (OptionsCont::getOptions().isSet("device.rerouting.output")) {
197  OutputDevice& dev = OutputDevice::getDeviceByOption("device.rerouting.output");
199  dev.writeAttr(SUMO_ATTR_ID, "device.rerouting");
200  dev.writeAttr(SUMO_ATTR_BEGIN, STEPS2TIME(currentTime));
202  for (const MSEdge* e : edges) {
203  dev.openTag(SUMO_TAG_EDGE);
204  dev.writeAttr(SUMO_ATTR_ID, e->getID());
205  dev.writeAttr("traveltime", myEffortFunc(e, nullptr, STEPS2TIME(currentTime)));
206  dev.closeTag();
207  }
208  dev.closeTag();
209  }
210  return myAdaptationInterval;
211 }
212 
213 
214 const MSRoute*
215 MSRoutingEngine::getCachedRoute(const std::pair<const MSEdge*, const MSEdge*>& key) {
216  auto routeIt = myCachedRoutes.find(key);
217  if (routeIt != myCachedRoutes.end()) {
218  return routeIt->second;
219  }
220  return nullptr;
221 }
222 
223 
224 void
225 MSRoutingEngine::reroute(SUMOVehicle& vehicle, const SUMOTime currentTime, const bool onInit) {
226 #ifdef HAVE_FOX
227  const bool needThread = (myRouter == nullptr && myThreadPool.isFull());
228 #else
229  const bool needThread = true;
230 #endif
231  if (needThread && myRouter == nullptr) {
233  const std::string routingAlgorithm = oc.getString("routing-algorithm");
234  const bool mayHaveRestrictions = MSNet::getInstance()->hasPermissions() || oc.getInt("remote-port") != 0;
238  if (routingAlgorithm == "dijkstra") {
239  if (mayHaveRestrictions) {
242  } else {
245  }
246  } else if (routingAlgorithm == "astar") {
247  if (mayHaveRestrictions) {
249  std::shared_ptr<const AStar::LookupTable> lookup;
250  if (oc.isSet("astar.all-distances")) {
251  lookup = std::make_shared<const AStar::FLT>(oc.getString("astar.all-distances"), (int)MSEdge::getAllEdges().size());
252  } else if (oc.isSet("astar.landmark-distances")) {
253  const double speedFactor = vehicle.getChosenSpeedFactor();
254  // we need an exemplary vehicle with speedFactor 1
255  vehicle.setChosenSpeedFactor(1);
258  string2time(oc.getString("begin")), string2time(oc.getString("end")), std::numeric_limits<int>::max(), 1);
259  lookup = std::make_shared<const AStar::LMLT>(oc.getString("astar.landmark-distances"), MSEdge::getAllEdges(), &router, &vehicle, "", oc.getInt("device.rerouting.threads"));
260  vehicle.setChosenSpeedFactor(speedFactor);
261  }
262  myRouter = new AStar(MSEdge::getAllEdges(), true, myEffortFunc, lookup);
263  } else {
265  std::shared_ptr<const AStar::LookupTable> lookup;
266  if (oc.isSet("astar.all-distances")) {
267  lookup = std::shared_ptr<const AStar::LookupTable> (new AStar::FLT(oc.getString("astar.all-distances"), (int)MSEdge::getAllEdges().size()));
268  } else if (oc.isSet("astar.landmark-distances")) {
269  const double speedFactor = vehicle.getChosenSpeedFactor();
270  // we need an exemplary vehicle with speedFactor 1
271  vehicle.setChosenSpeedFactor(1);
274  string2time(oc.getString("begin")), string2time(oc.getString("end")), std::numeric_limits<int>::max(), 1);
275  lookup = std::make_shared<const AStar::LMLT>(oc.getString("astar.landmark-distances"), MSEdge::getAllEdges(), &router, &vehicle, "", oc.getInt("device.rerouting.threads"));
276  vehicle.setChosenSpeedFactor(speedFactor);
277  }
278  myRouter = new AStar(MSEdge::getAllEdges(), true, myEffortFunc, lookup);
279  }
280  } else if (routingAlgorithm == "CH") {
281  const SUMOTime weightPeriod = myAdaptationInterval > 0 ? myAdaptationInterval : std::numeric_limits<int>::max();
282  if (mayHaveRestrictions) {
284  MSEdge::getAllEdges(), true, myEffortFunc, vehicle.getVClass(), weightPeriod, true);
285  } else {
287  MSEdge::getAllEdges(), true, myEffortFunc, vehicle.getVClass(), weightPeriod, false);
288  }
289  } else if (routingAlgorithm == "CHWrapper") {
290  const SUMOTime weightPeriod = myAdaptationInterval > 0 ? myAdaptationInterval : std::numeric_limits<int>::max();
293  string2time(oc.getString("begin")), string2time(oc.getString("end")), weightPeriod, oc.getInt("device.rerouting.threads"));
294  } else {
295  throw ProcessError("Unknown routing algorithm '" + routingAlgorithm + "'!");
296  }
297  }
298 #ifdef HAVE_FOX
299  if (needThread) {
300  const int numThreads = OptionsCont::getOptions().getInt("device.rerouting.threads");
301  if (myThreadPool.size() < numThreads) {
302  new WorkerThread(myThreadPool, myRouter);
303  }
304  if (myThreadPool.size() < numThreads) {
305  myRouter = nullptr;
306  }
307  }
308  if (myThreadPool.size() > 0) {
309  myThreadPool.add(new RoutingTask(vehicle, currentTime, onInit));
310  return;
311  }
312 #endif
313  vehicle.reroute(currentTime, "device.rerouting", *myRouter, onInit, myWithTaz);
314 }
315 
316 
317 void
318 MSRoutingEngine::setEdgeTravelTime(const MSEdge* const edge, const double travelTime) {
319  myEdgeSpeeds[edge->getNumericalID()] = edge->getLength() / travelTime;
320 }
321 
322 
325  if (myRouterWithProhibited == nullptr) {
327  initEdgeWeights();
333  }
334  myRouterWithProhibited->prohibit(prohibited);
335  return *myRouterWithProhibited;
336 }
337 
338 
339 void
341  delete myRouterWithProhibited;
342  myRouterWithProhibited = nullptr;
343  myAdaptationInterval = -1; // responsible for triggering initEdgeWeights
344  myPastEdgeSpeeds.clear();
345  myEdgeSpeeds.clear();
346  // @todo recheck. calling release crashes in parallel routing
347  //for (auto& item : myCachedRoutes) {
348  // item.second->release();
349  //}
350  myCachedRoutes.clear();
352 #ifdef HAVE_FOX
353  if (myThreadPool.size() > 0) {
354  // we cannot wait for the static destructor to do the cleanup
355  // because the output devices are gone by then
356  myThreadPool.clear();
357  // router deletion is done in thread destructor
358  myRouter = nullptr;
359  return;
360  }
361 #endif
362  delete myRouter;
363  myRouter = nullptr;
364 }
365 
366 
367 #ifdef HAVE_FOX
368 void
369 MSRoutingEngine::waitForAll() {
370  if (myThreadPool.size() > 0) {
371  myThreadPool.waitAll();
372  }
373 }
374 
375 
376 // ---------------------------------------------------------------------------
377 // MSRoutingEngine::RoutingTask-methods
378 // ---------------------------------------------------------------------------
379 void
380 MSRoutingEngine::RoutingTask::run(FXWorkerThread* context) {
381  myVehicle.reroute(myTime, "device.rerouting", static_cast<WorkerThread*>(context)->getRouter(), myOnInit, myWithTaz);
382  const MSEdge* source = *myVehicle.getRoute().begin();
383  const MSEdge* dest = myVehicle.getRoute().getLastEdge();
384  if (source->isTazConnector() && dest->isTazConnector()) {
385  const std::pair<const MSEdge*, const MSEdge*> key = std::make_pair(source, dest);
386  lock();
388  MSRoutingEngine::myCachedRoutes[key] = &myVehicle.getRoute();
389  myVehicle.getRoute().addReference();
390  }
391  unlock();
392  }
393 }
394 #endif
395 
396 
397 /****************************************************************************/
398 
OptionsCont::isSet
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
Definition: OptionsCont.cpp:136
MSRoutingEngine::getRouterTT
static SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const MSEdgeVector &prohibited=MSEdgeVector())
return the router instance
Definition: MSRoutingEngine.cpp:324
MSRoutingEngine::reroute
static void reroute(SUMOVehicle &vehicle, const SUMOTime currentTime, const bool onInit)
initiate the rerouting, create router / thread pool on first use
Definition: MSRoutingEngine.cpp:225
OutputDevice::createDeviceByOption
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.
Definition: OutputDevice.cpp:102
OptionsCont::getInt
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
Definition: OptionsCont.cpp:216
MSRoutingEngine::myAdaptationWeight
static double myAdaptationWeight
Information which weight prior edge efforts have.
Definition: MSRoutingEngine.h:205
MSEdge::getNumericalID
int getNumericalID() const
Returns the numerical id of the edge.
Definition: MSEdge.h:263
MSNet::hasPermissions
bool hasPermissions() const
Returns whether the network has specific vehicle class permissions.
Definition: MSNet.h:198
MSNet::hasBidiEdges
bool hasBidiEdges() const
return whether the network contains bidirectional rail edges
Definition: MSNet.h:657
MSEventControl::addEvent
virtual void addEvent(Command *operation, SUMOTime execTimeStep=-1)
Adds an Event.
Definition: MSEventControl.cpp:53
WRITE_WARNING
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:239
MSNet.h
SUMOVehicle::setChosenSpeedFactor
virtual void setChosenSpeedFactor(const double factor)=0
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
DELTA_T
SUMOTime DELTA_T
Definition: SUMOTime.cpp:35
NUMERICAL_EPS
#define NUMERICAL_EPS
Definition: config.h:145
OptionsCont.h
MSRoutingEngine::myEdgeWeightSettingCommand
static Command * myEdgeWeightSettingCommand
The weights adaptation/overwriting command.
Definition: MSRoutingEngine.h:199
MSRoutingEngine::myRouter
static SUMOAbstractRouter< MSEdge, SUMOVehicle > * myRouter
The router to use.
Definition: MSRoutingEngine.h:226
WrappingCommand.h
MSRoutingEngine::myCachedRoutes
static std::map< std::pair< const MSEdge *, const MSEdge * >, const MSRoute * > myCachedRoutes
The container of pre-calculated routes.
Definition: MSRoutingEngine.h:232
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:202
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:35
SUMOVehicle
Representation of a vehicle.
Definition: SUMOVehicle.h:61
MSRoutingEngine::getAssumedSpeed
static double getAssumedSpeed(const MSEdge *edge)
return current travel speed assumption
Definition: MSRoutingEngine.cpp:154
MSRoutingEngine::myEdgeSpeeds
static std::vector< double > myEdgeSpeeds
The container of edge speeds.
Definition: MSRoutingEngine.h:202
OptionsCont::getBool
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
Definition: OptionsCont.cpp:223
SUMOTrafficObject::getVClass
virtual SUMOVehicleClass getVClass() const =0
Returns the vehicle's access class.
OptionsCont::getOptions
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:58
SUMO_ATTR_ID
Definition: SUMOXMLDefinitions.h:379
MSEdge.h
MSRoutingEngine::adaptEdgeEfforts
static SUMOTime adaptEdgeEfforts(SUMOTime currentTime)
Adapt edge efforts by the current edge states.
Definition: MSRoutingEngine.cpp:160
MSEdge::getLength
double getLength() const
return the length of the edge
Definition: MSEdge.h:582
MSRoutingEngine::myLastAdaptation
static SUMOTime myLastAdaptation
Information when the last edge weight adaptation occurred.
Definition: MSRoutingEngine.h:211
CHRouterWrapper.h
MSRoute
Definition: MSRoute.h:67
MSRoutingEngine::setEdgeTravelTime
static void setEdgeTravelTime(const MSEdge *const edge, const double travelTime)
adapt the known travel time for an edge
Definition: MSRoutingEngine.cpp:318
DijkstraRouter
Computes the shortest path through a network using the Dijkstra algorithm.
Definition: DijkstraRouter.h:63
OutputDevice::closeTag
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
Definition: OutputDevice.cpp:254
gWeightsRandomFactor
double gWeightsRandomFactor
Definition: StdDefs.cpp:31
MSRoutingEngine::cleanup
static void cleanup()
deletes the router instance
Definition: MSRoutingEngine.cpp:340
SUMO_ATTR_BEGIN
weights: time range begin
Definition: SUMOXMLDefinitions.h:675
CHRouter.h
MAX2
T MAX2(T a, T b)
Definition: StdDefs.h:80
SUMOTrafficObject::getChosenSpeedFactor
virtual double getChosenSpeedFactor() const =0
OutputDevice::writeAttr
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:256
StaticCommand
A wrapper for a Command function.
Definition: StaticCommand.h:41
MSRoutingEngine::initEdgeWeights
static void initEdgeWeights()
initialize the edge weights if not done before
Definition: MSRoutingEngine.cpp:100
RandHelper::rand
static double rand(std::mt19937 *rng=0)
Returns a random real number in [0, 1)
Definition: RandHelper.h:60
SIMTIME
#define SIMTIME
Definition: SUMOTime.h:64
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:130
MSNet::getEndOfTimestepEvents
MSEventControl * getEndOfTimestepEvents()
Returns the event control for events executed at the end of a time step.
Definition: MSNet.h:440
AStarRouter.h
MSRoutingEngine::myAdaptationStepsIndex
static int myAdaptationStepsIndex
The current index in the pastEdgeSpeed ring-buffer.
Definition: MSRoutingEngine.h:217
MSNet::getCurrentTimeStep
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
Definition: MSNet.h:284
MSEdge::isTazConnector
bool isTazConnector() const
Definition: MSEdge.h:256
STEPS2TIME
#define STEPS2TIME(x)
Definition: SUMOTime.h:57
CHRouterWrapper
Computes the shortest path through a contracted network.
Definition: CHRouterWrapper.h:65
MSRoutingEngine::myWithTaz
static bool myWithTaz
whether taz shall be used at initial rerouting
Definition: MSRoutingEngine.h:223
SUMO_TAG_EDGE
begin/end of the description of an edge
Definition: SUMOXMLDefinitions.h:48
ProcessError
Definition: UtilExceptions.h:40
StaticCommand.h
MSGlobals.h
MSRoutingEngine::myAdaptationInterval
static SUMOTime myAdaptationInterval
At which time interval the edge weights get updated.
Definition: MSRoutingEngine.h:208
MSEdge::getBidiEdge
const MSEdge * getBidiEdge() const
return opposite superposable/congruent edge, if it exist and 0 else
Definition: MSEdge.h:247
MSEdge::getMinimumTravelTime
double getMinimumTravelTime(const SUMOVehicle *const veh) const
returns the minimum travel time for the given vehicle
Definition: MSEdge.h:419
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:90
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:76
MSRoutingEngine.h
string2time
SUMOTime string2time(const std::string &r)
Definition: SUMOTime.cpp:42
MSRoutingEngine::myPastEdgeSpeeds
static std::vector< std::vector< double > > myPastEdgeSpeeds
The container of edge speeds.
Definition: MSRoutingEngine.h:220
OptionsCont::isDefault
bool isDefault(const std::string &name) const
Returns the information whether the named option has still the default value.
Definition: OptionsCont.cpp:164
SUMOAbstractRouter< MSEdge, SUMOVehicle >
MSRoutingEngine::initWeightUpdate
static void initWeightUpdate()
intialize period edge weight update
Definition: MSRoutingEngine.cpp:74
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:209
OutputDevice::openTag
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
Definition: OutputDevice.cpp:240
StringUtils.h
MSRoutingEngine::myRouterWithProhibited
static AStarRouter< MSEdge, SUMOVehicle, SUMOAbstractRouterPermissions< MSEdge, SUMOVehicle > > * myRouterWithProhibited
The router to use by rerouter elements.
Definition: MSRoutingEngine.h:229
MSNet::getInstance
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:168
SUMOVehicle::reroute
virtual void reroute(SUMOTime t, const std::string &info, SUMOAbstractRouter< MSEdge, SUMOVehicle > &router, const bool onInit=false, const bool withTaz=false, const bool silent=false)=0
Performs a rerouting using the given router.
CHRouter
Computes the shortest path through a contracted network.
Definition: CHRouter.h:63
MSRoutingEngine::getEffortExtra
static double getEffortExtra(const MSEdge *const e, const SUMOVehicle *const v, double t)
Definition: MSRoutingEngine.cpp:140
FXWorkerThread::Pool
A pool of worker threads which distributes the tasks and collects the results.
Definition: FXWorkerThread.h:89
Command
Base (microsim) event class.
Definition: Command.h:53
MSEdgeVector
std::vector< MSEdge * > MSEdgeVector
Definition: MSEdge.h:72
AStarRouter
Computes the shortest path through a network using the A* algorithm.
Definition: AStarRouter.h:78
SUMOSAXAttributes.h
MSEdge::getLanes
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
Definition: MSEdge.h:165
MSRoutingEngine::myAdaptationSteps
static int myAdaptationSteps
The number of steps for averaging edge speeds (ring-buffer)
Definition: MSRoutingEngine.h:214
config.h
DijkstraRouter.h
SUMO_ATTR_END
weights: time range end
Definition: SUMOXMLDefinitions.h:677
SUMO_TAG_INTERVAL
an aggreagated-output interval
Definition: SUMOXMLDefinitions.h:160
MSEventControl.h
MSLane.h
SUMOAbstractRouterPermissions::prohibit
void prohibit(const std::vector< E * > &toProhibit)
Definition: SUMOAbstractRouter.h:277
MSRoutingEngine::myEffortFunc
static SUMOAbstractRouter< MSEdge, SUMOVehicle >::Operation myEffortFunc
Definition: MSRoutingEngine.h:119
MSNet::getEdgeControl
MSEdgeControl & getEdgeControl()
Returns the edge control.
Definition: MSNet.h:380
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:215
MSEdge::getAllEdges
static const MSEdgeVector & getAllEdges()
Returns all edges with a numerical id.
Definition: MSEdge.cpp:837
MSVehicleControl.h
MSNet::getTravelTime
static double getTravelTime(const MSEdge *const e, const SUMOVehicle *const v, double t)
Returns the travel time to pass an edge.
Definition: MSNet.cpp:151
OutputDevice::getDeviceByOption
static OutputDevice & getDeviceByOption(const std::string &name)
Returns the device described by the option.
Definition: OutputDevice.cpp:117
MSEdgeControl::getEdges
const MSEdgeVector & getEdges() const
Returns loaded edges.
Definition: MSEdgeControl.h:168
FXWorkerThread
A thread repeatingly calculating incoming tasks.
Definition: FXWorkerThread.h:49