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-2013 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 = 256,
158  SVC_TAXI = 512,
160  SVC_BUS = 1024,
162  SVC_DELIVERY = 2048,
168  SVC_CITYRAIL = 16384,
170  SVC_RAIL_SLOW = 32768,
172  SVC_RAIL_FAST = 65536,
173 
175  SVC_MOTORCYCLE = 131072,
177  SVC_BICYCLE = 262144,
179  SVC_PEDESTRIAN = 524288
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 
301 
302 
303 // ===========================================================================
304 // method declarations
305 // ===========================================================================
306 
307 // ---------------------------------------------------------------------------
308 // abstract vehicle class / purpose
309 // ---------------------------------------------------------------------------
310 /* @brief SUMOVehicleClass is meant to be OR'ed to combine information about vehicle
311  * ownership and vehicle "size" into one int.
312  * These OR'ed values cannot be translated directly into strings with toString().
313  * The names of all base values are concatenated with '|' as a separator.
314  */
315 extern std::string getVehicleClassCompoundName(int id);
316 
317 
322 extern std::string getAllowedVehicleClassNames(SVCPermissions permissions);
323 
324 
329 extern std::vector<std::string> getAllowedVehicleClassNamesList(SVCPermissions permissions);
330 
335 extern std::pair<std::string, bool> getPermissionEncoding(SVCPermissions permissions);
336 
337 
343 extern SUMOVehicleClass getVehicleClassID(const std::string& name);
344 
349 extern int getVehicleClassCompoundID(const std::string& name);
350 
357 extern SVCPermissions parseVehicleClasses(const std::string& allowedS);
358 
359 
362 extern bool canParseVehicleClasses(const std::string& classes);
363 
373 extern SVCPermissions parseVehicleClasses(const std::string& allowedS, const std::string& disallowedS);
374 
375 
379 extern SVCPermissions parseVehicleClasses(const std::vector<std::string>& allowedS);
380 
381 
382 // ---------------------------------------------------------------------------
383 // vehicle shape class
384 // ---------------------------------------------------------------------------
389 extern std::string getVehicleShapeName(SUMOVehicleShape id);
390 
391 
396 extern SUMOVehicleShape getVehicleShapeID(const std::string& name);
397 
398 
399 // ---------------------------------------------------------------------------
400 // emission class
401 // ---------------------------------------------------------------------------
406 extern std::string getVehicleEmissionTypeName(SUMOEmissionClass id);
407 
408 
413 extern SUMOEmissionClass getVehicleEmissionTypeID(const std::string& name);
414 
415 
420 extern bool isRailway(SVCPermissions permissions);
421 
422 
423 // ---------------------------------------------------------------------------
424 // default vehicle type parameter
425 // ---------------------------------------------------------------------------
426 extern const std::string DEFAULT_VTYPE_ID;
427 extern const SUMOReal DEFAULT_VEH_MAXSPEED;
428 extern const SUMOReal DEFAULT_VEH_ACCEL;
429 extern const SUMOReal DEFAULT_VEH_DECEL;
430 extern const SUMOReal DEFAULT_VEH_SIGMA;
431 extern const SUMOReal DEFAULT_VEH_LENGTH;
432 extern const SUMOReal DEFAULT_VEH_MINGAP;
433 extern const SUMOReal DEFAULT_VEH_TAU;
435 extern const SUMOReal DEFAULT_VEH_PROB;
436 extern const SUMOReal DEFAULT_VEH_SPEEDFACTOR;
437 extern const SUMOReal DEFAULT_VEH_SPEEDDEV;
438 extern const SUMOReal DEFAULT_VEH_WIDTH;
439 extern const SUMOReal DEFAULT_VEH_HEIGHT;
441 extern const std::string DEFAULT_VEH_LANE_CHANGE_MODEL;
443 extern const SUMOReal DEFAULT_VEH_TMP1;
444 extern const SUMOReal DEFAULT_VEH_TMP2;
445 extern const SUMOReal DEFAULT_VEH_TMP3;
446 extern const SUMOReal DEFAULT_VEH_TMP4;
447 extern const SUMOReal DEFAULT_VEH_TMP5;
448 
449 extern const SUMOReal DEFAULT_PERSON_SPEED;
450 
451 #endif
452 
453 /****************************************************************************/
454