SUMO - Simulation of Urban MObility
MSCFModel_Kerner.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // car-following model by B. Kerner
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef MSCFModel_Kerner_h
22 #define MSCFModel_Kerner_h
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include "MSCFModel.h"
35 
36 
37 // ===========================================================================
38 // class definitions
39 // ===========================================================================
44 class MSCFModel_Kerner : public MSCFModel {
45 public:
53  MSCFModel_Kerner(const MSVehicleType* vtype, double accel, double decel, double emergencyDecel, double headwayTime, double k, double phi);
54 
55 
58 
59 
62 
68  double moveHelper(MSVehicle* const veh, double vPos) const;
69 
78  double followSpeed(const MSVehicle* const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel) const;
79 
80 
88  double stopSpeed(const MSVehicle* const veh, const double speed, double gap2pred) const;
89 
90 
95  int getModelID() const {
96  return SUMO_TAG_CF_BKERNER;
97  }
99 
100 
101 
106  MSCFModel* duplicate(const MSVehicleType* vtype) const;
107 
108 
110 
111 
112 private:
114  public:
115  double rand;
116  };
117 
123  double _v(const MSVehicle* const veh, double speed, double vfree, double gap, double predSpeed) const;
124 
125 
126 
127 private:
131  double myK;
132 
134  double myPhi;
135 
137  double myTauDecel;
139 
140 };
141 
142 #endif /* MSCFModel_Kerner_H */
143 
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:60
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:74
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.
double _v(const MSVehicle *const veh, double speed, double vfree, double gap, double predSpeed) const
Returns the "safe" velocity.
MSCFModel_Kerner(const MSVehicleType *vtype, double accel, double decel, double emergencyDecel, double headwayTime, double k, double phi)
Constructor.
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.