SUMO - Simulation of Urban MObility
MSCFModel_KraussOrig1.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // The original Krauss (1998) car-following model and parameter
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
13 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef MSCFModel_KraussOrig1_h
24 #define MSCFModel_KraussOrig1_h
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include "MSCFModel.h"
37 
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
47 public:
54  MSCFModel_KraussOrig1(const MSVehicleType* vtype, SUMOReal accel, SUMOReal decel, SUMOReal dawdle, SUMOReal headwayTime);
55 
56 
59 
60 
63 
69  SUMOReal moveHelper(MSVehicle* const veh, SUMOReal vPos) const;
70 
71 
80  SUMOReal followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const;
81 
82 
90  virtual SUMOReal stopSpeed(const MSVehicle* const veh, const SUMOReal speed, SUMOReal gap2pred) const;
91 
92 
105  SUMOReal insertionFollowSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const;
106 
107 
112  virtual int getModelID() const {
114  }
115 
116 
121  return myDawdle;
122  }
124 
125 
126 
129 
132  void setMaxDecel(SUMOReal decel) {
133  myDecel = decel;
135  }
136 
137 
141  void setImperfection(SUMOReal imperfection) {
142  myDawdle = imperfection;
143  }
144 
145 
149  void setHeadwayTime(SUMOReal headwayTime) {
150  myHeadwayTime = headwayTime;
151  myTauDecel = myDecel * headwayTime;
152  }
154 
155 
160  virtual MSCFModel* duplicate(const MSVehicleType* vtype) const;
161 
162 private:
169  virtual SUMOReal vsafe(SUMOReal gap, SUMOReal predSpeed, SUMOReal predMaxDecel) const;
170 
171 
176  virtual SUMOReal dawdle(SUMOReal speed) const;
177 
178 protected:
181 
184 };
185 
186 #endif /* MSCFModel_KraussOrig1_H */
187 
virtual MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
SUMOReal getImperfection() const
Get the driver&#39;s imperfection.
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:80
void setMaxDecel(SUMOReal decel)
Sets a new value for maximum deceleration [m/s^2].
The car-following model abstraction.
Definition: MSCFModel.h:59
virtual SUMOReal vsafe(SUMOReal gap, SUMOReal predSpeed, SUMOReal predMaxDecel) const
Returns the "safe" velocity.
SUMOReal insertionFollowSpeed(const MSVehicle *const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const
Computes the vehicle&#39;s safe speed (no dawdling) This method is used during the insertion stage...
virtual int getModelID() const
Returns the model&#39;s name.
The original Krauss (1998) car-following model and parameter.
SUMOReal myHeadwayTime
The driver&#39;s desired time headway (aka reaction time tau) [s].
Definition: MSCFModel.h:353
SUMOReal myTauDecel
The precomputed value for myDecel*myTau.
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
SUMOReal followSpeed(const MSVehicle *const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const
Computes the vehicle&#39;s safe speed (no dawdling)
SUMOReal myDawdle
The vehicle&#39;s dawdle-parameter. 0 for no dawdling, 1 for max.
void setHeadwayTime(SUMOReal headwayTime)
Sets a new value for driver reaction time [s].
virtual SUMOReal dawdle(SUMOReal speed) const
Applies driver imperfection (dawdling / sigma)
void setImperfection(SUMOReal imperfection)
Sets a new value for driver imperfection.
MSCFModel_KraussOrig1(const MSVehicleType *vtype, SUMOReal accel, SUMOReal decel, SUMOReal dawdle, SUMOReal headwayTime)
Constructor.
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:213
SUMOReal myDecel
The vehicle&#39;s maximum deceleration [m/s^2].
Definition: MSCFModel.h:350