SUMO - Simulation of Urban MObility

SUMOVehicleClass.h

Go to the documentation of this file.
00001 /****************************************************************************/
00010 // Definitions of SUMO vehicle classes and helper functions
00011 /****************************************************************************/
00012 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00013 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00014 /****************************************************************************/
00015 //
00016 //   This file is part of SUMO.
00017 //   SUMO is free software: you can redistribute it and/or modify
00018 //   it under the terms of the GNU General Public License as published by
00019 //   the Free Software Foundation, either version 3 of the License, or
00020 //   (at your option) any later version.
00021 //
00022 /****************************************************************************/
00023 #ifndef SUMOVehicleClass_h
00024 #define SUMOVehicleClass_h
00025 
00026 
00027 // ===========================================================================
00028 // included modules
00029 // ===========================================================================
00030 #ifdef _MSC_VER
00031 #include <windows_config.h>
00032 #else
00033 #include <config.h>
00034 #endif
00035 
00036 #include <string>
00037 #include <set>
00038 #include <utils/common/UtilExceptions.h>
00039 #include <utils/common/StringBijection.h>
00040 #include <utils/xml/SUMOXMLDefinitions.h>
00041 
00042 // ===========================================================================
00043 // enum definitions
00044 // ===========================================================================
00049 enum SUMOVehicleShape {
00051     SVS_UNKNOWN,
00053     SVS_PEDESTRIAN,
00055     SVS_BICYCLE,
00057     SVS_MOTORCYCLE,
00059     SVS_PASSENGER,
00061     SVS_PASSENGER_SEDAN,
00063     SVS_PASSENGER_HATCHBACK,
00065     SVS_PASSENGER_WAGON,
00067     SVS_PASSENGER_VAN,
00069     SVS_DELIVERY,
00071     SVS_TRANSPORT,
00073     SVS_TRANSPORT_SEMITRAILER,
00075     SVS_TRANSPORT_1TRAILER,
00077     SVS_BUS,
00079     SVS_BUS_CITY,
00081     SVS_BUS_CITY_FLEXIBLE,
00083     SVS_BUS_OVERLAND,
00085     SVS_BUS_TROLLEY,
00087     SVS_RAIL,
00089     SVS_RAIL_LIGHT,
00091     SVS_RAIL_CITY,
00093     SVS_RAIL_SLOW,
00095     SVS_RAIL_FAST,
00097     SVS_RAIL_CARGO,
00099     SVS_E_VEHICLE,
00101     SVS_ANT
00102 };
00103 
00104 
00105 
00126 enum SUMOVehicleClass {
00127     SVC_UNKNOWN = 0,
00128 
00130 
00131 
00133     SVC_PRIVATE = 1,
00135     SVC_PUBLIC_TRANSPORT = 2,
00137     SVC_PUBLIC_EMERGENCY = 4,
00139     SVC_PUBLIC_AUTHORITY = 8,
00141     SVC_PUBLIC_ARMY = 16,
00143     SVC_VIP = 32,
00145     SVC_IGNORING = 64,
00147 
00148 
00150 
00151 
00153     SVC_PASSENGER = 256,
00155     SVC_HOV = 512,
00157     SVC_TAXI = 1024,
00159     SVC_BUS = 2048,
00161     SVC_DELIVERY = 4096,
00163     SVC_TRANSPORT = 8192,
00165     SVC_LIGHTRAIL = 16384,
00167     SVC_CITYRAIL = 32768,
00169     SVC_RAIL_SLOW = 65536,
00171     SVC_RAIL_FAST = 131072,
00172 
00174     SVC_MOTORCYCLE = 262144,
00176     SVC_BICYCLE = 524288,
00178     SVC_PEDESTRIAN = 1048576
00180 
00181 };
00182 
00183 extern StringBijection<SUMOVehicleClass> SumoVehicleClassStrings;
00184 extern StringBijection<SUMOVehicleShape> SumoVehicleShapeStrings;
00185 
00193 enum SUMOEmissionClass {
00194     SVE_UNKNOWN = -1,
00195     // heavy duty vehicles; 3 clusters
00196     SVE_HDV_3_1 = 0,
00197     SVE_HDV_3_2,
00198     SVE_HDV_3_3,
00199     // heavy duty vehicles; 6 clusters
00200     SVE_HDV_6_1,
00201     SVE_HDV_6_2,
00202     SVE_HDV_6_3,
00203     SVE_HDV_6_4,
00204     SVE_HDV_6_5,
00205     SVE_HDV_6_6,
00206     // heavy duty vehicles; 12 clusters
00207     SVE_HDV_12_1,
00208     SVE_HDV_12_2,
00209     SVE_HDV_12_3,
00210     SVE_HDV_12_4,
00211     SVE_HDV_12_5,
00212     SVE_HDV_12_6,
00213     SVE_HDV_12_7,
00214     SVE_HDV_12_8,
00215     SVE_HDV_12_9,
00216     SVE_HDV_12_10,
00217     SVE_HDV_12_11,
00218     SVE_HDV_12_12,
00219     // passenger & light duty vehicles; 7 clusters
00220     SVE_P_LDV_7_1,
00221     SVE_P_LDV_7_2,
00222     SVE_P_LDV_7_3,
00223     SVE_P_LDV_7_4,
00224     SVE_P_LDV_7_5,
00225     SVE_P_LDV_7_6,
00226     SVE_P_LDV_7_7,
00227     // passenger & light duty vehicles; 14 clusters
00228     SVE_P_LDV_14_1,
00229     SVE_P_LDV_14_2,
00230     SVE_P_LDV_14_3,
00231     SVE_P_LDV_14_4,
00232     SVE_P_LDV_14_5,
00233     SVE_P_LDV_14_6,
00234     SVE_P_LDV_14_7,
00235     SVE_P_LDV_14_8,
00236     SVE_P_LDV_14_9,
00237     SVE_P_LDV_14_10,
00238     SVE_P_LDV_14_11,
00239     SVE_P_LDV_14_12,
00240     SVE_P_LDV_14_13,
00241     SVE_P_LDV_14_14,
00242     // no emissions
00243     SVE_ZERO_EMISSIONS,
00244     // heavy duty vehicles, no accel; 3 clusters
00245     SVE_HDV_A0_3_1,
00246     SVE_HDV_A0_3_2,
00247     SVE_HDV_A0_3_3,
00248     // heavy duty vehicles, no accel; 6 clusters
00249     SVE_HDV_A0_6_1,
00250     SVE_HDV_A0_6_2,
00251     SVE_HDV_A0_6_3,
00252     SVE_HDV_A0_6_4,
00253     SVE_HDV_A0_6_5,
00254     SVE_HDV_A0_6_6,
00255     // heavy duty vehicles, no accel; 12 clusters
00256     SVE_HDV_A0_12_1,
00257     SVE_HDV_A0_12_2,
00258     SVE_HDV_A0_12_3,
00259     SVE_HDV_A0_12_4,
00260     SVE_HDV_A0_12_5,
00261     SVE_HDV_A0_12_6,
00262     SVE_HDV_A0_12_7,
00263     SVE_HDV_A0_12_8,
00264     SVE_HDV_A0_12_9,
00265     SVE_HDV_A0_12_10,
00266     SVE_HDV_A0_12_11,
00267     SVE_HDV_A0_12_12,
00268     // passenger & light duty vehicles, no accel; 7 clusters
00269     SVE_P_LDV_A0_7_1,
00270     SVE_P_LDV_A0_7_2,
00271     SVE_P_LDV_A0_7_3,
00272     SVE_P_LDV_A0_7_4,
00273     SVE_P_LDV_A0_7_5,
00274     SVE_P_LDV_A0_7_6,
00275     SVE_P_LDV_A0_7_7,
00276     // passenger & light duty vehicles, no accel; 14 clusters
00277     SVE_P_LDV_A0_14_1,
00278     SVE_P_LDV_A0_14_2,
00279     SVE_P_LDV_A0_14_3,
00280     SVE_P_LDV_A0_14_4,
00281     SVE_P_LDV_A0_14_5,
00282     SVE_P_LDV_A0_14_6,
00283     SVE_P_LDV_A0_14_7,
00284     SVE_P_LDV_A0_14_8,
00285     SVE_P_LDV_A0_14_9,
00286     SVE_P_LDV_A0_14_10,
00287     SVE_P_LDV_A0_14_11,
00288     SVE_P_LDV_A0_14_12,
00289     SVE_P_LDV_A0_14_13,
00290     SVE_P_LDV_A0_14_14
00291 };
00292 
00293 
00294 typedef std::set<SUMOVehicleClass> SUMOVehicleClasses;
00295 
00296 
00297 // ===========================================================================
00298 // method declarations
00299 // ===========================================================================
00300 
00301 // ---------------------------------------------------------------------------
00302 // abstract vehicle class / purpose
00303 // ---------------------------------------------------------------------------
00304 /* @brief SUMOVehicleClass is meant to be OR'ed to combine information about vehicle
00305  * ownership and vehicle "size" into one int.
00306  * These OR'ed values cannot be translated directly into strings with toString().
00307  * The names of all base values are concatenated with '|' as a separator.
00308  */
00309 extern std::string getVehicleClassCompoundName(int id);
00310 
00311 
00316 extern std::string getVehicleClassNames(const SUMOVehicleClasses& ids);
00317 
00318 
00324 extern SUMOVehicleClass getVehicleClassID(const std::string& name);
00325 
00330 extern int getVehicleClassCompoundID(const std::string& name);
00331 
00337 extern void parseVehicleClasses(const std::string& classNames,
00338                                 SUMOVehicleClasses& container);
00339 
00347 extern void parseVehicleClasses(const std::string& allowedS,
00348                                 const std::string& disallowedS,
00349                                 SUMOVehicleClasses& allowed,
00350                                 SUMOVehicleClasses& disallowed);
00351 
00352 
00357 extern void parseVehicleClasses(const std::vector<std::string> &classesS,
00358                                 SUMOVehicleClasses& classes);
00359 
00360 
00361 // ---------------------------------------------------------------------------
00362 // vehicle shape class
00363 // ---------------------------------------------------------------------------
00368 extern std::string getVehicleShapeName(SUMOVehicleShape id);
00369 
00370 
00375 extern SUMOVehicleShape getVehicleShapeID(const std::string& name);
00376 
00377 
00378 // ---------------------------------------------------------------------------
00379 // emission class
00380 // ---------------------------------------------------------------------------
00385 extern std::string getVehicleEmissionTypeName(SUMOEmissionClass id);
00386 
00387 
00392 extern SUMOEmissionClass getVehicleEmissionTypeID(const std::string& name) ;
00393 
00394 
00395 // ---------------------------------------------------------------------------
00396 // default vehicle type parameter
00397 // ---------------------------------------------------------------------------
00398 extern const std::string DEFAULT_VTYPE_ID;
00399 extern const SUMOReal DEFAULT_VEH_MAXSPEED;
00400 extern const SUMOReal DEFAULT_VEH_ACCEL;
00401 extern const SUMOReal DEFAULT_VEH_DECEL;
00402 extern const SUMOReal DEFAULT_VEH_SIGMA;
00403 extern const SUMOReal DEFAULT_VEH_LENGTH;
00404 extern const SUMOReal DEFAULT_VEH_MINGAP;
00405 extern const SUMOReal DEFAULT_VEH_TAU;
00406 extern const SUMOVehicleClass DEFAULT_VEH_CLASS;
00407 extern const SUMOReal DEFAULT_VEH_PROB;
00408 extern const SUMOReal DEFAULT_VEH_SPEEDFACTOR;
00409 extern const SUMOReal DEFAULT_VEH_SPEEDDEV;
00410 extern const SUMOReal DEFAULT_VEH_GUIWIDTH;
00411 extern const SumoXMLTag DEFAULT_VEH_FOLLOW_MODEL;
00412 extern const std::string DEFAULT_VEH_LANE_CHANGE_MODEL;
00413 extern const SUMOVehicleShape DEFAULT_VEH_SHAPE;
00414 
00415 #endif
00416 
00417 /****************************************************************************/
00418 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines