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-2017 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:
59  MSCFModel_IDM(const MSVehicleType* vtype, double accel, double decel, double emergencyDecel, double apparentDecel,
60  double headwayTime, double delta, double internalStepping);
61 
62 
73  MSCFModel_IDM(const MSVehicleType* vtype, double accel, double decel, double emergencyDecel, double apparentDecel,
74  double headwayTime, double adaptationFactor, double adaptationTime,
75  double internalStepping);
76 
77 
80 
81 
84 
90  double moveHelper(MSVehicle* const veh, double vPos) const;
91 
92 
101  double followSpeed(const MSVehicle* const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel) const;
102 
103 
111  double stopSpeed(const MSVehicle* const veh, const double speed, double gap2pred) const;
112 
113 
123  double interactionGap(const MSVehicle* const , double vL) const;
124 
125 
130  int getModelID() const {
132  }
134 
135 
136 
141  MSCFModel* duplicate(const MSVehicleType* vtype) const;
142 
143 
145  if (myAdaptationFactor != 1.) {
146  return new VehicleVariables();
147  }
148  return 0;
149  }
150 
151 
152 private:
154  public:
158  };
159 
160 
161 private:
162  double _v(const MSVehicle* const veh, const double gap2pred, const double mySpeed,
163  const double predSpeed, const double desSpeed, const bool respectMinGap = true) const;
164 
165 
166 private:
168  const double myDelta;
169 
171  const double myAdaptationFactor;
172 
174  const double myAdaptationTime;
175 
177  const int myIterations;
178 
180  const double myTwoSqrtAccelDecel;
181 
182 private:
185 };
186 
187 #endif /* MSCFMODEL_IDM_H */
double followSpeed(const MSVehicle *const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel) const
Computes the vehicle&#39;s safe speed (no dawdling)
~MSCFModel_IDM()
Destructor.
double _v(const MSVehicle *const veh, const double gap2pred, const double mySpeed, const double predSpeed, const double desSpeed, const bool respectMinGap=true) const
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:83
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 double myDelta
The IDM delta exponent.
The Intelligent Driver Model (IDM) car-following model.
Definition: MSCFModel_IDM.h:48
The car-following model abstraction.
Definition: MSCFModel.h:60
const double myAdaptationFactor
The IDMM adaptation factor beta.
The car-following model and parameter.
Definition: MSVehicleType.h:73
MSCFModel_IDM & operator=(const MSCFModel_IDM &s)
Invalidated assignment operator.
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
const double myAdaptationTime
The IDMM adaptation time tau.
double levelOfService
state variable for remembering speed deviation history (lambda)
double moveHelper(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences.
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 interactionGap(const MSVehicle *const , double 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.
VehicleVariables * createVehicleVariables() const
Returns model specific values which are stored inside a vehicle and must be used with casting...