SUMO - Simulation of Urban MObility
 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.sourceforge.net/
12 // Copyright (C) 2001-2013 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 <microsim/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, 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 (myExpFactor > 0.) {
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, SUMOReal gap2pred, SUMOReal mySpeed, SUMOReal predSpeed, SUMOReal desSpeed) const;
159 
160  SUMOReal desiredSpeed(const MSVehicle* const veh) const {
161  return MIN2(myType->getMaxSpeed(), veh->getLane()->getVehicleMaxSpeed(veh));
162  }
163 
164 
165 private:
168 
171 
174 
177 
179  const int myIterations;
180 
183 
184 private:
187 };
188 
189 #endif /* MSCFMODEL_IDM_H */