SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSCFModel_Daniel1.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // The original Krauss (1998) car-following model and parameter
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
10 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef MSCFModel_Daniel1_h
21 #define MSCFModel_Daniel1_h
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include "MSCFModel.h"
34 
35 
36 // ===========================================================================
37 // class definitions
38 // ===========================================================================
43 class MSCFModel_Daniel1 : public MSCFModel {
44 public:
51  MSCFModel_Daniel1(const MSVehicleType* vtype, SUMOReal accel, SUMOReal decel, SUMOReal dawdle, SUMOReal headwayTime,
52  SUMOReal tmp1, SUMOReal tmp2, SUMOReal tmp3, SUMOReal tmp4, SUMOReal tmp5);
53 
54 
57 
58 
61 
67  SUMOReal moveHelper(MSVehicle* const veh, SUMOReal vPos) const;
68 
69 
78  virtual SUMOReal followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const;
79 
80 
88  virtual SUMOReal stopSpeed(const MSVehicle* const veh, const SUMOReal speed, SUMOReal gap2pred) const;
89 
90 
95  virtual int getModelID() const {
96  return SUMO_TAG_CF_DANIEL1;
97  }
98 
99 
104  return myDawdle;
105  }
107 
108 
109 
112 
115  void setMaxDecel(SUMOReal decel) {
116  myDecel = decel;
118  }
119 
120 
124  void setImperfection(SUMOReal imperfection) {
125  myDawdle = imperfection;
126  }
127 
128 
132  void setHeadwayTime(SUMOReal headwayTime) {
133  myHeadwayTime = headwayTime;
134  myTauDecel = myDecel * headwayTime;
135  }
137 
138 
143  virtual MSCFModel* duplicate(const MSVehicleType* vtype) const;
144 
145 private:
151  virtual SUMOReal _vsafe(SUMOReal gap, SUMOReal predSpeed) const;
152 
153 
158  virtual SUMOReal dawdle(SUMOReal speed) const;
159 
160 protected:
163 
166 
169 
170 };
171 
172 #endif /* MSCFModel_Daniel1_H */
173 
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:77
SUMOReal myTauDecel
The precomputed value for myDecel*myTau.
SUMOReal myDawdle
The vehicle&#39;s dawdle-parameter. 0 for no dawdling, 1 for max.
The car-following model abstraction.
Definition: MSCFModel.h:58
virtual SUMOReal _vsafe(SUMOReal gap, SUMOReal predSpeed) const
Returns the &quot;safe&quot; velocity.
virtual int getModelID() const
Returns the model&#39;s name.
SUMOReal myHeadwayTime
The driver&#39;s desired time headway (aka reaction time tau) [s].
Definition: MSCFModel.h:291
SUMOReal moveHelper(MSVehicle *const veh, SUMOReal vPos) const
Applies interaction with stops and lane changing model influences.
The car-following model and parameter.
Definition: MSVehicleType.h:74
void setMaxDecel(SUMOReal decel)
Sets a new value for maximum deceleration [m/s^2].
MSCFModel_Daniel1(const MSVehicleType *vtype, SUMOReal accel, SUMOReal decel, SUMOReal dawdle, SUMOReal headwayTime, SUMOReal tmp1, SUMOReal tmp2, SUMOReal tmp3, SUMOReal tmp4, SUMOReal tmp5)
Constructor.
SUMOReal getImperfection() const
Get the driver&#39;s imperfection.
void setImperfection(SUMOReal imperfection)
Sets a new value for driver imperfection.
SUMOReal myTmp1
temporary (testing) parameter
The original Krauss (1998) car-following model and parameter.
virtual SUMOReal followSpeed(const MSVehicle *const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const
Computes the vehicle&#39;s safe speed (no dawdling)
void setHeadwayTime(SUMOReal headwayTime)
Sets a new value for driver reaction time [s].
virtual 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) ...
#define SUMOReal
Definition: config.h:221
virtual SUMOReal dawdle(SUMOReal speed) const
Applies driver imperfection (dawdling / sigma)
~MSCFModel_Daniel1()
Destructor.
SUMOReal myDecel
The vehicle&#39;s maximum deceleration [m/s^2].
Definition: MSCFModel.h:288
virtual MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.