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
MSVehicleType.h
Go to the documentation of this file.
1
/****************************************************************************/
10
// The car-following model and parameter
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 MSVehicleType_h
24
#define MSVehicleType_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 <cassert>
37
#include <map>
38
#include <string>
39
#include <
microsim/cfmodels/MSCFModel.h
>
40
#include <
utils/common/SUMOTime.h
>
41
#include <
utils/common/StdDefs.h
>
42
#include <
utils/common/SUMOVehicleClass.h
>
43
#include <
utils/common/RandHelper.h
>
44
#include <
utils/common/SUMOVTypeParameter.h
>
45
#include <
utils/common/RGBColor.h
>
46
#include <
foreign/mersenne/MersenneTwister.h
>
47
48
49
// ===========================================================================
50
// class declarations
51
// ===========================================================================
52
class
MSLane
;
53
class
BinaryInputDevice
;
54
class
MSCFModel
;
55
class
SUMOVTypeParameter
;
56
57
58
// ===========================================================================
59
// class definitions
60
// ===========================================================================
74
class
MSVehicleType
{
75
public
:
80
MSVehicleType
(
const
SUMOVTypeParameter
& parameter);
81
82
84
virtual
~MSVehicleType
();
85
86
91
bool
wasSet
(
int
what)
const
{
92
return
(
myParameter
.
setParameter
& what) != 0;
93
}
94
95
98
102
const
std::string&
getID
()
const
{
103
return
myParameter
.
id
;
104
}
105
106
110
int
getNumericalID
()
const
{
111
return
myIndex
;
112
}
113
114
118
SUMOReal
getLength
()
const
{
119
return
myParameter
.
length
;
120
}
121
122
126
SUMOReal
getLengthWithGap
()
const
{
127
return
myParameter
.
length
+
myParameter
.
minGap
;
128
}
129
130
134
SUMOReal
getMinGap
()
const
{
135
return
myParameter
.
minGap
;
136
}
137
138
142
inline
const
MSCFModel
&
getCarFollowModel
()
const
{
143
return
*
myCarFollowModel
;
144
}
145
146
150
inline
MSCFModel
&
getCarFollowModel
() {
151
return
*
myCarFollowModel
;
152
}
153
154
155
inline
LaneChangeModel
getLaneChangeModel
()
const
{
156
return
myParameter
.
lcModel
;
157
}
158
159
163
SUMOReal
getMaxSpeed
()
const
{
164
return
myParameter
.
maxSpeed
;
165
}
166
167
171
SUMOReal
computeChosenSpeedDeviation
(
MTRand
& rng,
const
SUMOReal
minDevFactor = 0.2)
const
;
172
173
177
SUMOReal
getDefaultProbability
()
const
{
178
return
myParameter
.
defaultProbability
;
179
}
180
181
186
SUMOVehicleClass
getVehicleClass
()
const
{
187
return
myParameter
.
vehicleClass
;
188
}
189
190
195
SUMOEmissionClass
getEmissionClass
()
const
{
196
return
myParameter
.
emissionClass
;
197
}
198
199
203
const
RGBColor
&
getColor
()
const
{
204
return
myParameter
.
color
;
205
}
206
207
211
SUMOReal
getSpeedFactor
()
const
{
212
return
myParameter
.
speedFactor
;
213
}
214
215
219
SUMOReal
getSpeedDeviation
()
const
{
220
return
myParameter
.
speedDev
;
221
}
222
223
227
SUMOReal
getImpatience
()
const
{
228
return
myParameter
.
impatience
;
229
}
231
232
233
236
240
SUMOReal
getWidth
()
const
{
241
return
myParameter
.
width
;
242
}
243
247
SUMOReal
getHeight
()
const
{
248
return
myParameter
.
height
;
249
}
250
255
SUMOVehicleShape
getGuiShape
()
const
{
256
return
myParameter
.
shape
;
257
}
258
262
std::string
getOSGFile
()
const
{
263
return
myParameter
.
osgFile
;
264
}
265
266
270
std::string
getImgFile
()
const
{
271
return
myParameter
.
imgFile
;
272
}
273
275
276
279
287
void
setLength
(
const
SUMOReal
& length);
288
289
297
void
setMinGap
(
const
SUMOReal
& minGap);
298
299
307
void
setMaxSpeed
(
const
SUMOReal
& maxSpeed);
308
309
313
void
setVClass
(
SUMOVehicleClass
vclass);
314
315
323
void
setDefaultProbability
(
const
SUMOReal
& prob);
324
325
333
void
setSpeedFactor
(
const
SUMOReal
& factor);
334
335
343
void
setSpeedDeviation
(
const
SUMOReal
& dev);
344
345
349
void
setEmissionClass
(
SUMOEmissionClass
eclass);
350
351
355
void
setColor
(
const
RGBColor
& color);
356
357
365
void
setWidth
(
const
SUMOReal
& width);
366
367
371
void
setShape
(
SUMOVehicleShape
shape);
372
373
377
void
setImpatience
(
const
SUMOReal
impatience);
379
380
381
384
390
static
MSVehicleType
*
build
(
SUMOVTypeParameter
& from);
391
392
398
static
MSVehicleType
*
build
(
const
std::string&
id
,
const
MSVehicleType
* from);
400
401
405
bool
amVehicleSpecific
()
const
{
406
return
myOriginalType
!= 0;
407
}
408
409
410
const
SUMOVTypeParameter
&
getParameter
()
const
{
411
return
myParameter
;
412
}
413
414
415
private
:
417
SUMOVTypeParameter
myParameter
;
418
420
const
int
myIndex
;
421
423
MSCFModel
*
myCarFollowModel
;
424
426
const
MSVehicleType
*
myOriginalType
;
427
429
static
int
myNextIndex
;
430
431
432
private
:
434
MSVehicleType
(
const
MSVehicleType
&);
435
437
MSVehicleType
&
operator=
(
const
MSVehicleType
&);
438
439
};
440
441
442
#endif
443
444
/****************************************************************************/
445
tmp
buildd
sumo-0.21.0+dfsg
src
microsim
MSVehicleType.h
Generated on Thu Nov 20 2014 19:49:56 for SUMO - Simulation of Urban MObility by
1.8.1.2