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.sourceforge.net/
13
// Copyright (C) 2001-2012 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 "
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
SUMOReal
getLength
()
const
{
111
return
myParameter
.
length
;
112
}
113
114
118
SUMOReal
getLengthWithGap
()
const
{
119
return
myParameter
.
length
+
myParameter
.
minGap
;
120
}
121
122
126
SUMOReal
getMinGap
()
const
{
127
return
myParameter
.
minGap
;
128
}
129
130
134
inline
const
MSCFModel
&
getCarFollowModel
()
const
{
135
return
*
myCarFollowModel
;
136
}
137
138
142
inline
MSCFModel
&
getCarFollowModel
() {
143
return
*
myCarFollowModel
;
144
}
145
146
150
SUMOReal
getMaxSpeed
()
const
{
151
return
myParameter
.
maxSpeed
;
152
}
153
154
158
SUMOReal
computeChosenSpeedDeviation
(
MTRand
& rng)
const
;
159
160
164
SUMOReal
getDefaultProbability
()
const
{
165
return
myParameter
.
defaultProbability
;
166
}
167
168
173
SUMOVehicleClass
getVehicleClass
()
const
{
174
return
myParameter
.
vehicleClass
;
175
}
176
177
182
SUMOEmissionClass
getEmissionClass
()
const
{
183
return
myParameter
.
emissionClass
;
184
}
185
186
190
const
RGBColor
&
getColor
()
const
{
191
return
myParameter
.
color
;
192
}
193
194
198
SUMOReal
getSpeedFactor
()
const
{
199
return
myParameter
.
speedFactor
;
200
}
201
202
206
SUMOReal
getSpeedDeviation
()
const
{
207
return
myParameter
.
speedDev
;
208
}
210
211
212
215
219
SUMOReal
getWidth
()
const
{
220
return
myParameter
.
width
;
221
}
222
226
SUMOReal
getHeight
()
const
{
227
return
myParameter
.
height
;
228
}
229
234
SUMOVehicleShape
getGuiShape
()
const
{
235
return
myParameter
.
shape
;
236
}
237
241
std::string
getOSGFile
()
const
{
242
return
myParameter
.
osgFile
;
243
}
244
245
249
std::string
getImgFile
()
const
{
250
return
myParameter
.
imgFile
;
251
}
252
254
255
256
257
258
260
void
saveState
(std::ostream& os);
261
262
263
266
274
void
setLength
(
const
SUMOReal
& length);
275
276
284
void
setMinGap
(
const
SUMOReal
& minGap);
285
286
294
void
setMaxSpeed
(
const
SUMOReal
& maxSpeed);
295
296
300
void
setVClass
(
SUMOVehicleClass
vclass);
301
302
310
void
setDefaultProbability
(
const
SUMOReal
& prob);
311
312
320
void
setSpeedFactor
(
const
SUMOReal
& factor);
321
322
330
void
setSpeedDeviation
(
const
SUMOReal
& dev);
331
332
336
void
setEmissionClass
(
SUMOEmissionClass
eclass);
337
338
342
void
setColor
(
const
RGBColor
& color);
343
344
352
void
setWidth
(
const
SUMOReal
& width);
353
354
358
void
setShape
(
SUMOVehicleShape
shape);
360
361
362
365
371
static
MSVehicleType
*
build
(
SUMOVTypeParameter
& from);
372
373
379
static
MSVehicleType
*
build
(
const
std::string&
id
,
const
MSVehicleType
* from);
381
382
386
bool
amVehicleSpecific
()
const
{
387
return
myOriginalType
!= 0;
388
}
389
390
391
private
:
393
SUMOVTypeParameter
myParameter
;
394
396
MSCFModel
*
myCarFollowModel
;
397
399
const
MSVehicleType
*
myOriginalType
;
400
401
402
private
:
404
MSVehicleType
(
const
MSVehicleType
&);
405
407
MSVehicleType
&
operator=
(
const
MSVehicleType
&);
408
409
};
410
411
412
#endif
413
414
/****************************************************************************/
415
build
buildd
sumo-0.16.0~dfsg
src
microsim
MSVehicleType.h
Generated on Tue Apr 16 2013 01:32:18 for SUMO - Simulation of Urban MObility by
1.8.3.1