Eclipse SUMO - Simulation of Urban MObility
MSCFModel_Wiedemann.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 /****************************************************************************/
19 // The psycho-physical model of Wiedemann
20 /****************************************************************************/
21 #pragma once
22 #include <config.h>
23 
24 #include "MSCFModel.h"
25 #include <microsim/MSLane.h>
26 #include <microsim/MSVehicle.h>
27 #include <microsim/MSVehicleType.h>
29 
30 
31 // ===========================================================================
32 // class definitions
33 // ===========================================================================
38 // XXX: which Wiedemann is this? There are several versions... Below it is stated that it is modified it with Krauss vsafe... (Leo)
40 public:
41 
45  MSCFModel_Wiedemann(const MSVehicleType* vtype);
46 
47 
50 
51 
54 
60  double finalizeSpeed(MSVehicle* const veh, double vPos) const;
61 
62 
71  double followSpeed(const MSVehicle* const veh, double speed, double gap2pred,
72  double predSpeed, double predMaxDecel, const MSVehicle* const pred = 0, const CalcReason usage = CalcReason::CURRENT) const;
73 
74 
82  double stopSpeed(const MSVehicle* const veh, const double speed, double gap, double decel, const CalcReason usage = CalcReason::CURRENT) const;
83 
84 
94  double interactionGap(const MSVehicle* const, double vL) const;
95 
103  double getSecureGap(const MSVehicle* const veh, const MSVehicle* const pred, const double speed, const double leaderSpeed, const double leaderMaxDecel) const;
104 
109  int getModelID() const {
110  return SUMO_TAG_CF_WIEDEMANN;
111  }
112 
113 
118  MSCFModel* duplicate(const MSVehicleType* vtype) const;
119 
120 
122  return new VehicleVariables();
123  }
125 
126 
127 private:
129  public:
132  double accelSign;
133  };
134 
135 
136 private:
137  /* @brief the main enty point for the speed computation
138  * @param[in] gap The netto gap (front bumper of ego to back bumper of leader)
139  */
140  double _v(const MSVehicle* veh, double predSpeed, double gap, double predAccel) const;
141 
144  double fullspeed(double v, double vpref, double dx, double bx) const; // also 'WUNSCH'
145  double following(double sign) const; // also 'FOLGEN'
146  double approaching(double dv, double dx, double abx, double predAccel) const; // also 'BREMSBX'
147  double emergency(double dv, double dx, double predAccel, double v, double gap, double abx, double bx) const; // also 'BREMSAX'
149 
150 private:
153 
155  const double mySecurity;
156 
158  const double myEstimation;
159 
161  const double myAX;
162 
164  const double myCX;
165 
167  const double myMinAccel;
168 
170  const double myMaxApproachingDecel;
171 
173  static const double D_MAX;
175 
176 private:
179 };
@ SUMO_TAG_CF_WIEDEMANN
double accelSign
state variable for remembering the drift direction
The Wiedemann Model car-following model.
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
double following(double sign) const
double finalizeSpeed(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences.
double getSecureGap(const MSVehicle *const veh, const MSVehicle *const pred, const double speed, const double leaderSpeed, const double leaderMaxDecel) const
Returns the minimum gap to reserve if the leader is braking at maximum (>=0)
~MSCFModel_Wiedemann()
Destructor.
const double myMinAccel
The vehicle's minimum acceleration [m/s^2] // also b_null.
double approaching(double dv, double dx, double abx, double predAccel) const
double stopSpeed(const MSVehicle *const veh, const double speed, double gap, double decel, const CalcReason usage=CalcReason::CURRENT) const
Computes the vehicle's safe speed for approaching a non-moving obstacle (no dawdling)
MSCFModel_Wiedemann & operator=(const MSCFModel_Wiedemann &s)
Invalidated assignment operator.
const double myMaxApproachingDecel
The maximum deceleration when approaching.
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 _v(const MSVehicle *veh, double predSpeed, double gap, double predAccel) const
static const double D_MAX
free-flow distance in m
VehicleVariables * createVehicleVariables() const
Returns model specific values which are stored inside a vehicle and must be used with casting.
const double myEstimation
The driver's estimation parameter // also 'ZF2'.
double fullspeed(double v, double vpref, double dx, double bx) const
MSCFModel_Wiedemann(const MSVehicleType *vtype)
Constructor.
double emergency(double dv, double dx, double predAccel, double v, double gap, double abx, double bx) const
const double myAX
the minimum front-bumper to front-bumper distance when standing
const double myCX
perception threshold modifier
double interactionGap(const MSVehicle *const, double vL) const
Returns the maximum gap at which an interaction between both vehicles occurs.
int getModelID() const
Returns the model's name.
const double mySecurity
The driver's security parameter // also 'ZF1'.
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
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:77
The car-following model and parameter.
Definition: MSVehicleType.h:63