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-2013 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_MOTORCYCLE
,
60
SVS_PASSENGER
,
62
SVS_PASSENGER_SEDAN
,
64
SVS_PASSENGER_HATCHBACK
,
66
SVS_PASSENGER_WAGON
,
68
SVS_PASSENGER_VAN
,
70
SVS_DELIVERY
,
72
SVS_TRANSPORT
,
74
SVS_TRANSPORT_SEMITRAILER
,
76
SVS_TRANSPORT_1TRAILER
,
78
SVS_BUS
,
80
SVS_BUS_CITY
,
82
SVS_BUS_CITY_FLEXIBLE
,
84
SVS_BUS_OVERLAND
,
86
SVS_BUS_TROLLEY
,
88
SVS_RAIL
,
90
SVS_RAIL_LIGHT
,
92
SVS_RAIL_CITY
,
94
SVS_RAIL_SLOW
,
96
SVS_RAIL_FAST
,
98
SVS_RAIL_CARGO
,
100
SVS_E_VEHICLE
,
102
SVS_ANT
103
};
104
105
106
127
enum
SUMOVehicleClass
{
128
SVC_UNKNOWN
= 0,
129
131
132
134
SVC_PRIVATE
= 1,
136
SVC_PUBLIC_TRANSPORT
= 2,
138
SVC_PUBLIC_EMERGENCY
= 4,
140
SVC_PUBLIC_AUTHORITY
= 8,
142
SVC_PUBLIC_ARMY
= 16,
144
SVC_VIP
= 32,
146
SVC_IGNORING
= 64,
148
149
151
152
154
SVC_PASSENGER
= 128,
156
SVC_HOV
= 256,
158
SVC_TAXI
= 512,
160
SVC_BUS
= 1024,
162
SVC_DELIVERY
= 2048,
164
SVC_TRANSPORT
= 4096,
166
SVC_LIGHTRAIL
= 8192,
168
SVC_CITYRAIL
= 16384,
170
SVC_RAIL_SLOW
= 32768,
172
SVC_RAIL_FAST
= 65536,
173
175
SVC_MOTORCYCLE
= 131072,
177
SVC_BICYCLE
= 262144,
179
SVC_PEDESTRIAN
= 524288,
181
SVC_CUSTOM1
= 1048576,
183
SVC_CUSTOM2
= 2097152
185
};
186
187
extern
const
int
SUMOVehicleClass_MAX
;
188
extern
StringBijection<SUMOVehicleClass>
SumoVehicleClassStrings
;
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
SVCFreeForAll
;
195
196
204
enum
SUMOEmissionClass
{
205
SVE_UNKNOWN
= -1,
206
// heavy duty vehicles; 3 clusters
207
SVE_HDV_3_1
= 0,
208
SVE_HDV_3_2
,
209
SVE_HDV_3_3
,
210
// heavy duty vehicles; 6 clusters
211
SVE_HDV_6_1
,
212
SVE_HDV_6_2
,
213
SVE_HDV_6_3
,
214
SVE_HDV_6_4
,
215
SVE_HDV_6_5
,
216
SVE_HDV_6_6
,
217
// heavy duty vehicles; 12 clusters
218
SVE_HDV_12_1
,
219
SVE_HDV_12_2
,
220
SVE_HDV_12_3
,
221
SVE_HDV_12_4
,
222
SVE_HDV_12_5
,
223
SVE_HDV_12_6
,
224
SVE_HDV_12_7
,
225
SVE_HDV_12_8
,
226
SVE_HDV_12_9
,
227
SVE_HDV_12_10
,
228
SVE_HDV_12_11
,
229
SVE_HDV_12_12
,
230
// passenger & light duty vehicles; 7 clusters
231
SVE_P_LDV_7_1
,
232
SVE_P_LDV_7_2
,
233
SVE_P_LDV_7_3
,
234
SVE_P_LDV_7_4
,
235
SVE_P_LDV_7_5
,
236
SVE_P_LDV_7_6
,
237
SVE_P_LDV_7_7
,
238
// passenger & light duty vehicles; 14 clusters
239
SVE_P_LDV_14_1
,
240
SVE_P_LDV_14_2
,
241
SVE_P_LDV_14_3
,
242
SVE_P_LDV_14_4
,
243
SVE_P_LDV_14_5
,
244
SVE_P_LDV_14_6
,
245
SVE_P_LDV_14_7
,
246
SVE_P_LDV_14_8
,
247
SVE_P_LDV_14_9
,
248
SVE_P_LDV_14_10
,
249
SVE_P_LDV_14_11
,
250
SVE_P_LDV_14_12
,
251
SVE_P_LDV_14_13
,
252
SVE_P_LDV_14_14
,
253
// no emissions
254
SVE_ZERO_EMISSIONS
,
255
// heavy duty vehicles, no accel; 3 clusters
256
SVE_HDV_A0_3_1
,
257
SVE_HDV_A0_3_2
,
258
SVE_HDV_A0_3_3
,
259
// heavy duty vehicles, no accel; 6 clusters
260
SVE_HDV_A0_6_1
,
261
SVE_HDV_A0_6_2
,
262
SVE_HDV_A0_6_3
,
263
SVE_HDV_A0_6_4
,
264
SVE_HDV_A0_6_5
,
265
SVE_HDV_A0_6_6
,
266
// heavy duty vehicles, no accel; 12 clusters
267
SVE_HDV_A0_12_1
,
268
SVE_HDV_A0_12_2
,
269
SVE_HDV_A0_12_3
,
270
SVE_HDV_A0_12_4
,
271
SVE_HDV_A0_12_5
,
272
SVE_HDV_A0_12_6
,
273
SVE_HDV_A0_12_7
,
274
SVE_HDV_A0_12_8
,
275
SVE_HDV_A0_12_9
,
276
SVE_HDV_A0_12_10
,
277
SVE_HDV_A0_12_11
,
278
SVE_HDV_A0_12_12
,
279
// passenger & light duty vehicles, no accel; 7 clusters
280
SVE_P_LDV_A0_7_1
,
281
SVE_P_LDV_A0_7_2
,
282
SVE_P_LDV_A0_7_3
,
283
SVE_P_LDV_A0_7_4
,
284
SVE_P_LDV_A0_7_5
,
285
SVE_P_LDV_A0_7_6
,
286
SVE_P_LDV_A0_7_7
,
287
// passenger & light duty vehicles, no accel; 14 clusters
288
SVE_P_LDV_A0_14_1
,
289
SVE_P_LDV_A0_14_2
,
290
SVE_P_LDV_A0_14_3
,
291
SVE_P_LDV_A0_14_4
,
292
SVE_P_LDV_A0_14_5
,
293
SVE_P_LDV_A0_14_6
,
294
SVE_P_LDV_A0_14_7
,
295
SVE_P_LDV_A0_14_8
,
296
SVE_P_LDV_A0_14_9
,
297
SVE_P_LDV_A0_14_10
,
298
SVE_P_LDV_A0_14_11
,
299
SVE_P_LDV_A0_14_12
,
300
SVE_P_LDV_A0_14_13
,
301
SVE_P_LDV_A0_14_14
302
};
303
304
extern
StringBijection<SUMOEmissionClass>
SumoEmissionClassStrings
;
305
306
307
// ===========================================================================
308
// method declarations
309
// ===========================================================================
310
311
// ---------------------------------------------------------------------------
312
// abstract vehicle class / purpose
313
// ---------------------------------------------------------------------------
314
/* @brief SUMOVehicleClass is meant to be OR'ed to combine information about vehicle
315
* ownership and vehicle "size" into one int.
316
* These OR'ed values cannot be translated directly into strings with toString().
317
* The names of all base values are concatenated with '|' as a separator.
318
*/
319
extern
std::string
getVehicleClassCompoundName
(
int
id
);
320
321
326
extern
std::string
getAllowedVehicleClassNames
(
SVCPermissions
permissions);
327
328
333
extern
std::vector<std::string>
getAllowedVehicleClassNamesList
(
SVCPermissions
permissions);
334
339
extern
std::pair<std::string, bool>
getPermissionEncoding
(
SVCPermissions
permissions);
340
341
347
extern
SUMOVehicleClass
getVehicleClassID
(
const
std::string& name);
348
353
extern
int
getVehicleClassCompoundID
(
const
std::string& name);
354
361
extern
SVCPermissions
parseVehicleClasses
(
const
std::string& allowedS);
362
363
366
extern
bool
canParseVehicleClasses
(
const
std::string& classes);
367
377
extern
SVCPermissions
parseVehicleClasses
(
const
std::string& allowedS,
const
std::string& disallowedS);
378
379
383
extern
SVCPermissions
parseVehicleClasses
(
const
std::vector<std::string>& allowedS);
384
385
386
// ---------------------------------------------------------------------------
387
// vehicle shape class
388
// ---------------------------------------------------------------------------
393
extern
std::string
getVehicleShapeName
(
SUMOVehicleShape
id
);
394
395
400
extern
SUMOVehicleShape
getVehicleShapeID
(
const
std::string& name);
401
402
403
// ---------------------------------------------------------------------------
404
// emission class
405
// ---------------------------------------------------------------------------
410
extern
std::string
getVehicleEmissionTypeName
(
SUMOEmissionClass
id
);
411
412
417
extern
SUMOEmissionClass
getVehicleEmissionTypeID
(
const
std::string& name);
418
419
424
extern
bool
isRailway
(
SVCPermissions
permissions);
425
426
427
// ---------------------------------------------------------------------------
428
// default vehicle type parameter
429
// ---------------------------------------------------------------------------
430
extern
const
std::string
DEFAULT_VTYPE_ID
;
431
extern
const
SUMOReal
DEFAULT_VEH_MAXSPEED
;
432
extern
const
SUMOReal
DEFAULT_VEH_ACCEL
;
433
extern
const
SUMOReal
DEFAULT_VEH_DECEL
;
434
extern
const
SUMOReal
DEFAULT_VEH_SIGMA
;
435
extern
const
SUMOReal
DEFAULT_VEH_LENGTH
;
436
extern
const
SUMOReal
DEFAULT_VEH_MINGAP
;
437
extern
const
SUMOReal
DEFAULT_VEH_TAU
;
438
extern
const
SUMOVehicleClass
DEFAULT_VEH_CLASS
;
439
extern
const
SUMOReal
DEFAULT_VEH_PROB
;
440
extern
const
SUMOReal
DEFAULT_VEH_SPEEDFACTOR
;
441
extern
const
SUMOReal
DEFAULT_VEH_SPEEDDEV
;
442
extern
const
SUMOReal
DEFAULT_VEH_WIDTH
;
443
extern
const
SUMOReal
DEFAULT_VEH_HEIGHT
;
444
extern
const
SumoXMLTag
DEFAULT_VEH_FOLLOW_MODEL
;
445
extern
const
std::string
DEFAULT_VEH_LANE_CHANGE_MODEL
;
446
extern
const
SUMOVehicleShape
DEFAULT_VEH_SHAPE
;
447
extern
const
SUMOReal
DEFAULT_VEH_TMP1
;
448
extern
const
SUMOReal
DEFAULT_VEH_TMP2
;
449
extern
const
SUMOReal
DEFAULT_VEH_TMP3
;
450
extern
const
SUMOReal
DEFAULT_VEH_TMP4
;
451
extern
const
SUMOReal
DEFAULT_VEH_TMP5
;
452
453
extern
const
SUMOReal
DEFAULT_PERSON_SPEED
;
454
455
#endif
456
457
/****************************************************************************/
458
build
buildd
sumo-0.18~dfsg
src
utils
common
SUMOVehicleClass.h
Generated on Wed Oct 23 2013 01:15:12 for SUMO - Simulation of Urban MObility by
1.8.4