Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSCFModel_Krauss.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-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/****************************************************************************/
21// Krauss car-following model, with acceleration decrease and faster start
22/****************************************************************************/
23#pragma once
24#include <config.h>
25
28
29
30// ===========================================================================
31// class definitions
32// ===========================================================================
38public:
42 MSCFModel_Krauss(const MSVehicleType* vtype);
43
44
47
51 double patchSpeedBeforeLC(const MSVehicle* veh, double vMin, double vMax) const;
52
60 double stopSpeed(const MSVehicle* const veh, const double speed, double gap2pred, double decel, const CalcReason usage = CalcReason::CURRENT) const;
61
62
72 double followSpeed(const MSVehicle* const veh, double speed, double gap2pred,
73 double predSpeed, double predMaxDecel, const MSVehicle* const pred = 0, const CalcReason usage = CalcReason::CURRENT) const;
74
75
80 int getModelID() const {
81 return SUMO_TAG_CF_KRAUSS;
82 }
84
85
90 MSCFModel* duplicate(const MSVehicleType* vtype) const;
91
93 if (myDawdleStep > DELTA_T) {
95 }
96 return 0;
97 }
98
99
100private:
102 public:
103 // no speed update happens in the insertion step
104 VehicleVariables(SUMOTime dawdleStep);
105
109 };
110
111protected:
112
118 double dawdle2(double speed, double sigma, SumoRNG* rng) const;
119
122
123
124};
long long int SUMOTime
Definition GUI.h:36
SUMOTime DELTA_T
Definition SUMOTime.cpp:38
@ SUMO_TAG_CF_KRAUSS
double accelDawdle
the accleration due to dawdling
Krauss car-following model, with acceleration decrease and faster start.
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) this uses the maximumSafeFollowSpeed.
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
int getModelID() const
Returns the model's name.
double dawdle2(double speed, double sigma, SumoRNG *rng) const
Applies driver imperfection (dawdling / sigma)
VehicleVariables * createVehicleVariables() const
Returns model specific values which are stored inside a vehicle and must be used with casting.
~MSCFModel_Krauss()
Destructor.
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) this uses the m...
SUMOTime myDawdleStep
The vehicle's update period for dawdling.
The original Krauss (1998) car-following model and parameter.
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
Representation of a vehicle in the micro simulation.
Definition MSVehicle.h:77
The car-following model and parameter.