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 // ===========================================================================
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  // HBEFA
207  // HBEFA heavy duty vehicles; 3 clusters
211  // HBEFA heavy duty vehicles; 6 clusters
218  // HBEFA heavy duty vehicles; 12 clusters
231  // HBEFA passenger & light duty vehicles; 7 clusters
239  // HBEFA passenger & light duty vehicles; 14 clusters
254  // HBEFA no emissions
256  // HBEFA heavy duty vehicles, no accel; 3 clusters
260  // HBEFA heavy duty vehicles, no accel; 6 clusters
267  // HBEFA heavy duty vehicles, no accel; 12 clusters
280  // HBEFA passenger & light duty vehicles, no accel; 7 clusters
288  // HBEFA passenger & light duty vehicles, no accel; 14 clusters
303 
304  SVE_META_HBEFA21_END, // end of iTETRIS' HBEFA 2.1 classes
305 
306 
307 
308  // PHEMlight
332 
422 
423  SVE_META_PHEMLIGHT_END // end of COLOMBO's PHEMlight classes
424 
425 };
426 
428 
429 
430 // ===========================================================================
431 // method declarations
432 // ===========================================================================
433 
434 // ---------------------------------------------------------------------------
435 // abstract vehicle class / purpose
436 // ---------------------------------------------------------------------------
437 /* @brief SUMOVehicleClass is meant to be OR'ed to combine information about vehicle
438  * ownership and vehicle "size" into one int.
439  * These OR'ed values cannot be translated directly into strings with toString().
440  * The names of all base values are concatenated with '|' as a separator.
441  */
442 extern std::string getVehicleClassCompoundName(int id);
443 
444 
449 extern std::string getAllowedVehicleClassNames(SVCPermissions permissions);
450 
451 
456 extern std::vector<std::string> getAllowedVehicleClassNamesList(SVCPermissions permissions);
457 
462 extern std::pair<std::string, bool> getPermissionEncoding(SVCPermissions permissions);
463 
464 
470 extern SUMOVehicleClass getVehicleClassID(const std::string& name);
471 
476 extern int getVehicleClassCompoundID(const std::string& name);
477 
484 extern SVCPermissions parseVehicleClasses(const std::string& allowedS);
485 
486 
489 extern bool canParseVehicleClasses(const std::string& classes);
490 
500 extern SVCPermissions parseVehicleClasses(const std::string& allowedS, const std::string& disallowedS);
501 
502 
506 extern SVCPermissions parseVehicleClasses(const std::vector<std::string>& allowedS);
507 
508 
509 // ---------------------------------------------------------------------------
510 // vehicle shape class
511 // ---------------------------------------------------------------------------
516 extern std::string getVehicleShapeName(SUMOVehicleShape id);
517 
518 
523 extern SUMOVehicleShape getVehicleShapeID(const std::string& name);
524 
525 
526 // ---------------------------------------------------------------------------
527 // emission class
528 // ---------------------------------------------------------------------------
533 extern std::string getVehicleEmissionTypeName(SUMOEmissionClass id);
534 
535 
540 extern SUMOEmissionClass getVehicleEmissionTypeID(const std::string& name);
541 
542 
547 extern bool isRailway(SVCPermissions permissions);
548 
549 
550 // ---------------------------------------------------------------------------
551 // default vehicle type parameter
552 // ---------------------------------------------------------------------------
553 extern const std::string DEFAULT_VTYPE_ID;
554 extern const SUMOReal DEFAULT_VEH_MAXSPEED;
555 extern const SUMOReal DEFAULT_VEH_ACCEL;
556 extern const SUMOReal DEFAULT_VEH_DECEL;
557 extern const SUMOReal DEFAULT_VEH_SIGMA;
558 extern const SUMOReal DEFAULT_VEH_LENGTH;
559 extern const SUMOReal DEFAULT_VEH_MINGAP;
560 extern const SUMOReal DEFAULT_VEH_TAU;
562 extern const SUMOReal DEFAULT_VEH_PROB;
563 extern const SUMOReal DEFAULT_VEH_SPEEDFACTOR;
564 extern const SUMOReal DEFAULT_VEH_SPEEDDEV;
565 extern const SUMOReal DEFAULT_VEH_WIDTH;
566 extern const SUMOReal DEFAULT_VEH_HEIGHT;
570 extern const SUMOReal DEFAULT_VEH_TMP1;
571 extern const SUMOReal DEFAULT_VEH_TMP2;
572 extern const SUMOReal DEFAULT_VEH_TMP3;
573 extern const SUMOReal DEFAULT_VEH_TMP4;
574 extern const SUMOReal DEFAULT_VEH_TMP5;
575 
576 extern const SUMOReal DEFAULT_PERSON_SPEED;
577 
578 #endif
579 
580 /****************************************************************************/
581 
const LaneChangeModel DEFAULT_VEH_LANE_CHANGE_MODEL
render as a light rail
std::string getVehicleClassCompoundName(int id)
const SUMOReal DEFAULT_VEH_TMP5
vehicle is a motorcycle
SumoXMLTag
Numbers representing SUMO-XML - element names.
render as a rail
vehicle is a city rail
int getVehicleClassCompoundID(const std::string &name)
Returns the OR'ed id of the compound class given by its name.
is a pedestrian
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
render as a slow (passenger) train
SUMOVehicleShape getVehicleShapeID(const std::string &name)
Returns the class id of the shape class given by its name.
std::string getAllowedVehicleClassNames(SVCPermissions permissions)
Returns the ids of the given classes, divided using a ' '.
render as a motorcycle
const int SUMOVehicleClass_MAX
vehicle is a large transport vehicle
vehicle is a bicycle
int SVCPermissions
vehicle is a small delivery vehicle
render as a city bus
const SUMOVehicleShape DEFAULT_VEH_SHAPE
render as a fast (passenger) train
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
const SUMOReal DEFAULT_VEH_PROB
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
render as a delivery vehicle
const SumoXMLTag DEFAULT_VEH_FOLLOW_MODEL
StringBijection< SUMOEmissionClass > SumoEmissionClassStrings
std::pair< std::string, bool > getPermissionEncoding(SVCPermissions permissions)
returns the shorter encoding of the given permissions (selects automatically wether to use allow or d...
const SUMOReal DEFAULT_VEH_LENGTH
render as a sedan passenger vehicle ("Stufenheck")
const SVCPermissions SVCFreeForAll
const SUMOReal DEFAULT_VEH_SIGMA
vehicle is a HOV
const std::string DEFAULT_VTYPE_ID
render as a semi-trailer transport vehicle ("Sattelschlepper")
is a user-defined type
SUMOEmissionClass
Definition of vehicle emission classes.
const SUMOReal DEFAULT_PERSON_SPEED
LaneChangeModel
vehicle is a light rail
render as a hatchback passenger vehicle ("Fliessheck")
render as a bus
StringBijection< SUMOVehicleShape > SumoVehicleShapeStrings
private vehicles
not defined
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
render as a bicycle
army vehicles
std::vector< std::string > getAllowedVehicleClassNamesList(SVCPermissions permissions)
Returns the ids of the given classes, divided using a ' '.
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
const SUMOReal DEFAULT_VEH_TAU
const SUMOReal DEFAULT_VEH_MAXSPEED
const SUMOReal DEFAULT_VEH_TMP3
render as a van
render as a passenger vehicle
const SUMOReal DEFAULT_VEH_SPEEDDEV
vehicle is a passenger car (a "normal" car)
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers. ...
render as a cargo train
render as a flexible city bus
authorities vehicles
vehicle is a taxi
const SUMOReal DEFAULT_VEH_MINGAP
vehicle is a bus
render as a giant ant
public emergency vehicles
render as a pedestrian
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
vip vehicles
vehicle is a slow moving transport rail
const SUMOReal DEFAULT_VEH_WIDTH
render as a transport vehicle with one trailer
const SUMOReal DEFAULT_VEH_TMP2
const SUMOReal DEFAULT_VEH_HEIGHT
render as a (futuristic) e-vehicle
const SUMOReal DEFAULT_VEH_SPEEDFACTOR
const SUMOReal DEFAULT_VEH_ACCEL
const SUMOReal DEFAULT_VEH_TMP1
#define SUMOReal
Definition: config.h:215
public transport vehicles
const SUMOReal DEFAULT_VEH_TMP4
const SUMOVehicleClass DEFAULT_VEH_CLASS
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings
render as a wagon passenger vehicle ("Combi")
render as a overland bus
std::string getVehicleEmissionTypeName(SUMOEmissionClass id)
Returns the class name of the emission class given by its id.
const SUMOReal DEFAULT_VEH_DECEL
vehicle is a fast moving rail
vehicles ignoring classes
render as a city rail
SUMOEmissionClass getVehicleEmissionTypeID(const std::string &name)
Returns the class id of the emission class given by its name.
render as a trolley bus
render as a transport vehicle
is a user-defined type