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
MSCFModel_IDM.h
Go to the documentation of this file.
1
/****************************************************************************/
9
// The Intelligent Driver Model (IDM) car-following model
10
/****************************************************************************/
11
// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
12
// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
13
/****************************************************************************/
14
//
15
// This file is part of SUMO.
16
// SUMO is free software: you can redistribute it and/or modify
17
// it under the terms of the GNU General Public License as published by
18
// the Free Software Foundation, either version 3 of the License, or
19
// (at your option) any later version.
20
//
21
/****************************************************************************/
22
#ifndef MSCFMODEL_IDM_H
23
#define MSCFMODEL_IDM_H
24
25
// ===========================================================================
26
// included modules
27
// ===========================================================================
28
#ifdef _MSC_VER
29
#include <
windows_config.h
>
30
#else
31
#include <
config.h
>
32
#endif
33
34
#include <
microsim/MSCFModel.h
>
35
#include <
microsim/MSLane.h
>
36
#include <
microsim/MSVehicle.h
>
37
#include <
microsim/MSVehicleType.h
>
38
#include <
utils/xml/SUMOXMLDefinitions.h
>
39
40
41
// ===========================================================================
42
// class definitions
43
// ===========================================================================
48
class
MSCFModel_IDM
:
public
MSCFModel
{
49
public
:
57
MSCFModel_IDM
(
const
MSVehicleType
* vtype,
SUMOReal
accel,
SUMOReal
decel,
58
SUMOReal
headwayTime,
SUMOReal
delta,
SUMOReal
internalStepping);
59
60
69
MSCFModel_IDM
(
const
MSVehicleType
* vtype,
SUMOReal
accel,
SUMOReal
decel,
70
SUMOReal
headwayTime,
SUMOReal
adaptationFactor,
SUMOReal
adaptationTime,
71
SUMOReal
internalStepping);
72
73
75
~MSCFModel_IDM
();
76
77
80
86
SUMOReal
moveHelper
(
MSVehicle
*
const
veh,
SUMOReal
vPos)
const
;
87
88
97
SUMOReal
followSpeed
(
const
MSVehicle
*
const
veh,
SUMOReal
speed,
SUMOReal
gap2pred,
SUMOReal
predSpeed,
SUMOReal
predMaxDecel)
const
;
98
99
107
SUMOReal
stopSpeed
(
const
MSVehicle
*
const
veh,
SUMOReal
gap2pred)
const
;
108
109
119
SUMOReal
interactionGap
(
const
MSVehicle
*
const
,
SUMOReal
vL)
const
;
120
121
126
int
getModelID
()
const
{
127
return
myExpFactor
> 0. ?
SUMO_TAG_CF_IDMM
:
SUMO_TAG_CF_IDM
;
128
}
130
131
132
137
MSCFModel
*
duplicate
(
const
MSVehicleType
* vtype)
const
;
138
139
140
VehicleVariables
*
createVehicleVariables
()
const
{
141
if
(
myExpFactor
> 0.) {
142
return
new
VehicleVariables
();
143
}
144
return
0;
145
}
146
147
148
private
:
149
class
VehicleVariables
:
public
MSCFModel::VehicleVariables
{
150
public
:
151
VehicleVariables
() :
levelOfService
(1.) {}
153
SUMOReal
levelOfService
;
154
};
155
156
157
private
:
158
SUMOReal
_v
(
const
MSVehicle
*
const
veh,
SUMOReal
gap2pred,
SUMOReal
mySpeed,
SUMOReal
predSpeed,
SUMOReal
desSpeed)
const
;
159
160
SUMOReal
desiredSpeed
(
const
MSVehicle
*
const
veh)
const
{
161
return
MIN2
(
myType
->
getMaxSpeed
(), veh->
getLane
()->
getMaxSpeed
());
162
}
163
164
165
private
:
167
const
SUMOReal
myDelta
;
168
170
const
SUMOReal
myAdaptationFactor
;
171
173
const
SUMOReal
myAdaptationTime
;
174
176
const
SUMOReal
myExpFactor
;
177
179
const
int
myIterations
;
180
182
const
SUMOReal
myTwoSqrtAccelDecel
;
183
};
184
185
#endif
/* MSCFMODEL_IDM_H */
tmp
buildd
sumo-0.15.0~dfsg
src
microsim
cfmodels
MSCFModel_IDM.h
Generated on Sun May 27 2012 14:52:05 for SUMO - Simulation of Urban MObility by
1.8.1