19 #ifndef MSRoutingEngine_h 20 #define MSRoutingEngine_h 123 static void waitForAll();
127 static void unlock() {
128 myThreadPool.unlock();
130 static bool isParallel() {
131 return myThreadPool.size() > 0;
150 virtual ~WorkerThread() {
165 : myVehicle(v), myTime(time), myOnInit(onInit) {}
173 RoutingTask&
operator=(
const RoutingTask&);
static void setEdgeTravelTime(const MSEdge *const edge, const double travelTime)
adapt the known travel time for an edge
static SUMOTime myLastAdaptation
Information when the last edge weight adaptation occurred.
static int myAdaptationSteps
The number of steps for averaging edge speeds (ring-buffer)
static SUMOTime myAdaptationInterval
At which time interval the edge weights get updated.
static int myAdaptationStepsIndex
The current index in the pastEdgeSpeed ring-buffer.
static AStarRouter< MSEdge, SUMOVehicle, SUMOAbstractRouterPermissions< MSEdge, SUMOVehicle > > * myRouterWithProhibited
The router to use by rerouter elements.
static void initWeightUpdate()
intialize period edge weight update
Computes the shortest path through a network using the A* algorithm.
static SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const MSEdgeVector &prohibited=MSEdgeVector())
return the router instance
Base (microsim) event class.
static void initEdgeWeights()
initialize the edge weights if not done before
static SUMOTime adaptEdgeEfforts(SUMOTime currentTime)
Adapt edge efforts by the current edge states.
A road/street connecting two junctions.
static bool hasEdgeUpdates()
returns whether any routing actions take place
static const MSRoute * getCachedRoute(const std::pair< const MSEdge *, const MSEdge *> &key)
return the cached route or nullptr on miss
Representation of a vehicle.
static double myAdaptationWeight
Information which weight prior edge efforts have.
static void reroute(SUMOVehicle &vehicle, const SUMOTime currentTime, const bool onInit)
initiate the rerouting, create router / thread pool on first use
static std::vector< std::vector< double > > myPastEdgeSpeeds
The container of edge speeds.
static Command * myEdgeWeightSettingCommand
The weights adaptation/overwriting command.
static SUMOTime getLastAdaptation()
Information when the last edge weight adaptation occurred.
static double myRandomizeWeightsFactor
Whether to disturb edge weights dynamically.
MSRoutingEngine & operator=(const MSRoutingEngine &)
Invalidated assignment operator.
static std::vector< double > myEdgeSpeeds
The container of edge speeds.
A pool of worker threads which distributes the tasks and collects the results.
MSRoutingEngine(const MSRoutingEngine &)
Invalidated copy constructor.
static SUMOAbstractRouter< MSEdge, SUMOVehicle > * myRouter
The router to use.
static std::map< std::pair< const MSEdge *, const MSEdge * >, const MSRoute * > myCachedRoutes
The container of pre-calculated routes.
static double getAssumedSpeed(const MSEdge *edge)
return current travel speed assumption
static double getEffort(const MSEdge *const e, const SUMOVehicle *const v, double t)
Returns the effort to pass an edge.
static bool myWithTaz
whether taz shall be used at initial rerouting
A device that performs vehicle rerouting based on current edge speeds.
Abstract superclass of a task to be run with an index to keep track of pending tasks.
A thread repeatingly calculating incoming tasks.
static void cleanup()
deletes the router instance
std::vector< MSEdge * > MSEdgeVector
static bool isEnabled()
returns whether any routing actions take place