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-sim.org/
13 // Copyright (C) 2001-2014 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  virtual 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 
97  virtual int getModelID() const {
99  }
100 
101 
106  return myDawdle;
107  }
109 
110 
111 
114 
117  void setMaxDecel(SUMOReal decel) {
118  myDecel = decel;
120  }
121 
122 
126  void setImperfection(SUMOReal imperfection) {
127  myDawdle = imperfection;
128  }
129 
130 
134  void setHeadwayTime(SUMOReal headwayTime) {
135  myHeadwayTime = headwayTime;
136  myTauDecel = myDecel * headwayTime;
137  }
139 
140 
145  virtual MSCFModel* duplicate(const MSVehicleType* vtype) const;
146 
147 private:
153  virtual SUMOReal _vsafe(SUMOReal gap, SUMOReal predSpeed) const;
154 
155 
160  virtual SUMOReal dawdle(SUMOReal speed) const;
161 
162 protected:
165 
168 };
169 
170 #endif /* MSCFModel_KraussOrig1_H */
171 
virtual MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
SUMOReal getImperfection() const
Get the driver's imperfection.
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:77
void setMaxDecel(SUMOReal decel)
Sets a new value for maximum deceleration [m/s^2].
virtual SUMOReal _vsafe(SUMOReal gap, SUMOReal predSpeed) const
Returns the "safe" velocity.
The car-following model abstraction.
Definition: MSCFModel.h:58
virtual int getModelID() const
Returns the model's name.
The original Krauss (1998) car-following model and parameter.
SUMOReal myHeadwayTime
The driver's desired time headway (aka reaction time tau) [s].
Definition: MSCFModel.h:298
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
virtual SUMOReal followSpeed(const MSVehicle *const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const
Computes the vehicle's safe speed (no dawdling)
SUMOReal myDawdle
The vehicle'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's safe speed for approaching a non-moving obstacle (no dawdling) ...
#define SUMOReal
Definition: config.h:215
SUMOReal myDecel
The vehicle's maximum deceleration [m/s^2].
Definition: MSCFModel.h:295