SUMO - Simulation of Urban MObility
MSCFModel_Daniel1.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // The original Krauss (1998) car-following model and parameter
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2012-2016 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef MSCFModel_Daniel1_h
22 #define MSCFModel_Daniel1_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"
35 
36 
37 // ===========================================================================
38 // class definitions
39 // ===========================================================================
44 class MSCFModel_Daniel1 : public MSCFModel {
45 public:
52  MSCFModel_Daniel1(const MSVehicleType* vtype, SUMOReal accel, SUMOReal decel, SUMOReal dawdle, SUMOReal headwayTime,
53  SUMOReal tmp1, SUMOReal tmp2, SUMOReal tmp3, SUMOReal tmp4, SUMOReal tmp5);
54 
55 
58 
59 
62 
68  SUMOReal moveHelper(MSVehicle* const veh, SUMOReal vPos) const;
69 
70 
79  virtual SUMOReal followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const;
80 
81 
89  virtual SUMOReal stopSpeed(const MSVehicle* const veh, const SUMOReal speed, SUMOReal gap2pred) const;
90 
91 
96  virtual int getModelID() const {
97  return SUMO_TAG_CF_DANIEL1;
98  }
99 
100 
105  return myDawdle;
106  }
108 
109 
110 
113 
116  void setMaxDecel(SUMOReal decel) {
117  myDecel = decel;
119  }
120 
121 
125  void setImperfection(SUMOReal imperfection) {
126  myDawdle = imperfection;
127  }
128 
129 
133  void setHeadwayTime(SUMOReal headwayTime) {
134  myHeadwayTime = headwayTime;
135  myTauDecel = myDecel * headwayTime;
136  }
138 
139 
144  virtual MSCFModel* duplicate(const MSVehicleType* vtype) const;
145 
146 private:
152  virtual SUMOReal _vsafe(SUMOReal gap, SUMOReal predSpeed) const;
153 
154 
159  virtual SUMOReal dawdle(SUMOReal speed) const;
160 
161 protected:
164 
167 
170 
171 };
172 
173 #endif /* MSCFModel_Daniel1_H */
174 
SUMOReal moveHelper(MSVehicle *const veh, SUMOReal vPos) const
Applies interaction with stops and lane changing model influences.
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:82
SUMOReal getImperfection() const
Get the driver&#39;s imperfection.
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:60
SUMOReal myHeadwayTime
The driver&#39;s desired time headway (aka reaction time tau) [s].
Definition: MSCFModel.h:472
The car-following model and parameter.
Definition: MSVehicleType.h:74
virtual SUMOReal dawdle(SUMOReal speed) const
Applies driver imperfection (dawdling / sigma)
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.
virtual MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
virtual SUMOReal _vsafe(SUMOReal gap, SUMOReal predSpeed) const
Returns the "safe" velocity.
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].
#define SUMOReal
Definition: config.h:213
virtual int getModelID() const
Returns the model&#39;s name.
~MSCFModel_Daniel1()
Destructor.
SUMOReal myDecel
The vehicle&#39;s maximum deceleration [m/s^2].
Definition: MSCFModel.h:469
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) ...