22 #ifndef MSDevice_Routing_h 23 #define MSDevice_Routing_h 117 static void waitForAll();
121 static void unlock() {
122 myThreadPool.unlock();
124 static bool isParallel() {
125 return myThreadPool.size() > 0;
196 virtual ~WorkerThread() {
211 : myVehicle(v), myTime(time), myOnInit(onInit) {}
219 RoutingTask&
operator=(
const RoutingTask&);
SUMOTime myPeriod
The period with which a vehicle shall be rerouted.
SUMOTime mySkipRouting
The time for which routing may be skipped because we cannot be inserted.
static SUMOTime adaptEdgeEfforts(SUMOTime currentTime)
Adapt edge efforts by the current edge states.
static SUMOTime myAdaptationInterval
At which time interval the edge weights get updated.
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.
A device that performs vehicle rerouting based on current edge speeds.
Computes the shortest path through a network using the A* algorithm.
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.
SUMOTime wrappedRerouteCommandExecute(SUMOTime currentTime)
Performs rerouting after a period.
static Command * myEdgeWeightSettingCommand
The weights adaptation/overwriting command.
void skipRouting(const SUMOTime currentTime)
Labels the current time step as "unroutable".
Base (microsim) event class.
A road/street connecting two junctions.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_Routing-options.
static bool myWithTaz
whether taz shall be used at initial rerouting
void reroute(const SUMOTime currentTime, const bool onInit=false)
initiate the rerouting, create router / thread pool on first use
Representation of a vehicle.
static std::map< std::pair< const MSEdge *, const MSEdge * >, const MSRoute * > myCachedRoutes
The container of pre-calculated routes.
MSDevice_Routing & operator=(const MSDevice_Routing &)
Invalidated assignment operator.
WrappingCommand< MSDevice_Routing > * myRerouteCommand
The (optional) command responsible for rerouting.
static bool isEnabled()
returns whether any routing actions take place
static SUMOReal getEffort(const MSEdge *const e, const SUMOVehicle *const v, SUMOReal t)
Returns the effort to pass an edge.
Abstract in-vehicle device.
static SUMOReal getAssumedSpeed(const MSEdge *edge)
return current travel speed assumption
A pool of worker threads which distributes the tasks and collects the results.
static std::vector< SUMOReal > myEdgeEfforts
The container of edge efforts.
static SUMOAbstractRouter< MSEdge, SUMOVehicle > * myRouter
The router to use.
A storage for options typed value containers)
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason)
Computes a new route on vehicle insertion.
~MSDevice_Routing()
Destructor.
static void cleanup()
deletes the router instance
Abstract superclass of a task to be run with an index to keep track of pending tasks.
A thread repeatingly calculating incoming tasks.
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
static SUMOReal myRandomizeWeightsFactor
Whether to disturb edge weights dynamically.
static SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const MSEdgeVector &prohibited=MSEdgeVector())
return the router instance
static SUMOTime myLastAdaptation
Information when the last edge weight adaptation occured.
Representation of a lane in the micro simulation.
SUMOTime preInsertionReroute(const SUMOTime currentTime)
Performs rerouting before insertion into the network.