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-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  SVC_CUSTOM1 = 1048576,
183  SVC_CUSTOM2 = 2097152
185 };
186 
187 extern const int SUMOVehicleClass_MAX;
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 SVCFreeForAll;
195 
196 
206  // heavy duty vehicles; 3 clusters
210  // heavy duty vehicles; 6 clusters
217  // heavy duty vehicles; 12 clusters
230  // passenger & light duty vehicles; 7 clusters
238  // passenger & light duty vehicles; 14 clusters
253  // no emissions
255  // heavy duty vehicles, no accel; 3 clusters
259  // heavy duty vehicles, no accel; 6 clusters
266  // heavy duty vehicles, no accel; 12 clusters
279  // passenger & light duty vehicles, no accel; 7 clusters
287  // passenger & light duty vehicles, no accel; 14 clusters
302 };
303 
305 
306 
307 // ===========================================================================
308 // method declarations
309 // ===========================================================================
310 
311 // ---------------------------------------------------------------------------
312 // abstract vehicle class / purpose
313 // ---------------------------------------------------------------------------
314 /* @brief SUMOVehicleClass is meant to be OR'ed to combine information about vehicle
315  * ownership and vehicle "size" into one int.
316  * These OR'ed values cannot be translated directly into strings with toString().
317  * The names of all base values are concatenated with '|' as a separator.
318  */
319 extern std::string getVehicleClassCompoundName(int id);
320 
321 
326 extern std::string getAllowedVehicleClassNames(SVCPermissions permissions);
327 
328 
333 extern std::vector<std::string> getAllowedVehicleClassNamesList(SVCPermissions permissions);
334 
339 extern std::pair<std::string, bool> getPermissionEncoding(SVCPermissions permissions);
340 
341 
347 extern SUMOVehicleClass getVehicleClassID(const std::string& name);
348 
353 extern int getVehicleClassCompoundID(const std::string& name);
354 
361 extern SVCPermissions parseVehicleClasses(const std::string& allowedS);
362 
363 
366 extern bool canParseVehicleClasses(const std::string& classes);
367 
377 extern SVCPermissions parseVehicleClasses(const std::string& allowedS, const std::string& disallowedS);
378 
379 
383 extern SVCPermissions parseVehicleClasses(const std::vector<std::string>& allowedS);
384 
385 
386 // ---------------------------------------------------------------------------
387 // vehicle shape class
388 // ---------------------------------------------------------------------------
393 extern std::string getVehicleShapeName(SUMOVehicleShape id);
394 
395 
400 extern SUMOVehicleShape getVehicleShapeID(const std::string& name);
401 
402 
403 // ---------------------------------------------------------------------------
404 // emission class
405 // ---------------------------------------------------------------------------
410 extern std::string getVehicleEmissionTypeName(SUMOEmissionClass id);
411 
412 
417 extern SUMOEmissionClass getVehicleEmissionTypeID(const std::string& name);
418 
419 
424 extern bool isRailway(SVCPermissions permissions);
425 
426 
427 // ---------------------------------------------------------------------------
428 // default vehicle type parameter
429 // ---------------------------------------------------------------------------
430 extern const std::string DEFAULT_VTYPE_ID;
431 extern const SUMOReal DEFAULT_VEH_MAXSPEED;
432 extern const SUMOReal DEFAULT_VEH_ACCEL;
433 extern const SUMOReal DEFAULT_VEH_DECEL;
434 extern const SUMOReal DEFAULT_VEH_SIGMA;
435 extern const SUMOReal DEFAULT_VEH_LENGTH;
436 extern const SUMOReal DEFAULT_VEH_MINGAP;
437 extern const SUMOReal DEFAULT_VEH_TAU;
439 extern const SUMOReal DEFAULT_VEH_PROB;
440 extern const SUMOReal DEFAULT_VEH_SPEEDFACTOR;
441 extern const SUMOReal DEFAULT_VEH_SPEEDDEV;
442 extern const SUMOReal DEFAULT_VEH_WIDTH;
443 extern const SUMOReal DEFAULT_VEH_HEIGHT;
445 extern const std::string DEFAULT_VEH_LANE_CHANGE_MODEL;
447 extern const SUMOReal DEFAULT_VEH_TMP1;
448 extern const SUMOReal DEFAULT_VEH_TMP2;
449 extern const SUMOReal DEFAULT_VEH_TMP3;
450 extern const SUMOReal DEFAULT_VEH_TMP4;
451 extern const SUMOReal DEFAULT_VEH_TMP5;
452 
453 extern const SUMOReal DEFAULT_PERSON_SPEED;
454 
455 #endif
456 
457 /****************************************************************************/
458