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.sourceforge.net/
13 // Copyright (C) 2001-2012 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 // ===========================================================================
103 };
104 
105 
106 
129 
131 
132 
144  SVC_VIP = 32,
148 
149 
151 
152 
156  SVC_HOV = 512,
158  SVC_TAXI = 1024,
160  SVC_BUS = 2048,
162  SVC_DELIVERY = 4096,
166  SVC_LIGHTRAIL = 16384,
168  SVC_CITYRAIL = 32768,
170  SVC_RAIL_SLOW = 65536,
172  SVC_RAIL_FAST = 131072,
173 
175  SVC_MOTORCYCLE = 262144,
177  SVC_BICYCLE = 524288,
179  SVC_PEDESTRIAN = 1048576
181 };
182 
183 extern const int SUMOVehicleClass_MAX;
186 
187 /* @brief bitset where each bit declares whether a certain SVC may use this edge/lane
188  */
189 typedef int SVCPermissions;
190 extern const SVCPermissions SVCFreeForAll;
191 
192 
202  // heavy duty vehicles; 3 clusters
206  // heavy duty vehicles; 6 clusters
213  // heavy duty vehicles; 12 clusters
226  // passenger & light duty vehicles; 7 clusters
234  // passenger & light duty vehicles; 14 clusters
249  // no emissions
251  // heavy duty vehicles, no accel; 3 clusters
255  // heavy duty vehicles, no accel; 6 clusters
262  // heavy duty vehicles, no accel; 12 clusters
275  // passenger & light duty vehicles, no accel; 7 clusters
283  // passenger & light duty vehicles, no accel; 14 clusters
298 };
299 
300 
301 
302 // ===========================================================================
303 // method declarations
304 // ===========================================================================
305 
306 // ---------------------------------------------------------------------------
307 // abstract vehicle class / purpose
308 // ---------------------------------------------------------------------------
309 /* @brief SUMOVehicleClass is meant to be OR'ed to combine information about vehicle
310  * ownership and vehicle "size" into one int.
311  * These OR'ed values cannot be translated directly into strings with toString().
312  * The names of all base values are concatenated with '|' as a separator.
313  */
314 extern std::string getVehicleClassCompoundName(int id);
315 
316 
321 extern std::string getAllowedVehicleClassNames(SVCPermissions permissions);
322 
323 
328 extern std::vector<std::string> getAllowedVehicleClassNamesList(SVCPermissions permissions);
329 
334 extern std::pair<std::string, bool> getPermissionEncoding(SVCPermissions permissions);
335 
336 
342 extern SUMOVehicleClass getVehicleClassID(const std::string& name);
343 
348 extern int getVehicleClassCompoundID(const std::string& name);
349 
356 extern SVCPermissions parseVehicleClasses(const std::string& allowedS);
357 
358 
361 extern bool canParseVehicleClasses(const std::string& classes);
362 
372 extern SVCPermissions parseVehicleClasses(const std::string& allowedS, const std::string& disallowedS);
373 
374 
378 extern SVCPermissions parseVehicleClasses(const std::vector<std::string>& allowedS);
379 
380 
381 // ---------------------------------------------------------------------------
382 // vehicle shape class
383 // ---------------------------------------------------------------------------
388 extern std::string getVehicleShapeName(SUMOVehicleShape id);
389 
390 
395 extern SUMOVehicleShape getVehicleShapeID(const std::string& name);
396 
397 
398 // ---------------------------------------------------------------------------
399 // emission class
400 // ---------------------------------------------------------------------------
405 extern std::string getVehicleEmissionTypeName(SUMOEmissionClass id);
406 
407 
412 extern SUMOEmissionClass getVehicleEmissionTypeID(const std::string& name);
413 
414 
419 extern bool isRailway(SVCPermissions permissions);
420 
421 
422 // ---------------------------------------------------------------------------
423 // default vehicle type parameter
424 // ---------------------------------------------------------------------------
425 extern const std::string DEFAULT_VTYPE_ID;
426 extern const SUMOReal DEFAULT_VEH_MAXSPEED;
427 extern const SUMOReal DEFAULT_VEH_ACCEL;
428 extern const SUMOReal DEFAULT_VEH_DECEL;
429 extern const SUMOReal DEFAULT_VEH_SIGMA;
430 extern const SUMOReal DEFAULT_VEH_LENGTH;
431 extern const SUMOReal DEFAULT_VEH_MINGAP;
432 extern const SUMOReal DEFAULT_VEH_TAU;
434 extern const SUMOReal DEFAULT_VEH_PROB;
435 extern const SUMOReal DEFAULT_VEH_SPEEDFACTOR;
436 extern const SUMOReal DEFAULT_VEH_SPEEDDEV;
437 extern const SUMOReal DEFAULT_VEH_WIDTH;
438 extern const SUMOReal DEFAULT_VEH_HEIGHT;
440 extern const std::string DEFAULT_VEH_LANE_CHANGE_MODEL;
442 extern const SUMOReal DEFAULT_VEH_TMP1;
443 extern const SUMOReal DEFAULT_VEH_TMP2;
444 extern const SUMOReal DEFAULT_VEH_TMP3;
445 extern const SUMOReal DEFAULT_VEH_TMP4;
446 extern const SUMOReal DEFAULT_VEH_TMP5;
447 
448 extern const SUMOReal DEFAULT_PERSON_SPEED;
449 
450 #endif
451 
452 /****************************************************************************/
453