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-2022 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
21 // The original Krauss (1998) car-following model and parameter
22 /****************************************************************************/
23 #pragma once
24 #include <config.h>
25 
26 #include "MSCFModel.h"
28 
29 
30 // ===========================================================================
31 // class definitions
32 // ===========================================================================
38 public:
43 
44 
47 
48 
52  double patchSpeedBeforeLC(const MSVehicle* veh, double vMin, double vMax) const;
53 
62  double followSpeed(const MSVehicle* const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle* const pred = 0) const;
63 
64 
72  virtual double stopSpeed(const MSVehicle* const veh, const double speed, double gap2pred, double decel) const;
73 
74 
79  virtual int getModelID() const {
81  }
82 
83 
87  double getImperfection() const {
88  return myDawdle;
89  }
91 
92 
93 
96 
99  void setMaxDecel(double decel) {
100  myDecel = decel;
102  }
103 
104 
108  void setImperfection(double imperfection) {
109  myDawdle = imperfection;
110  }
111 
112 
116  void setHeadwayTime(double headwayTime) {
117  myHeadwayTime = headwayTime;
118  myTauDecel = myDecel * headwayTime;
119  }
121 
122 
127  virtual MSCFModel* duplicate(const MSVehicleType* vtype) const;
128 
129 protected:
136  virtual double vsafe(double gap, double predSpeed, double predMaxDecel) const;
137 
138 
143  virtual double dawdle(double speed, SumoRNG* rng) const;
144 
145 protected:
147  double myDawdle;
148 
150  double myTauDecel;
151 };
152 
153 
@ SUMO_TAG_CF_KRAUSS_ORIG1
The original Krauss (1998) car-following model and parameter.
virtual double stopSpeed(const MSVehicle *const veh, const double speed, double gap2pred, double decel) const
Computes the vehicle's safe speed for approaching a non-moving obstacle (no dawdling)
double getImperfection() const
Get the driver's imperfection.
virtual double vsafe(double gap, double predSpeed, double predMaxDecel) const
Returns the "safe" velocity.
virtual double dawdle(double speed, SumoRNG *rng) const
Applies driver imperfection (dawdling / sigma)
double myDawdle
The vehicle's dawdle-parameter. 0 for no dawdling, 1 for max.
double myTauDecel
The precomputed value for myDecel*myTau.
virtual int getModelID() const
Returns the model's name.
MSCFModel_KraussOrig1(const MSVehicleType *vtype)
Constructor.
void setImperfection(double imperfection)
Sets a new value for driver imperfection.
void setMaxDecel(double decel)
Sets a new value for maximum deceleration [m/s^2].
double followSpeed(const MSVehicle *const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle *const pred=0) const
Computes the vehicle's safe speed (no dawdling)
virtual MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
double patchSpeedBeforeLC(const MSVehicle *veh, double vMin, double vMax) const
apply custom speed adaptations within the given speed bounds
void setHeadwayTime(double headwayTime)
Sets a new value for desired headway [s].
The car-following model abstraction.
Definition: MSCFModel.h:55
double myDecel
The vehicle's maximum deceleration [m/s^2].
Definition: MSCFModel.h:647
double myHeadwayTime
The driver's desired time headway (aka reaction time tau) [s].
Definition: MSCFModel.h:656
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:75
The car-following model and parameter.
Definition: MSVehicleType.h:62