SUMO - Simulation of Urban MObility
MSCFModel_IDM.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 // The Intelligent Driver Model (IDM) car-following model
20 /****************************************************************************/
21 #ifndef MSCFMODEL_IDM_H
22 #define MSCFMODEL_IDM_H
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include "MSCFModel.h"
34 #include <microsim/MSLane.h>
35 #include <microsim/MSVehicle.h>
36 #include <microsim/MSVehicleType.h>
38 
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
47 class MSCFModel_IDM : public MSCFModel {
48 public:
58  MSCFModel_IDM(const MSVehicleType* vtype, double accel, double decel, double emergencyDecel, double apparentDecel,
59  double headwayTime, double delta, double internalStepping);
60 
61 
72  MSCFModel_IDM(const MSVehicleType* vtype, double accel, double decel, double emergencyDecel, double apparentDecel,
73  double headwayTime, double adaptationFactor, double adaptationTime,
74  double internalStepping);
75 
76 
79 
80 
83 
89  double moveHelper(MSVehicle* const veh, double vPos) const;
90 
91 
100  double followSpeed(const MSVehicle* const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel) const;
101 
102 
110  double stopSpeed(const MSVehicle* const veh, const double speed, double gap2pred) const;
111 
112 
122  double interactionGap(const MSVehicle* const , double vL) const;
123 
124 
129  int getModelID() const {
131  }
133 
134 
135 
140  MSCFModel* duplicate(const MSVehicleType* vtype) const;
141 
142 
144  if (myAdaptationFactor != 1.) {
145  return new VehicleVariables();
146  }
147  return 0;
148  }
149 
150 
151 private:
153  public:
157  };
158 
159 
160 private:
161  double _v(const MSVehicle* const veh, const double gap2pred, const double mySpeed,
162  const double predSpeed, const double desSpeed, const bool respectMinGap = true) const;
163 
164 
165 private:
167  const double myDelta;
168 
170  const double myAdaptationFactor;
171 
173  const double myAdaptationTime;
174 
176  const int myIterations;
177 
179  const double myTwoSqrtAccelDecel;
180 
181 private:
184 };
185 
186 #endif /* MSCFMODEL_IDM_H */
~MSCFModel_IDM()
Destructor.
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:83
double interactionGap(const MSVehicle *const, double vL) const
Returns the maximum gap at which an interaction between both vehicles occurs.
double moveHelper(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences.
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
double followSpeed(const MSVehicle *const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel) const
Computes the vehicle&#39;s safe speed (no dawdling)
const double myDelta
The IDM delta exponent.
The Intelligent Driver Model (IDM) car-following model.
Definition: MSCFModel_IDM.h:47
The car-following model abstraction.
Definition: MSCFModel.h:59
const double myAdaptationFactor
The IDMM adaptation factor beta.
The car-following model and parameter.
Definition: MSVehicleType.h:72
MSCFModel_IDM & operator=(const MSCFModel_IDM &s)
Invalidated assignment operator.
const double myAdaptationTime
The IDMM adaptation time tau.
double levelOfService
state variable for remembering speed deviation history (lambda)
double _v(const MSVehicle *const veh, const double gap2pred, const double mySpeed, const double predSpeed, const double desSpeed, const bool respectMinGap=true) const
const double myTwoSqrtAccelDecel
A computational shortcut.
MSCFModel_IDM(const MSVehicleType *vtype, double accel, double decel, double emergencyDecel, double apparentDecel, double headwayTime, double delta, double internalStepping)
Constructor.
double stopSpeed(const MSVehicle *const veh, const double speed, double gap2pred) const
Computes the vehicle&#39;s safe speed for approaching a non-moving obstacle (no dawdling) ...
const int myIterations
The number of iterations in speed calculations.
int getModelID() const
Returns the model&#39;s name.
VehicleVariables * createVehicleVariables() const
Returns model specific values which are stored inside a vehicle and must be used with casting...