Eclipse SUMO - Simulation of Urban MObility
MSCFModel_KraussOrig1.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
18 // The original Krauss (1998) car-following model and parameter
19 /****************************************************************************/
20 #ifndef MSCFModel_KraussOrig1_h
21 #define MSCFModel_KraussOrig1_h
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include "MSCFModel.h"
30 
31 
32 // ===========================================================================
33 // class definitions
34 // ===========================================================================
40 public:
45 
46 
49 
50 
54  double patchSpeedBeforeLC(const MSVehicle* veh, double vMin, double vMax) const;
55 
64  double followSpeed(const MSVehicle* const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle* const pred = 0) const;
65 
66 
74  virtual double stopSpeed(const MSVehicle* const veh, const double speed, double gap2pred) const;
75 
76 
81  virtual int getModelID() const {
83  }
84 
85 
89  double getImperfection() const {
90  return myDawdle;
91  }
93 
94 
95 
98 
101  void setMaxDecel(double decel) {
102  myDecel = decel;
104  }
105 
106 
110  void setImperfection(double imperfection) {
111  myDawdle = imperfection;
112  }
113 
114 
118  void setHeadwayTime(double headwayTime) {
119  myHeadwayTime = headwayTime;
120  myTauDecel = myDecel * headwayTime;
121  }
123 
124 
129  virtual MSCFModel* duplicate(const MSVehicleType* vtype) const;
130 
131 protected:
138  virtual double vsafe(double gap, double predSpeed, double predMaxDecel) const;
139 
140 
145  virtual double dawdle(double speed, std::mt19937* rng) const;
146 
147 protected:
149  double myDawdle;
150 
152  double myTauDecel;
153 };
154 
155 #endif /* MSCFModel_KraussOrig1_H */
156 
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:80
double patchSpeedBeforeLC(const MSVehicle *veh, double vMin, double vMax) const
apply custom speed adaptations within the given speed bounds
The car-following model abstraction.
Definition: MSCFModel.h:57
The original Krauss (1998) car-following model and parameter.
The car-following model and parameter.
Definition: MSVehicleType.h:66
void setHeadwayTime(double headwayTime)
Sets a new value for desired headway [s].
MSCFModel_KraussOrig1(const MSVehicleType *vtype)
Constructor.
virtual double dawdle(double speed, std::mt19937 *rng) const
Applies driver imperfection (dawdling / sigma)
virtual int getModelID() const
Returns the model&#39;s name.
double myDawdle
The vehicle&#39;s dawdle-parameter. 0 for no dawdling, 1 for max.
double getImperfection() const
Get the driver&#39;s imperfection.
double myDecel
The vehicle&#39;s maximum deceleration [m/s^2].
Definition: MSCFModel.h:619
virtual double vsafe(double gap, double predSpeed, double predMaxDecel) const
Returns the "safe" velocity.
virtual 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) ...
void setMaxDecel(double decel)
Sets a new value for maximum deceleration [m/s^2].
void setImperfection(double imperfection)
Sets a new value for driver imperfection.
double followSpeed(const MSVehicle *const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle *const pred=0) const
Computes the vehicle&#39;s safe speed (no dawdling)
virtual MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
double myTauDecel
The precomputed value for myDecel*myTau.
double myHeadwayTime
The driver&#39;s desired time headway (aka reaction time tau) [s].
Definition: MSCFModel.h:628