SUMO - Simulation of Urban MObility
MSCFModel_Kerner.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
18 // car-following model by B. Kerner
19 /****************************************************************************/
20 #ifndef MSCFModel_Kerner_h
21 #define MSCFModel_Kerner_h
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include "MSCFModel.h"
34 
35 
36 // ===========================================================================
37 // class definitions
38 // ===========================================================================
43 class MSCFModel_Kerner : public MSCFModel {
44 public:
54  MSCFModel_Kerner(const MSVehicleType* vtype, double accel,
55  double decel, double emergencyDecel, double apparentDecel,
56  double headwayTime, double k, double phi);
57 
58 
61 
62 
65 
71  double moveHelper(MSVehicle* const veh, double vPos) const;
72 
81  double followSpeed(const MSVehicle* const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel) const;
82 
83 
91  double stopSpeed(const MSVehicle* const veh, const double speed, double gap2pred) const;
92 
93 
98  int getModelID() const {
99  return SUMO_TAG_CF_BKERNER;
100  }
102 
103 
104 
109  MSCFModel* duplicate(const MSVehicleType* vtype) const;
110 
111 
113 
114 
115 private:
117  public:
118  double rand;
119  };
120 
126  double _v(const MSVehicle* const veh, double speed, double vfree, double gap, double predSpeed) const;
127 
128 
129 
130 private:
134  double myK;
135 
137  double myPhi;
138 
140  double myTauDecel;
142 
143 };
144 
145 #endif /* MSCFModel_Kerner_H */
146 
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:83
car-following model by B. Kerner
The car-following model abstraction.
Definition: MSCFModel.h:59
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
int getModelID() const
Returns the model&#39;s name.
double moveHelper(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences.
The car-following model and parameter.
Definition: MSVehicleType.h:72
MSCFModel::VehicleVariables * createVehicleVariables() const
Returns model specific values which are stored inside a vehicle and must be used with casting...
double myPhi
Kerner&#39;s phi.
MSCFModel_Kerner(const MSVehicleType *vtype, double accel, double decel, double emergencyDecel, double apparentDecel, double headwayTime, double k, double phi)
Constructor.
double _v(const MSVehicle *const veh, double speed, double vfree, double gap, double predSpeed) const
Returns the "safe" velocity.
double myTauDecel
The precomputed value for myDecel*myTau.
double followSpeed(const MSVehicle *const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel) const
Computes the vehicle&#39;s safe speed (no dawdling)
double stopSpeed(const MSVehicle *const veh, const double speed, double gap2pred) const
Computes the vehicle&#39;s safe speed for approaching a non-moving obstacle (no dawdling) ...
~MSCFModel_Kerner()
Destructor.