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-sim.org/
12
// Copyright (C) 2001-2014 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 "
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,
const
SUMOReal
speed,
SUMOReal
gap2pred)
const
;
108
109
119
SUMOReal
interactionGap
(
const
MSVehicle
*
const
,
SUMOReal
vL)
const
;
120
121
126
int
getModelID
()
const
{
127
return
myAdaptationFactor
== 1. ?
SUMO_TAG_CF_IDM
:
SUMO_TAG_CF_IDMM
;
128
}
130
131
132
137
MSCFModel
*
duplicate
(
const
MSVehicleType
* vtype)
const
;
138
139
140
VehicleVariables
*
createVehicleVariables
()
const
{
141
if
(
myAdaptationFactor
!= 1.) {
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,
const
SUMOReal
gap2pred,
const
SUMOReal
mySpeed,
159
const
SUMOReal
predSpeed,
const
SUMOReal
desSpeed,
const
bool
respectMinGap =
true
)
const
;
160
161
SUMOReal
desiredSpeed
(
const
MSVehicle
*
const
veh)
const
{
162
return
MIN2
(
myType
->
getMaxSpeed
(), veh->
getLane
()->
getVehicleMaxSpeed
(veh));
163
}
164
165
166
private
:
168
const
SUMOReal
myDelta
;
169
171
const
SUMOReal
myAdaptationFactor
;
172
174
const
SUMOReal
myAdaptationTime
;
175
177
const
int
myIterations
;
178
180
const
SUMOReal
myTwoSqrtAccelDecel
;
181
182
private
:
184
MSCFModel_IDM
&
operator=
(
const
MSCFModel_IDM
& s);
185
};
186
187
#endif
/* MSCFMODEL_IDM_H */
tmp
buildd
sumo-0.21.0+dfsg
src
microsim
cfmodels
MSCFModel_IDM.h
Generated on Thu Nov 20 2014 19:49:54 for SUMO - Simulation of Urban MObility by
1.8.1.2