Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSCFModel_Daniel1.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2012-2024 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// ===========================================================================
36public:
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,
67 double predSpeed, double predMaxDecel, const MSVehicle* const pred = 0, const CalcReason usage = CalcReason::CURRENT) const;
68
69
77 virtual double stopSpeed(const MSVehicle* const veh, const double speed, double gap2pred, double decel, const CalcReason usage = CalcReason::CURRENT) const;
78
79
84 virtual int getModelID() const {
86 }
87
88
92 double getImperfection() const {
93 return myDawdle;
94 }
96
97
98
101
104 void setMaxDecel(double decel) {
105 myDecel = decel;
107 }
108
109
113 void setImperfection(double imperfection) {
114 myDawdle = imperfection;
115 }
116
117
121 void setHeadwayTime(double headwayTime) {
122 myHeadwayTime = headwayTime;
123 myTauDecel = myDecel * headwayTime;
124 }
126
127
132 virtual MSCFModel* duplicate(const MSVehicleType* vtype) const;
133
134private:
140 virtual double _vsafe(double gap, double predSpeed) const;
141
142
147 virtual double dawdle(double speed, SumoRNG* rng) const;
148
149protected:
151 double myDawdle;
152
155
158
159};
@ SUMO_TAG_CF_DANIEL1
The original Krauss (1998) car-following model and parameter.
~MSCFModel_Daniel1()
Destructor.
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.
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 CalcReason usage=CalcReason::CURRENT) const
Computes the vehicle's safe speed (no dawdling)
double myTauDecel
The precomputed value for myDecel*myTau.
virtual double stopSpeed(const MSVehicle *const veh, const double speed, double gap2pred, double decel, const CalcReason usage=CalcReason::CURRENT) const
Computes the vehicle's safe speed for approaching a non-moving obstacle (no dawdling)
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
CalcReason
What the return value of stop/follow/free-Speed is used for.
Definition MSCFModel.h:77
@ CURRENT
the return value is used for calculating the next speed
Definition MSCFModel.h:79
double myDecel
The vehicle's maximum deceleration [m/s^2].
Definition MSCFModel.h:701
double myHeadwayTime
The driver's desired time headway (aka reaction time tau) [s].
Definition MSCFModel.h:710
Representation of a vehicle in the micro simulation.
Definition MSVehicle.h:77
The car-following model and parameter.