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.sourceforge.net/
11 // Copyright (C) 2001-2012 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 "MSDevice.h"
38 #include <utils/common/SUMOTime.h>
39 #include <microsim/MSVehicle.h>
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 class MSLane;
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
70 class MSDevice_Routing : public MSDevice {
71 public:
74  static void insertOptions() ;
75 
76 
94  static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*> &into) ;
95 
96 
97 public:
100 
121 
122 
125 
126 
127 private:
135  MSDevice_Routing(SUMOVehicle& holder, const std::string& id, SUMOTime period,
136  SUMOTime preInsertionPeriod) ;
137 
138 
150  SUMOTime preInsertionReroute(SUMOTime currentTime) ;
151 
152 
168 
169 
184  SUMOReal getEffort(const MSEdge* const e, const SUMOVehicle* const v, SUMOReal t) const;
185 
186 
189 
201  static SUMOTime adaptEdgeEfforts(SUMOTime currentTime) ;
203 
204 
205 private:
208 
211 
214 
217 
219  static std::map<const MSEdge*, SUMOReal> myEdgeEfforts;
220 
223 
226 
228  static bool myWithTaz;
229 
231  static std::map<std::pair<const MSEdge*, const MSEdge*>, const MSRoute*> myCachedRoutes;
232 
233 
234 private:
237 
240 
241 
242 };
243 
244 
245 #endif
246 
247 /****************************************************************************/
248