Eclipse SUMO - Simulation of Urban MObility
MSCFModel_Daniel1.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2012-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 /****************************************************************************/
19 // The original Krauss (1998) car-following model and parameter
20 /****************************************************************************/
21 #pragma once
22 #include <config.h>
23 
24 #include "MSCFModel.h"
26 
27 
28 // ===========================================================================
29 // class definitions
30 // ===========================================================================
35 class MSCFModel_Daniel1 : public MSCFModel {
36 public:
40  MSCFModel_Daniel1(const MSVehicleType* vtype);
41 
42 
45 
46 
49 
55  double finalizeSpeed(MSVehicle* const veh, double vPos) const;
56 
57 
66  virtual double followSpeed(const MSVehicle* const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle* const pred = 0) const;
67 
68 
76  virtual double stopSpeed(const MSVehicle* const veh, const double speed, double gap2pred, double decel) const;
77 
78 
83  virtual int getModelID() const {
84  return SUMO_TAG_CF_DANIEL1;
85  }
86 
87 
91  double getImperfection() const {
92  return myDawdle;
93  }
95 
96 
97 
100 
103  void setMaxDecel(double decel) {
104  myDecel = decel;
106  }
107 
108 
112  void setImperfection(double imperfection) {
113  myDawdle = imperfection;
114  }
115 
116 
120  void setHeadwayTime(double headwayTime) {
121  myHeadwayTime = headwayTime;
122  myTauDecel = myDecel * headwayTime;
123  }
125 
126 
131  virtual MSCFModel* duplicate(const MSVehicleType* vtype) const;
132 
133 private:
139  virtual double _vsafe(double gap, double predSpeed) const;
140 
141 
146  virtual double dawdle(double speed, SumoRNG* rng) const;
147 
148 protected:
150  double myDawdle;
151 
153  double myTauDecel;
154 
157 
158 };
159 
160 
@ SUMO_TAG_CF_DANIEL1
The original Krauss (1998) car-following model and parameter.
~MSCFModel_Daniel1()
Destructor.
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 myTmp1
temporary (testing) parameter
virtual MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
double myDawdle
The vehicle's dawdle-parameter. 0 for no dawdling, 1 for max.
void setImperfection(double imperfection)
Sets a new value for driver imperfection.
double getImperfection() const
Get the driver's imperfection.
MSCFModel_Daniel1(const MSVehicleType *vtype)
Constructor.
virtual int getModelID() const
Returns the model's name.
virtual 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)
double myTauDecel
The precomputed value for myDecel*myTau.
virtual double dawdle(double speed, SumoRNG *rng) const
Applies driver imperfection (dawdling / sigma)
void setHeadwayTime(double headwayTime)
Sets a new value for driver reaction time [s].
virtual double _vsafe(double gap, double predSpeed) const
Returns the "safe" velocity.
void setMaxDecel(double decel)
Sets a new value for maximum deceleration [m/s^2].
double finalizeSpeed(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences.
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