|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // Definitions of SUMO vehicle classes and helper functions 00008 /****************************************************************************/ 00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00010 // Copyright (C) 2001-2011 DLR (http://www.dlr.de/) and contributors 00011 /****************************************************************************/ 00012 // 00013 // This program is free software; you can redistribute it and/or modify 00014 // it under the terms of the GNU General Public License as published by 00015 // the Free Software Foundation; either version 2 of the License, or 00016 // (at your option) any later version. 00017 // 00018 /****************************************************************************/ 00019 #ifndef SUMOVehicleClass_h 00020 #define SUMOVehicleClass_h 00021 00022 00023 // =========================================================================== 00024 // included modules 00025 // =========================================================================== 00026 #ifdef _MSC_VER 00027 #include <windows_config.h> 00028 #else 00029 #include <config.h> 00030 #endif 00031 00032 #include <string> 00033 #include <set> 00034 #include <utils/common/UtilExceptions.h> 00035 #include <utils/common/StringBijection.h> 00036 #include <utils/xml/SUMOXMLDefinitions.h> 00037 00038 // =========================================================================== 00039 // enum definitions 00040 // =========================================================================== 00045 enum SUMOVehicleShape { 00047 SVS_UNKNOWN, 00049 SVS_PEDESTRIAN, 00051 SVS_BICYCLE, 00053 SVS_MOTORCYCLE, 00055 SVS_PASSENGER, 00057 SVS_PASSENGER_SEDAN, 00059 SVS_PASSENGER_HATCHBACK, 00061 SVS_PASSENGER_WAGON, 00063 SVS_PASSENGER_VAN, 00065 SVS_DELIVERY, 00067 SVS_TRANSPORT, 00069 SVS_TRANSPORT_SEMITRAILER, 00071 SVS_TRANSPORT_1TRAILER, 00073 SVS_BUS, 00075 SVS_BUS_CITY, 00077 SVS_BUS_CITY_FLEXIBLE, 00079 SVS_BUS_OVERLAND, 00081 SVS_BUS_TROLLEY, 00083 SVS_RAIL, 00085 SVS_RAIL_LIGHT, 00087 SVS_RAIL_CITY, 00089 SVS_RAIL_SLOW, 00091 SVS_RAIL_FAST, 00093 SVS_RAIL_CARGO, 00095 SVS_E_VEHICLE, 00097 SVS_ANT 00098 }; 00099 00100 00101 00122 enum SUMOVehicleClass { 00123 SVC_UNKNOWN = 0, 00124 00126 00127 00129 SVC_PRIVATE = 1, 00131 SVC_PUBLIC_TRANSPORT = 2, 00133 SVC_PUBLIC_EMERGENCY = 4, 00135 SVC_PUBLIC_AUTHORITY = 8, 00137 SVC_PUBLIC_ARMY = 16, 00139 SVC_VIP = 32, 00141 SVC_IGNORING = 64, 00143 00144 00146 00147 00149 SVC_PASSENGER = 256, 00151 SVC_HOV = 512, 00153 SVC_TAXI = 1024, 00155 SVC_BUS = 2048, 00157 SVC_DELIVERY = 4096, 00159 SVC_TRANSPORT = 8192, 00161 SVC_LIGHTRAIL = 16384, 00163 SVC_CITYRAIL = 32768, 00165 SVC_RAIL_SLOW = 65536, 00167 SVC_RAIL_FAST = 131072, 00168 00170 SVC_MOTORCYCLE = 262144, 00172 SVC_BICYCLE = 524288, 00174 SVC_PEDESTRIAN = 1048576 00176 00177 }; 00178 00179 extern StringBijection<SUMOVehicleClass> SumoVehicleClassStrings; 00180 extern StringBijection<SUMOVehicleShape> SumoVehicleShapeStrings; 00181 00189 enum SUMOEmissionClass { 00190 SVE_UNKNOWN = -1, 00191 // heavy duty vehicles; 3 clusters 00192 SVE_HDV_3_1 = 0, 00193 SVE_HDV_3_2, 00194 SVE_HDV_3_3, 00195 // heavy duty vehicles; 6 clusters 00196 SVE_HDV_6_1, 00197 SVE_HDV_6_2, 00198 SVE_HDV_6_3, 00199 SVE_HDV_6_4, 00200 SVE_HDV_6_5, 00201 SVE_HDV_6_6, 00202 // heavy duty vehicles; 12 clusters 00203 SVE_HDV_12_1, 00204 SVE_HDV_12_2, 00205 SVE_HDV_12_3, 00206 SVE_HDV_12_4, 00207 SVE_HDV_12_5, 00208 SVE_HDV_12_6, 00209 SVE_HDV_12_7, 00210 SVE_HDV_12_8, 00211 SVE_HDV_12_9, 00212 SVE_HDV_12_10, 00213 SVE_HDV_12_11, 00214 SVE_HDV_12_12, 00215 // passenger & light duty vehicles; 7 clusters 00216 SVE_P_LDV_7_1, 00217 SVE_P_LDV_7_2, 00218 SVE_P_LDV_7_3, 00219 SVE_P_LDV_7_4, 00220 SVE_P_LDV_7_5, 00221 SVE_P_LDV_7_6, 00222 SVE_P_LDV_7_7, 00223 // passenger & light duty vehicles; 14 clusters 00224 SVE_P_LDV_14_1, 00225 SVE_P_LDV_14_2, 00226 SVE_P_LDV_14_3, 00227 SVE_P_LDV_14_4, 00228 SVE_P_LDV_14_5, 00229 SVE_P_LDV_14_6, 00230 SVE_P_LDV_14_7, 00231 SVE_P_LDV_14_8, 00232 SVE_P_LDV_14_9, 00233 SVE_P_LDV_14_10, 00234 SVE_P_LDV_14_11, 00235 SVE_P_LDV_14_12, 00236 SVE_P_LDV_14_13, 00237 SVE_P_LDV_14_14, 00238 // no emissions 00239 SVE_ZERO_EMISSIONS 00240 }; 00241 00242 00243 typedef std::set<SUMOVehicleClass> SUMOVehicleClasses; 00244 00245 00246 // =========================================================================== 00247 // method declarations 00248 // =========================================================================== 00249 00250 // --------------------------------------------------------------------------- 00251 // abstract vehicle class / purpose 00252 // --------------------------------------------------------------------------- 00253 /* @brief SUMOVehicleClass is meant to be OR'ed to combine information about vehicle 00254 * ownership and vehicle "size" into one int. 00255 * These OR'ed values cannot be translated directly into strings with toString(). 00256 * The names of all base values are concatenated with '|' as a separator. 00257 */ 00258 extern std::string getVehicleClassCompoundName(int id); 00259 00260 00265 extern std::string getVehicleClassNames(const SUMOVehicleClasses& ids); 00266 00267 00273 extern SUMOVehicleClass getVehicleClassID(const std::string& name); 00274 00279 extern int getVehicleClassCompoundID(const std::string& name); 00280 00286 extern void parseVehicleClasses(const std::string& classNames, 00287 SUMOVehicleClasses& container); 00288 00296 extern void parseVehicleClasses(const std::string& allowedS, 00297 const std::string& disallowedS, 00298 SUMOVehicleClasses& allowed, 00299 SUMOVehicleClasses& disallowed); 00300 00301 00306 extern void parseVehicleClasses(const std::vector<std::string> &classesS, 00307 SUMOVehicleClasses& classes); 00308 00309 00310 // --------------------------------------------------------------------------- 00311 // vehicle shape class 00312 // --------------------------------------------------------------------------- 00317 extern std::string getVehicleShapeName(SUMOVehicleShape id); 00318 00319 00324 extern SUMOVehicleShape getVehicleShapeID(const std::string& name); 00325 00326 00327 // --------------------------------------------------------------------------- 00328 // emission class 00329 // --------------------------------------------------------------------------- 00334 extern std::string getVehicleEmissionTypeName(SUMOEmissionClass id); 00335 00336 00341 extern SUMOEmissionClass getVehicleEmissionTypeID(const std::string& name) throw(ProcessError); 00342 00343 00344 // --------------------------------------------------------------------------- 00345 // default vehicle type parameter 00346 // --------------------------------------------------------------------------- 00347 extern const std::string DEFAULT_VTYPE_ID; 00348 extern const SUMOReal DEFAULT_VEH_MAXSPEED; 00349 extern const SUMOReal DEFAULT_VEH_ACCEL; 00350 extern const SUMOReal DEFAULT_VEH_DECEL; 00351 extern const SUMOReal DEFAULT_VEH_SIGMA; 00352 extern const SUMOReal DEFAULT_VEH_LENGTH; 00353 extern const SUMOReal DEFAULT_VEH_MINGAP; 00354 extern const SUMOReal DEFAULT_VEH_TAU; 00355 extern const SUMOVehicleClass DEFAULT_VEH_CLASS; 00356 extern const SUMOReal DEFAULT_VEH_PROB; 00357 extern const SUMOReal DEFAULT_VEH_SPEEDFACTOR; 00358 extern const SUMOReal DEFAULT_VEH_SPEEDDEV; 00359 extern const SUMOReal DEFAULT_VEH_GUIWIDTH; 00360 extern const SumoXMLTag DEFAULT_VEH_FOLLOW_MODEL; 00361 extern const std::string DEFAULT_VEH_LANE_CHANGE_MODEL; 00362 extern const SUMOVehicleShape DEFAULT_VEH_SHAPE; 00363 00364 #endif 00365 00366 /****************************************************************************/ 00367