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:
58  MSCFModel_IDM(const MSVehicleType* vtype, double accel, double decel, double emergencyDecel,
59  double headwayTime, double delta, double internalStepping);
60 
61 
70  MSCFModel_IDM(const MSVehicleType* vtype, double accel, double decel, double emergencyDecel,
71  double headwayTime, double adaptationFactor, double adaptationTime,
72  double internalStepping);
73 
74 
77 
78 
81 
87  double moveHelper(MSVehicle* const veh, double vPos) const;
88 
89 
98  double followSpeed(const MSVehicle* const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel) const;
99 
100 
108  double stopSpeed(const MSVehicle* const veh, const double speed, double gap2pred) const;
109 
110 
120  double interactionGap(const MSVehicle* const , double vL) const;
121 
122 
127  int getModelID() const {
129  }
131 
132 
133 
138  MSCFModel* duplicate(const MSVehicleType* vtype) const;
139 
140 
142  if (myAdaptationFactor != 1.) {
143  return new VehicleVariables();
144  }
145  return 0;
146  }
147 
148 
149 private:
151  public:
155  };
156 
157 
158 private:
159  double _v(const MSVehicle* const veh, const double gap2pred, const double mySpeed,
160  const double predSpeed, const double desSpeed, const bool respectMinGap = true) const;
161 
162 
163 private:
165  const double myDelta;
166 
168  const double myAdaptationFactor;
169 
171  const double myAdaptationTime;
172 
174  const int myIterations;
175 
177  const double myTwoSqrtAccelDecel;
178 
179 private:
182 };
183 
184 #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.
MSCFModel_IDM(const MSVehicleType *vtype, double accel, double decel, double emergencyDecel, double headwayTime, double delta, double internalStepping)
Constructor.
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.
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.
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...