SUMO - Simulation of Urban MObility
SUMOVehicleClass.h
Go to the documentation of this file.
1 /****************************************************************************/
11 // Definitions of SUMO vehicle classes and helper functions
12 /****************************************************************************/
13 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
14 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
15 /****************************************************************************/
16 //
17 // This file is part of SUMO.
18 // SUMO is free software: you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation, either version 3 of the License, or
21 // (at your option) any later version.
22 //
23 /****************************************************************************/
24 #ifndef SUMOVehicleClass_h
25 #define SUMOVehicleClass_h
26 
27 
28 // ===========================================================================
29 // included modules
30 // ===========================================================================
31 #ifdef _MSC_VER
32 #include <windows_config.h>
33 #else
34 #include <config.h>
35 #endif
36 
37 #include <string>
38 #include <set>
39 #include <limits>
43 
44 
45 // ===========================================================================
46 // class declarations
47 // ===========================================================================
48 class OutputDevice;
49 
50 
51 // ===========================================================================
52 // enum definitions
53 // ===========================================================================
113 };
114 
115 
116 
140 
142 
143 
147  SVC_EMERGENCY = 1 << 1,
149  SVC_AUTHORITY = 1 << 2,
151  SVC_ARMY = 1 << 3,
153  SVC_VIP = 1 << 4,
155 
156 
158 
159 
161  SVC_PASSENGER = 1 << 5,
163  SVC_HOV = 1 << 6,
165  SVC_TAXI = 1 << 7,
167  SVC_BUS = 1 << 8,
169  SVC_COACH = 1 << 9,
171  SVC_DELIVERY = 1 << 10,
173  SVC_TRUCK = 1 << 11,
175  SVC_TRAILER = 1 << 12,
177  SVC_TRAM = 1 << 13,
179  SVC_RAIL_URBAN = 1 << 14,
181  SVC_RAIL = 1 << 15,
183  SVC_RAIL_ELECTRIC = 1 << 16,
184 
186  SVC_MOTORCYCLE = 1 << 17,
188  SVC_MOPED = 1 << 18,
190  SVC_BICYCLE = 1 << 19,
192  SVC_PEDESTRIAN = 1 << 20,
194  SVC_E_VEHICLE = 1 << 21,
196  SVC_SHIP = 1 << 22,
198  SVC_CUSTOM1 = 1 << 23,
200  SVC_CUSTOM2 = 1 << 24,
202 
205 };
206 
207 extern const int SUMOVehicleClass_MAX;
209 extern std::set<std::string> deprecatedVehicleClassesSeen;
211 
213 typedef int SVCPermissions;
214 
216 extern const SVCPermissions SVCAll;
217 
219 extern const SVCPermissions SVC_UNSPECIFIED;
220 
226 typedef int SUMOEmissionClass;
227 
228 
229 // ===========================================================================
230 // method declarations
231 // ===========================================================================
232 
233 // ---------------------------------------------------------------------------
234 // abstract vehicle class / purpose
235 // ---------------------------------------------------------------------------
241 extern std::string getVehicleClassNames(SVCPermissions permissions, bool expand = false);
242 
247 extern std::vector<std::string> getVehicleClassNamesList(SVCPermissions permissions);
248 
254 extern SUMOVehicleClass getVehicleClassID(const std::string& name);
255 
260 extern int getVehicleClassCompoundID(const std::string& name);
261 
269 extern SVCPermissions parseVehicleClasses(const std::string& allowedS);
270 
272 extern bool canParseVehicleClasses(const std::string& classes);
273 
278 extern SVCPermissions parseVehicleClasses(const std::string& allowedS, const std::string& disallowedS);
279 
284 extern SVCPermissions parseVehicleClasses(const std::vector<std::string>& allowedS);
285 
287 extern void writePermissions(OutputDevice& into, SVCPermissions permissions);
288 
290 extern void writePreferences(OutputDevice& into, SVCPermissions preferred);
291 
292 // ---------------------------------------------------------------------------
293 // vehicle shape class
294 // ---------------------------------------------------------------------------
299 extern std::string getVehicleShapeName(SUMOVehicleShape id);
300 
305 extern SUMOVehicleShape getVehicleShapeID(const std::string& name);
306 
308 extern bool canParseVehicleShape(const std::string& shape);
309 
314 extern bool isRailway(SVCPermissions permissions);
315 
320 extern bool isWaterway(SVCPermissions permissions);
321 
326 extern bool isForbidden(SVCPermissions permissions);
327 
328 // ---------------------------------------------------------------------------
329 // default vehicle type parameter
330 // ---------------------------------------------------------------------------
331 extern const std::string DEFAULT_VTYPE_ID;
332 extern const std::string DEFAULT_PEDTYPE_ID;
333 
334 extern const double DEFAULT_VEH_PROB; // !!! does this belong here?
335 
336 extern const double DEFAULT_PEDESTRIAN_SPEED;
337 
338 extern const double DEFAULT_CONTAINER_TRANSHIP_SPEED;
339 
340 #endif
341 
342 /****************************************************************************/
343 
void writePermissions(OutputDevice &into, SVCPermissions permissions)
writes allowed disallowed attributes if needed;
vehicle is a motorcycle
vehicle is a coach
render as a rail
int getVehicleClassCompoundID(const std::string &name)
Returns the OR&#39;ed id of the compound class given by its name.
void writePreferences(OutputDevice &into, SVCPermissions preferred)
writes allowed disallowed attributes if needed;
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
const int SUMOVehicleClass_MAX
render as a transport vehicle
vehicle is a bicycle
render as a flexible city bus
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
vehicle is a small delivery vehicle
classes which (normally) do not drive on normal roads
vehicle is a light rail
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
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")
const double DEFAULT_VEH_PROB
vehicle is a HOV
const std::string DEFAULT_VTYPE_ID
std::string getVehicleClassNames(SVCPermissions permissions, bool expand=false)
Returns the ids of the given classes, divided using a &#39; &#39;.
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.
bool canParseVehicleShape(const std::string &shape)
Checks whether the given string contains only known vehicle shape.
render as a hatchback passenger vehicle ("Fliessheck")
render as a bus
army vehicles
const SVCPermissions SVCAll
all VClasses are allowed
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
const double DEFAULT_CONTAINER_TRANSHIP_SPEED
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
render as a police car
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
render as a fire brigade
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
permissions not specified
bool isForbidden(SVCPermissions permissions)
Returns whether an edge with the given permission is a forbidden edge.
const double DEFAULT_PEDESTRIAN_SPEED
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 an emergency vehicle
render as a (futuristic) e-vehicle
std::vector< std::string > getVehicleClassNamesList(SVCPermissions permissions)
Returns the ids of the given classes, divided using a &#39; &#39;.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
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