SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSDevice_Routing.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // A device that performs vehicle rerouting based on current edge speeds
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef MSDevice_Routing_h
22 #define MSDevice_Routing_h
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 <set>
35 #include <vector>
36 #include <map>
37 #include <utils/common/SUMOTime.h>
40 #include <microsim/MSVehicle.h>
41 #include "MSDevice.h"
42 
43 
44 // ===========================================================================
45 // class declarations
46 // ===========================================================================
47 class MSLane;
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
70 class MSDevice_Routing : public MSDevice {
71 public:
75  static void insertOptions(OptionsCont& oc);
76 
77 
95  static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*>& into);
96 
97 
99  static void cleanup();
100 
101 
102 
103 public:
106 
107 
108 
111 
132 
133 
134 private:
142  MSDevice_Routing(SUMOVehicle& holder, const std::string& id, SUMOTime period, SUMOTime preInsertionPeriod);
143 
144 
157 
158 
174 
175 
190  static SUMOReal getEffort(const MSEdge* const e, const SUMOVehicle* const v, SUMOReal t);
191 
192 
193 
196 
208  static SUMOTime adaptEdgeEfforts(SUMOTime currentTime);
210 
211 
212 
215 
216 
217 
218 private:
221 
224 
227 
230 
232  static std::map<const MSEdge*, SUMOReal> myEdgeEfforts;
233 
236 
239 
241  static bool myWithTaz;
242 
244  static std::map<std::pair<const MSEdge*, const MSEdge*>, const MSRoute*> myCachedRoutes;
245 
248 
249 
250 private:
253 
256 
257 
258 };
259 
260 
261 #endif
262 
263 /****************************************************************************/
264 
SUMOTime myPeriod
The period with which a vehicle shall be rerouted.
static SUMOTime adaptEdgeEfforts(SUMOTime currentTime)
Adapt edge efforts by the current edge states.
static SUMOTime myAdaptationInterval
Information which weight prior edge efforts have.
MSDevice_Routing(SUMOVehicle &holder, const std::string &id, SUMOTime period, SUMOTime preInsertionPeriod)
Constructor.
SUMOTime preInsertionReroute(SUMOTime currentTime)
Performs rerouting at insertion into the network.
Notification
Definition of a vehicle state.
A device that performs vehicle rerouting based on current edge speeds.
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.
Base (microsim) event class.
Definition: Command.h:61
static std::map< const MSEdge *, SUMOReal > myEdgeEfforts
The container of edge efforts.
A road/street connecting two junctions.
Definition: MSEdge.h:73
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_Routing-options.
static bool myWithTaz
whether taz shall be used at initial rerouting
Representation of a vehicle.
Definition: SUMOVehicle.h:63
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 SUMOReal getEffort(const MSEdge *const e, const SUMOVehicle *const v, SUMOReal t)
Returns the effort to pass an edge.
Abstract in-vehicle device.
Definition: MSDevice.h:68
static SUMOAbstractRouter< MSEdge, SUMOVehicle > * myRouter
The router to use.
A storage for options typed value containers)
Definition: OptionsCont.h:108
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason)
Computes a new route on vehicle insertion.
~MSDevice_Routing()
Destructor.
static void cleanup()
deletes the router instance
#define SUMOReal
Definition: config.h:215
static SUMOReal myAdaptationWeight
Information which weight prior edge efforts have.
static SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouter()
get the router, initialize on first use
Representation of a lane in the micro simulation.
Definition: MSLane.h:77