SUMO - Simulation of Urban MObility
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
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-sim.org/
13
// Copyright (C) 2001-2014 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>
39
#include <
utils/common/UtilExceptions.h
>
40
#include <
utils/common/StringBijection.h
>
41
#include <
utils/xml/SUMOXMLDefinitions.h
>
42
43
// ===========================================================================
44
// enum definitions
45
// ===========================================================================
50
enum
SUMOVehicleShape
{
52
SVS_UNKNOWN
,
54
SVS_PEDESTRIAN
,
56
SVS_BICYCLE
,
58
SVS_MOPED
,
60
SVS_MOTORCYCLE
,
62
SVS_PASSENGER
,
64
SVS_PASSENGER_SEDAN
,
66
SVS_PASSENGER_HATCHBACK
,
68
SVS_PASSENGER_WAGON
,
70
SVS_PASSENGER_VAN
,
72
SVS_DELIVERY
,
74
SVS_TRUCK
,
76
SVS_TRUCK_SEMITRAILER
,
78
SVS_TRUCK_1TRAILER
,
80
SVS_BUS
,
82
SVS_BUS_COACH
,
84
SVS_BUS_FLEXIBLE
,
86
SVS_BUS_TROLLEY
,
88
SVS_RAIL
,
90
SVS_RAIL_CAR
,
92
SVS_RAIL_CARGO
,
94
SVS_E_VEHICLE
,
96
SVS_ANT
97
};
98
99
100
121
enum
SUMOVehicleClass
{
123
SVC_IGNORING
= 0,
124
126
127
129
SVC_PRIVATE
= 1,
131
SVC_EMERGENCY
= 1 << 1,
133
SVC_AUTHORITY
= 1 << 2,
135
SVC_ARMY
= 1 << 3,
137
SVC_VIP
= 1 << 4,
139
140
142
143
145
SVC_PASSENGER
= 1 << 5,
147
SVC_HOV
= 1 << 6,
149
SVC_TAXI
= 1 << 7,
151
SVC_BUS
= 1 << 8,
153
SVC_COACH
= 1 << 9,
155
SVC_DELIVERY
= 1 << 10,
157
SVC_TRUCK
= 1 << 11,
159
SVC_TRAILER
= 1 << 12,
161
SVC_TRAM
= 1 << 13,
163
SVC_RAIL_URBAN
= 1 << 14,
165
SVC_RAIL
= 1 << 15,
167
SVC_RAIL_ELECTRIC
= 1 << 16,
168
170
SVC_MOTORCYCLE
= 1 << 17,
172
SVC_MOPED
= 1 << 18,
174
SVC_BICYCLE
= 1 << 19,
176
SVC_PEDESTRIAN
= 1 << 20,
178
SVC_E_VEHICLE
= 1 << 21,
180
SVC_CUSTOM1
= 1 << 22,
182
SVC_CUSTOM2
= 1 << 23
184
};
185
186
extern
const
int
SUMOVehicleClass_MAX
;
187
extern
StringBijection<SUMOVehicleClass>
SumoVehicleClassStrings
;
188
extern
std::set<std::string>
deprecatedVehicleClassesSeen
;
189
extern
StringBijection<SUMOVehicleShape>
SumoVehicleShapeStrings
;
190
191
/* @brief bitset where each bit declares whether a certain SVC may use this edge/lane
192
*/
193
typedef
int
SVCPermissions
;
194
extern
const
SVCPermissions
SVCAll
;
195
196
202
typedef
int
SUMOEmissionClass
;
203
204
205
// ===========================================================================
206
// method declarations
207
// ===========================================================================
208
209
// ---------------------------------------------------------------------------
210
// abstract vehicle class / purpose
211
// ---------------------------------------------------------------------------
212
/* @brief SUMOVehicleClass is meant to be OR'ed to combine information about vehicle
213
* ownership and vehicle "size" into one int.
214
* These OR'ed values cannot be translated directly into strings with toString().
215
* The names of all base values are concatenated with '|' as a separator.
216
*/
217
extern
std::string
getVehicleClassCompoundName
(
int
id
);
218
219
224
extern
std::string
getVehicleClassNames
(
SVCPermissions
permissions);
225
226
231
extern
std::vector<std::string>
getVehicleClassNamesList
(
SVCPermissions
permissions);
232
233
239
extern
SUMOVehicleClass
getVehicleClassID
(
const
std::string& name);
240
245
extern
int
getVehicleClassCompoundID
(
const
std::string& name);
246
254
extern
SVCPermissions
parseVehicleClasses
(
const
std::string& allowedS);
255
256
259
extern
bool
canParseVehicleClasses
(
const
std::string& classes);
260
265
extern
SVCPermissions
parseVehicleClasses
(
const
std::string& allowedS,
const
std::string& disallowedS);
266
267
272
extern
SVCPermissions
parseVehicleClasses
(
const
std::vector<std::string>& allowedS);
273
274
275
// ---------------------------------------------------------------------------
276
// vehicle shape class
277
// ---------------------------------------------------------------------------
282
extern
std::string
getVehicleShapeName
(
SUMOVehicleShape
id
);
283
284
289
extern
SUMOVehicleShape
getVehicleShapeID
(
const
std::string& name);
290
291
296
extern
bool
isRailway
(
SVCPermissions
permissions);
297
302
extern
bool
isForbidden
(
SVCPermissions
permissions);
303
304
// ---------------------------------------------------------------------------
305
// default vehicle type parameter
306
// ---------------------------------------------------------------------------
307
extern
const
std::string
DEFAULT_VTYPE_ID
;
308
309
extern
const
SUMOReal
DEFAULT_VEH_PROB
;
// !!! does this belong here?
310
311
extern
const
SUMOReal
DEFAULT_PEDESTRIAN_SPEED
;
312
313
#endif
314
315
/****************************************************************************/
316
tmp
buildd
sumo-0.21.0+dfsg
src
utils
common
SUMOVehicleClass.h
Generated on Thu Nov 20 2014 19:49:59 for SUMO - Simulation of Urban MObility by
1.8.1.2