Eclipse 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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // car-following model by B. Kerner
17 /****************************************************************************/
18 #ifndef MSCFModel_Kerner_h
19 #define MSCFModel_Kerner_h
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include "MSCFModel.h"
28 
29 
30 // ===========================================================================
31 // class definitions
32 // ===========================================================================
37 class MSCFModel_Kerner : public MSCFModel {
38 public:
42  MSCFModel_Kerner(const MSVehicleType* vtype);
43 
44 
47 
48 
51 
57  double finalizeSpeed(MSVehicle* const veh, double vPos) const;
58 
67  double followSpeed(const MSVehicle* const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle* const pred = 0) const;
68 
69 
77  double stopSpeed(const MSVehicle* const veh, const double speed, double gap2pred) const;
78 
79 
84  int getModelID() const {
85  return SUMO_TAG_CF_BKERNER;
86  }
88 
89 
90 
95  MSCFModel* duplicate(const MSVehicleType* vtype) const;
96 
97 
99 
100 
101 private:
103  public:
104  double rand;
105  };
106 
112  double _v(const MSVehicle* const veh, double speed, double vfree, double gap, double predSpeed) const;
113 
114 
115 
116 private:
120  double myK;
121 
123  double myPhi;
124 
126  double myTauDecel;
128 
129 };
130 
131 #endif /* MSCFModel_Kerner_H */
132 
MSVehicleType
The car-following model and parameter.
Definition: MSVehicleType.h:66
MSCFModel_Kerner::duplicate
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
Definition: MSCFModel_Kerner.cpp:94
MSCFModel_Kerner::myTauDecel
double myTauDecel
The precomputed value for myDecel*myTau.
Definition: MSCFModel_Kerner.h:126
MSCFModel_Kerner::VehicleVariables::rand
double rand
Definition: MSCFModel_Kerner.h:104
MSCFModel_Kerner::createVehicleVariables
MSCFModel::VehicleVariables * createVehicleVariables() const
Returns model specific values which are stored inside a vehicle and must be used with casting.
Definition: MSCFModel_Kerner.cpp:68
MSCFModel_Kerner::~MSCFModel_Kerner
~MSCFModel_Kerner()
Destructor.
Definition: MSCFModel_Kerner.cpp:43
MSCFModel_Kerner::MSCFModel_Kerner
MSCFModel_Kerner(const MSVehicleType *vtype)
Constructor.
Definition: MSCFModel_Kerner.cpp:35
MSCFModel_Kerner::myPhi
double myPhi
Kerner's phi.
Definition: MSCFModel_Kerner.h:123
MSCFModel_Kerner::VehicleVariables
Definition: MSCFModel_Kerner.h:102
MSCFModel_Kerner::followSpeed
double followSpeed(const MSVehicle *const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle *const pred=0) const
Computes the vehicle's safe speed (no dawdling)
Definition: MSCFModel_Kerner.cpp:56
MSCFModel_Kerner::finalizeSpeed
double finalizeSpeed(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences.
Definition: MSCFModel_Kerner.cpp:47
MSCFModel_Kerner::getModelID
int getModelID() const
Returns the model's name.
Definition: MSCFModel_Kerner.h:84
MSCFModel::VehicleVariables
Definition: MSCFModel.h:61
MSCFModel_Kerner::myK
double myK
Definition: MSCFModel_Kerner.h:120
MSCFModel.h
SUMO_TAG_CF_BKERNER
Definition: SUMOXMLDefinitions.h:285
MSCFModel
The car-following model abstraction.
Definition: MSCFModel.h:57
MSCFModel_Kerner
car-following model by B. Kerner
Definition: MSCFModel_Kerner.h:37
config.h
SUMOXMLDefinitions.h
MSCFModel_Kerner::stopSpeed
double stopSpeed(const MSVehicle *const veh, const double speed, double gap2pred) const
Computes the vehicle's safe speed for approaching a non-moving obstacle (no dawdling)
Definition: MSCFModel_Kerner.cpp:62
MSVehicle
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:80
MSCFModel_Kerner::_v
double _v(const MSVehicle *const veh, double speed, double vfree, double gap, double predSpeed) const
Returns the "safe" velocity.
Definition: MSCFModel_Kerner.cpp:77