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 /****************************************************************************/
15 // car-following model by B. Kerner
16 /****************************************************************************/
17 #ifndef MSCFModel_Kerner_h
18 #define MSCFModel_Kerner_h
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include "MSCFModel.h"
27 
28 
29 // ===========================================================================
30 // class definitions
31 // ===========================================================================
36 class MSCFModel_Kerner : public MSCFModel {
37 public:
41  MSCFModel_Kerner(const MSVehicleType* vtype);
42 
43 
46 
47 
50 
56  double finalizeSpeed(MSVehicle* const veh, double vPos) const;
57 
66  double followSpeed(const MSVehicle* const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle* const pred = 0) const;
67 
68 
76  double stopSpeed(const MSVehicle* const veh, const double speed, double gap2pred) const;
77 
78 
83  int getModelID() const {
84  return SUMO_TAG_CF_BKERNER;
85  }
87 
88 
89 
94  MSCFModel* duplicate(const MSVehicleType* vtype) const;
95 
96 
98 
99 
100 private:
102  public:
103  double rand;
104  };
105 
111  double _v(const MSVehicle* const veh, double speed, double vfree, double gap, double predSpeed) const;
112 
113 
114 
115 private:
119  double myK;
120 
122  double myPhi;
123 
125  double myTauDecel;
127 
128 };
129 
130 #endif /* MSCFModel_Kerner_H */
131 
MSVehicleType
The car-following model and parameter.
Definition: MSVehicleType.h:65
MSCFModel_Kerner::duplicate
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
Definition: MSCFModel_Kerner.cpp:93
MSCFModel_Kerner::myTauDecel
double myTauDecel
The precomputed value for myDecel*myTau.
Definition: MSCFModel_Kerner.h:125
MSCFModel_Kerner::VehicleVariables::rand
double rand
Definition: MSCFModel_Kerner.h:103
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:67
MSCFModel_Kerner::~MSCFModel_Kerner
~MSCFModel_Kerner()
Destructor.
Definition: MSCFModel_Kerner.cpp:42
MSCFModel_Kerner::MSCFModel_Kerner
MSCFModel_Kerner(const MSVehicleType *vtype)
Constructor.
Definition: MSCFModel_Kerner.cpp:34
MSCFModel_Kerner::myPhi
double myPhi
Kerner's phi.
Definition: MSCFModel_Kerner.h:122
MSCFModel_Kerner::VehicleVariables
Definition: MSCFModel_Kerner.h:101
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:55
MSCFModel_Kerner::finalizeSpeed
double finalizeSpeed(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences.
Definition: MSCFModel_Kerner.cpp:46
MSCFModel_Kerner::getModelID
int getModelID() const
Returns the model's name.
Definition: MSCFModel_Kerner.h:83
MSCFModel::VehicleVariables
Definition: MSCFModel.h:60
MSCFModel_Kerner::myK
double myK
Definition: MSCFModel_Kerner.h:119
MSCFModel.h
SUMO_TAG_CF_BKERNER
@ SUMO_TAG_CF_BKERNER
Definition: SUMOXMLDefinitions.h:284
MSCFModel
The car-following model abstraction.
Definition: MSCFModel.h:56
MSCFModel_Kerner
car-following model by B. Kerner
Definition: MSCFModel_Kerner.h:36
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:61
MSVehicle
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:79
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:76