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-2015 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'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's safe speed (no dawdling) This method is used during the insertion stage...
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:351
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'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:218
SUMOReal myDecel
The vehicle's maximum deceleration [m/s^2].
Definition: MSCFModel.h:348