Eclipse SUMO - Simulation of Urban MObility
MSCFModel_PWag2009.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 // Copyright (C) 2010-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 /****************************************************************************/
20 // Scalable model based on Krauss by Peter Wagner
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
25 #include "MSCFModel.h"
27 
28 
29 // ===========================================================================
30 // class definitions
31 // ===========================================================================
36 class MSCFModel_PWag2009 : public MSCFModel {
37 public:
41  MSCFModel_PWag2009(const MSVehicleType* vtype);
42 
43 
46 
47 
50 
56  double finalizeSpeed(MSVehicle* const veh, double vPos) const;
57 
59  double patchSpeedBeforeLC(const MSVehicle* veh, double vMin, double vMax) const;
60 
69  double followSpeed(const MSVehicle* const veh, double speed, double gap2pred,
70  double predSpeed, double predMaxDecel, const MSVehicle* const pred = 0, const CalcReason usage = CalcReason::CURRENT) const;
71 
72 
80  double stopSpeed(const MSVehicle* const veh, const double speed, double gap2pred, double decel, const CalcReason usage = CalcReason::CURRENT) const;
81 
82 
87  int getModelID() const {
89  }
90 
91 
95  double getImperfection() const {
96  return myDawdle;
97  }
99 
100 
101 
106  MSCFModel* duplicate(const MSVehicleType* vtype) const;
107 
108 
110  VehicleVariables* ret = new VehicleVariables();
111  ret->aOld = 0.0;
112  return ret;
113  }
114 
115 
116 private:
118  public:
119  double aOld;
120  };
121 
127  double _v(const MSVehicle* const veh, double speed, double gap, double predSpeed) const;
128 
129 
134  double dawdle(double speed) const;
135 
136 private:
140  double myDawdle;
141 
143  double myTauDecel;
144 
147 
150 
154 
155 };
@ SUMO_TAG_CF_PWAGNER2009
Scalable model based on Krauss by Peter Wagner.
~MSCFModel_PWag2009()
Destructor.
double myDecelDivTau
The precomputed value for myDecel/myTau.
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 myTauLastDecel
The precomputed value for (minimum headway time)*myDecel.
double getImperfection() const
Get the driver's imperfection.
double myActionPointProbability
The probability for any action.
int getModelID() const
Returns the model's name.
double _v(const MSVehicle *const veh, double speed, double gap, double predSpeed) const
Returns the next velocity.
double patchSpeedBeforeLC(const MSVehicle *veh, double vMin, double vMax) const
apply dawdling
double dawdle(double speed) const
Applies driver imperfection (dawdling / sigma)
MSCFModel_PWag2009(const MSVehicleType *vtype)
Constructor.
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
double myTauDecel
The precomputed value for myDecel*myTau.
virtual MSCFModel::VehicleVariables * createVehicleVariables() const
Returns model specific values which are stored inside a vehicle and must be used with casting.
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)
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
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:77
The car-following model and parameter.
Definition: MSVehicleType.h:63