SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SUMOVehicleClass.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // Definitions of SUMO vehicle classes and helper functions
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
13 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef SUMOVehicleClass_h
24 #define SUMOVehicleClass_h
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include <string>
37 #include <set>
38 #include <limits>
42 
43 // ===========================================================================
44 // enum definitions
45 // ===========================================================================
97 };
98 
99 
100 
124 
126 
127 
131  SVC_EMERGENCY = 1 << 1,
133  SVC_AUTHORITY = 1 << 2,
135  SVC_ARMY = 1 << 3,
137  SVC_VIP = 1 << 4,
139 
140 
142 
143 
145  SVC_PASSENGER = 1 << 5,
147  SVC_HOV = 1 << 6,
149  SVC_TAXI = 1 << 7,
151  SVC_BUS = 1 << 8,
153  SVC_COACH = 1 << 9,
155  SVC_DELIVERY = 1 << 10,
157  SVC_TRUCK = 1 << 11,
159  SVC_TRAILER = 1 << 12,
161  SVC_TRAM = 1 << 13,
163  SVC_RAIL_URBAN = 1 << 14,
165  SVC_RAIL = 1 << 15,
167  SVC_RAIL_ELECTRIC = 1 << 16,
168 
170  SVC_MOTORCYCLE = 1 << 17,
172  SVC_MOPED = 1 << 18,
174  SVC_BICYCLE = 1 << 19,
176  SVC_PEDESTRIAN = 1 << 20,
178  SVC_E_VEHICLE = 1 << 21,
180  SVC_CUSTOM1 = 1 << 22,
182  SVC_CUSTOM2 = 1 << 23
184 };
185 
186 extern const int SUMOVehicleClass_MAX;
188 extern std::set<std::string> deprecatedVehicleClassesSeen;
190 
191 /* @brief bitset where each bit declares whether a certain SVC may use this edge/lane
192  */
193 typedef int SVCPermissions;
194 extern const SVCPermissions SVCAll;
195 
196 
202 typedef int SUMOEmissionClass;
203 
204 
205 // ===========================================================================
206 // method declarations
207 // ===========================================================================
208 
209 // ---------------------------------------------------------------------------
210 // abstract vehicle class / purpose
211 // ---------------------------------------------------------------------------
212 /* @brief SUMOVehicleClass is meant to be OR'ed to combine information about vehicle
213  * ownership and vehicle "size" into one int.
214  * These OR'ed values cannot be translated directly into strings with toString().
215  * The names of all base values are concatenated with '|' as a separator.
216  */
217 extern std::string getVehicleClassCompoundName(int id);
218 
219 
224 extern std::string getVehicleClassNames(SVCPermissions permissions);
225 
226 
231 extern std::vector<std::string> getVehicleClassNamesList(SVCPermissions permissions);
232 
233 
239 extern SUMOVehicleClass getVehicleClassID(const std::string& name);
240 
245 extern int getVehicleClassCompoundID(const std::string& name);
246 
254 extern SVCPermissions parseVehicleClasses(const std::string& allowedS);
255 
256 
259 extern bool canParseVehicleClasses(const std::string& classes);
260 
265 extern SVCPermissions parseVehicleClasses(const std::string& allowedS, const std::string& disallowedS);
266 
267 
272 extern SVCPermissions parseVehicleClasses(const std::vector<std::string>& allowedS);
273 
274 
275 // ---------------------------------------------------------------------------
276 // vehicle shape class
277 // ---------------------------------------------------------------------------
282 extern std::string getVehicleShapeName(SUMOVehicleShape id);
283 
284 
289 extern SUMOVehicleShape getVehicleShapeID(const std::string& name);
290 
291 
296 extern bool isRailway(SVCPermissions permissions);
297 
302 extern bool isForbidden(SVCPermissions permissions);
303 
304 // ---------------------------------------------------------------------------
305 // default vehicle type parameter
306 // ---------------------------------------------------------------------------
307 extern const std::string DEFAULT_VTYPE_ID;
308 
309 extern const SUMOReal DEFAULT_VEH_PROB; // !!! does this belong here?
310 
312 
313 #endif
314 
315 /****************************************************************************/
316