SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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.dlr.de/
13 // Copyright (C) 2001-2015 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 // ===========================================================================
99 };
100 
101 
102 
126 
128 
129 
133  SVC_EMERGENCY = 1 << 1,
135  SVC_AUTHORITY = 1 << 2,
137  SVC_ARMY = 1 << 3,
139  SVC_VIP = 1 << 4,
141 
142 
144 
145 
147  SVC_PASSENGER = 1 << 5,
149  SVC_HOV = 1 << 6,
151  SVC_TAXI = 1 << 7,
153  SVC_BUS = 1 << 8,
155  SVC_COACH = 1 << 9,
157  SVC_DELIVERY = 1 << 10,
159  SVC_TRUCK = 1 << 11,
161  SVC_TRAILER = 1 << 12,
163  SVC_TRAM = 1 << 13,
165  SVC_RAIL_URBAN = 1 << 14,
167  SVC_RAIL = 1 << 15,
169  SVC_RAIL_ELECTRIC = 1 << 16,
170 
172  SVC_MOTORCYCLE = 1 << 17,
174  SVC_MOPED = 1 << 18,
176  SVC_BICYCLE = 1 << 19,
178  SVC_PEDESTRIAN = 1 << 20,
180  SVC_E_VEHICLE = 1 << 21,
182  SVC_SHIP = 1 << 22,
184  SVC_CUSTOM1 = 1 << 23,
186  SVC_CUSTOM2 = 1 << 24
188 };
189 
190 extern const int SUMOVehicleClass_MAX;
192 extern std::set<std::string> deprecatedVehicleClassesSeen;
194 
195 /* @brief bitset where each bit declares whether a certain SVC may use this edge/lane
196  */
197 typedef int SVCPermissions;
198 extern const SVCPermissions SVCAll; // everything allowed
199 extern const SVCPermissions SVC_UNSPECIFIED; // permissions not specified
200 
201 
207 typedef int SUMOEmissionClass;
208 
209 
210 // ===========================================================================
211 // method declarations
212 // ===========================================================================
213 
214 // ---------------------------------------------------------------------------
215 // abstract vehicle class / purpose
216 // ---------------------------------------------------------------------------
217 /* @brief SUMOVehicleClass is meant to be OR'ed to combine information about vehicle
218  * ownership and vehicle "size" into one int.
219  * These OR'ed values cannot be translated directly into strings with toString().
220  * The names of all base values are concatenated with '|' as a separator.
221  */
222 extern std::string getVehicleClassCompoundName(int id);
223 
224 
229 extern std::string getVehicleClassNames(SVCPermissions permissions);
230 
231 
236 extern std::vector<std::string> getVehicleClassNamesList(SVCPermissions permissions);
237 
238 
244 extern SUMOVehicleClass getVehicleClassID(const std::string& name);
245 
250 extern int getVehicleClassCompoundID(const std::string& name);
251 
259 extern SVCPermissions parseVehicleClasses(const std::string& allowedS);
260 
261 
264 extern bool canParseVehicleClasses(const std::string& classes);
265 
270 extern SVCPermissions parseVehicleClasses(const std::string& allowedS, const std::string& disallowedS);
271 
272 
277 extern SVCPermissions parseVehicleClasses(const std::vector<std::string>& allowedS);
278 
279 
280 // ---------------------------------------------------------------------------
281 // vehicle shape class
282 // ---------------------------------------------------------------------------
287 extern std::string getVehicleShapeName(SUMOVehicleShape id);
288 
289 
294 extern SUMOVehicleShape getVehicleShapeID(const std::string& name);
295 
296 
301 extern bool isRailway(SVCPermissions permissions);
302 
307 extern bool isWaterway(SVCPermissions permissions);
308 
313 extern bool isForbidden(SVCPermissions permissions);
314 
315 // ---------------------------------------------------------------------------
316 // default vehicle type parameter
317 // ---------------------------------------------------------------------------
318 extern const std::string DEFAULT_VTYPE_ID;
319 extern const std::string DEFAULT_PEDTYPE_ID;
320 
321 extern const SUMOReal DEFAULT_VEH_PROB; // !!! does this belong here?
322 
324 
326 
327 #endif
328 
329 /****************************************************************************/
330 
std::string getVehicleClassCompoundName(int id)
vehicle is a motorcycle
vehicle is a coach
render as a rail
const SUMOReal DEFAULT_CONTAINER_TRANSHIP_SPEED
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...
SUMOVehicleShape getVehicleShapeID(const std::string &name)
Returns the class id of the shape class given by its name.
render as a motorcycle
vehicle is a not electrified rail
std::string getVehicleClassNames(SVCPermissions permissions)
Returns the ids of the given classes, divided using a ' '.
const int SUMOVehicleClass_MAX
render as a transport vehicle
vehicle is a bicycle
render as a flexible city bus
int SVCPermissions
vehicle is a small delivery vehicle
vehicle is a light rail
const SUMOReal DEFAULT_PEDESTRIAN_SPEED
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
render as a sedan passenger vehicle ("Stufenheck")
vehicle is a HOV
const std::string DEFAULT_VTYPE_ID
vehicle is a (possibly fast moving) electric rail
authorities vehicles
vehicle is a city rail
vehicle is a large transport vehicle
is a user-defined type
bool isWaterway(SVCPermissions permissions)
Returns whether an edge with the given permission is a waterway edge.
render as a hatchback passenger vehicle ("Fliessheck")
render as a bus
army vehicles
const SVCPermissions SVCAll
StringBijection< SUMOVehicleShape > SumoVehicleShapeStrings
private vehicles
int SUMOEmissionClass
not defined
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
render as a bicycle
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
render as a (city) rail without locomotive
render as a van
render as a passenger vehicle
vehicle is a passenger car (a "normal" car)
is an arbitrary ship
vehicle is a moped
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
render as a cargo train
vehicle is a taxi
vehicle is a bus
render as a giant ant
render as a pedestrian
render as a moped
const SVCPermissions SVC_UNSPECIFIED
bool isForbidden(SVCPermissions permissions)
Returns whether an edge with the given permission is a forbidden edge.
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
render as a arbitrary ship
const std::string DEFAULT_PEDTYPE_ID
vip vehicles
vehicle is a large transport vehicle
std::set< std::string > deprecatedVehicleClassesSeen
render as a (futuristic) e-vehicle
std::vector< std::string > getVehicleClassNamesList(SVCPermissions permissions)
Returns the ids of the given classes, divided using a ' '.
#define SUMOReal
Definition: config.h:218
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings
public emergency vehicles
render as a transport vehicle with one trailer
render as a wagon passenger vehicle ("Combi")
render as a coach
render as a semi-trailer transport vehicle ("Sattelschlepper")
vehicles ignoring classes
render as a trolley bus
is a user-defined type
is an electric vehicle