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.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 // ===========================================================================
45 // class declarations
46 // ===========================================================================
47 class OutputDevice;
48 
49 
50 // ===========================================================================
51 // enum definitions
52 // ===========================================================================
106 };
107 
108 
109 
133 
135 
136 
140  SVC_EMERGENCY = 1 << 1,
142  SVC_AUTHORITY = 1 << 2,
144  SVC_ARMY = 1 << 3,
146  SVC_VIP = 1 << 4,
148 
149 
151 
152 
154  SVC_PASSENGER = 1 << 5,
156  SVC_HOV = 1 << 6,
158  SVC_TAXI = 1 << 7,
160  SVC_BUS = 1 << 8,
162  SVC_COACH = 1 << 9,
164  SVC_DELIVERY = 1 << 10,
166  SVC_TRUCK = 1 << 11,
168  SVC_TRAILER = 1 << 12,
170  SVC_TRAM = 1 << 13,
172  SVC_RAIL_URBAN = 1 << 14,
174  SVC_RAIL = 1 << 15,
176  SVC_RAIL_ELECTRIC = 1 << 16,
177 
179  SVC_MOTORCYCLE = 1 << 17,
181  SVC_MOPED = 1 << 18,
183  SVC_BICYCLE = 1 << 19,
185  SVC_PEDESTRIAN = 1 << 20,
187  SVC_E_VEHICLE = 1 << 21,
189  SVC_SHIP = 1 << 22,
191  SVC_CUSTOM1 = 1 << 23,
193  SVC_CUSTOM2 = 1 << 24,
195 
198 };
199 
200 extern const int SUMOVehicleClass_MAX;
202 extern std::set<std::string> deprecatedVehicleClassesSeen;
204 
205 /* @brief bitset where each bit declares whether a certain SVC may use this edge/lane
206  */
207 typedef int SVCPermissions;
208 extern const SVCPermissions SVCAll; // everything allowed
209 extern const SVCPermissions SVC_UNSPECIFIED; // permissions not specified
210 
211 
217 typedef int SUMOEmissionClass;
218 
219 
220 // ===========================================================================
221 // method declarations
222 // ===========================================================================
223 
224 // ---------------------------------------------------------------------------
225 // abstract vehicle class / purpose
226 // ---------------------------------------------------------------------------
231 extern std::string getVehicleClassNames(SVCPermissions permissions);
232 
233 
238 extern std::vector<std::string> getVehicleClassNamesList(SVCPermissions permissions);
239 
240 
246 extern SUMOVehicleClass getVehicleClassID(const std::string& name);
247 
252 extern int getVehicleClassCompoundID(const std::string& name);
253 
261 extern SVCPermissions parseVehicleClasses(const std::string& allowedS);
262 
263 
266 extern bool canParseVehicleClasses(const std::string& classes);
267 
272 extern SVCPermissions parseVehicleClasses(const std::string& allowedS, const std::string& disallowedS);
273 
274 
279 extern SVCPermissions parseVehicleClasses(const std::vector<std::string>& allowedS);
280 
281 
283 extern void writePermissions(OutputDevice& into, SVCPermissions permissions);
284 
286 extern void writePreferences(OutputDevice& into, SVCPermissions preferred);
287 
288 // ---------------------------------------------------------------------------
289 // vehicle shape class
290 // ---------------------------------------------------------------------------
295 extern std::string getVehicleShapeName(SUMOVehicleShape id);
296 
297 
302 extern SUMOVehicleShape getVehicleShapeID(const std::string& name);
303 
304 
309 extern bool isRailway(SVCPermissions permissions);
310 
315 extern bool isWaterway(SVCPermissions permissions);
316 
321 extern bool isForbidden(SVCPermissions permissions);
322 
323 // ---------------------------------------------------------------------------
324 // default vehicle type parameter
325 // ---------------------------------------------------------------------------
326 extern const std::string DEFAULT_VTYPE_ID;
327 extern const std::string DEFAULT_PEDTYPE_ID;
328 
329 extern const SUMOReal DEFAULT_VEH_PROB; // !!! does this belong here?
330 
332 
334 
335 #endif
336 
337 /****************************************************************************/
338 
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
void writePermissions(OutputDevice &into, SVCPermissions permissions)
writes allowed disallowed attributes if needed;
vehicle is a motorcycle
vehicle is a coach
render as a rail
const SUMOReal DEFAULT_CONTAINER_TRANSHIP_SPEED
std::set< std::string > deprecatedVehicleClassesSeen
is a pedestrian
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
StringBijection< SUMOVehicleShape > SumoVehicleShapeStrings(sumoVehicleShapeStringInitializer, SVS_UNKNOWN, false)
render as a motorcycle
vehicle is a not electrified rail
void writePreferences(OutputDevice &into, SVCPermissions preferred)
writes allowed disallowed attributes if needed;
render as a transport vehicle
vehicle is a bicycle
render as a flexible city bus
int SVCPermissions
vehicle is a small delivery vehicle
std::vector< std::string > getVehicleClassNamesList(SVCPermissions permissions)
Returns the ids of the given classes, divided using a &#39; &#39;.
classes which (normally) do not drive on normal roads
vehicle is a light rail
const SUMOReal DEFAULT_PEDESTRIAN_SPEED
const SUMOReal DEFAULT_VEH_PROB
render as a delivery vehicle
render as a sedan passenger vehicle (&quot;Stufenheck&quot;)
bool isForbidden(SVCPermissions permissions)
Returns whether an edge with the given permission is a forbidden edge.
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
const SVCPermissions SVCAll
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
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
vehicle is a large transport vehicle
is a user-defined type
const int SUMOVehicleClass_MAX
render as a hatchback passenger vehicle (&quot;Fliessheck&quot;)
render as a bus
army vehicles
private vehicles
int SUMOEmissionClass
not defined
bool isWaterway(SVCPermissions permissions)
Returns whether an edge with the given permission is a waterway edge.
render as a bicycle
render as a (city) rail without locomotive
int getVehicleClassCompoundID(const std::string &name)
Returns the OR&#39;ed id of the compound class given by its name.
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
render as a van
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
render as a passenger vehicle
std::string getVehicleClassNames(SVCPermissions permissions)
Returns the ids of the given classes, divided using a &#39; &#39;.
vehicle is a passenger car (a &quot;normal&quot; car)
is an arbitrary ship
vehicle is a moped
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
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
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
render as a (futuristic) e-vehicle
SUMOVehicleShape getVehicleShapeID(const std::string &name)
Returns the class id of the shape class given by its name.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
#define SUMOReal
Definition: config.h:215
public emergency vehicles
render as a transport vehicle with one trailer
render as a wagon passenger vehicle (&quot;Combi&quot;)
render as a coach
render as a semi-trailer transport vehicle (&quot;Sattelschlepper&quot;)
vehicles ignoring classes
const SVCPermissions SVC_UNSPECIFIED
render as a trolley bus
is a user-defined type
is an electric vehicle