SUMO - Simulation of Urban MObility
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.dlr.de/
12 // Copyright (C) 2001-2016 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>
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 
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 {
128  }
130 
131 
132 
137  MSCFModel* duplicate(const MSVehicleType* vtype) const;
138 
139 
141  if (myAdaptationFactor != 1.) {
142  return new VehicleVariables();
143  }
144  return 0;
145  }
146 
147 
148 private:
150  public:
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 
162 private:
165 
168 
171 
173  const int myIterations;
174 
177 
178 private:
181 };
182 
183 #endif /* MSCFMODEL_IDM_H */
SUMOReal stopSpeed(const MSVehicle *const veh, const SUMOReal speed, SUMOReal gap2pred) const
Computes the vehicle&#39;s safe speed for approaching a non-moving obstacle (no dawdling) ...
~MSCFModel_IDM()
Destructor.
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:81
SUMOReal moveHelper(MSVehicle *const veh, SUMOReal vPos) const
Applies interaction with stops and lane changing model influences.
The Intelligent Driver Model (IDM) car-following model.
Definition: MSCFModel_IDM.h:48
The car-following model abstraction.
Definition: MSCFModel.h:59
SUMOReal followSpeed(const MSVehicle *const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const
Computes the vehicle&#39;s safe speed (no dawdling)
const SUMOReal myDelta
The IDM delta exponent.
SUMOReal levelOfService
state variable for remembering speed deviation history (lambda)
The car-following model and parameter.
Definition: MSVehicleType.h:74
MSCFModel_IDM & operator=(const MSCFModel_IDM &s)
Invalidated assignment operator.
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
MSCFModel_IDM(const MSVehicleType *vtype, SUMOReal accel, SUMOReal decel, SUMOReal headwayTime, SUMOReal delta, SUMOReal internalStepping)
Constructor.
const SUMOReal myTwoSqrtAccelDecel
A computational shortcut.
SUMOReal interactionGap(const MSVehicle *const , SUMOReal vL) const
Returns the maximum gap at which an interaction between both vehicles occurs.
const int myIterations
The number of iterations in speed calculations.
int getModelID() const
Returns the model&#39;s name.
SUMOReal _v(const MSVehicle *const veh, const SUMOReal gap2pred, const SUMOReal mySpeed, const SUMOReal predSpeed, const SUMOReal desSpeed, const bool respectMinGap=true) const
#define SUMOReal
Definition: config.h:213
VehicleVariables * createVehicleVariables() const
Returns model specific values which are stored inside a vehicle and must be used with casting...
const SUMOReal myAdaptationFactor
The IDMM adaptation factor beta.
const SUMOReal myAdaptationTime
The IDMM adaptation time tau.