Eclipse SUMO - Simulation of Urban MObility
MSCFModel_W99.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 // The psycho-physical model of Wiedemann (10-Parameter version from 1999)
16 // code adapted from https://github.com/glgh/w99-demo
17 // (MIT License, Copyright (c) 2016 glgh)
18 /****************************************************************************/
19 #ifndef MSCFModel_W99_H
20 #define MSCFModel_W99_H
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include "MSCFModel.h"
28 #include <microsim/MSLane.h>
29 #include <microsim/MSVehicle.h>
30 #include <microsim/MSVehicleType.h>
32 
33 
34 // ===========================================================================
35 // class definitions
36 // ===========================================================================
41 // XXX: which W99 is this? There are several versions... Below it is stated that it is modified it with Krauss vsafe... (Leo)
42 class MSCFModel_W99 : public MSCFModel {
43 public:
44 
48  MSCFModel_W99(const MSVehicleType* vtype);
49 
50 
53 
54 
57 
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 gap) const;
78 
79 
89  double interactionGap(const MSVehicle* const, double vL) const;
90 
96  double getSecureGap(const double speed, const double leaderSpeed, const double leaderMaxDecel) const;
97 
102  int getModelID() const {
103  return SUMO_TAG_CF_W99;
104  }
105 
106 
111  MSCFModel* duplicate(const MSVehicleType* vtype) const;
112 
113 
115 
116  /*
117  enum Status {
118  DECEL1,
119  DECEL2,
120  FOLLOW,
121  FREE_FLOW,
122  }
123 
124  private:
125  class VehicleVariables : public MSCFModel::VehicleVariables {
126  public:
127  VehicleVariables() : lastStatus(FREE_FLOW) {}
129  Status lastStatus;
130  };
131  */
132 
133 
134 private:
137 
138  //const double myCC0; // StandStill Distance - (using minGap)
139  const double myCC1; // Spacing Time - s
140  const double myCC2; // Following Variation ("max drift") - m
141  const double myCC3; // Threshold for Entering 'Following' - s
142  const double myCC4; // Negative 'Following' Threshold - m/s
143  const double myCC5; // Positive 'Following' Threshold - m/s
144  const double myCC6; // Speed Dependency of Oscillation - 10^-4 rad/s
145  const double myCC7; // Oscillation Acceleration - m/s^2
146  const double myCC8; // Standstill Acceleration - m/s^2
147  const double myCC9; // Acceleration at 80km/h - m/s^2
149 
150 
151  void computeThresholds(double speed, double predSpeed, double leaderAccel, double rndVal,
152  double& sdxc, double& sdxo, double& sdxv) const;
153 
154 private:
157 };
158 
159 #endif /* MSCFModel_W99_H */
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:80
~MSCFModel_W99()
Destructor.
const double myCC3
const double myCC6
const double myCC7
The car-following model abstraction.
Definition: MSCFModel.h:57
void computeThresholds(double speed, double predSpeed, double leaderAccel, double rndVal, double &sdxc, double &sdxo, double &sdxv) const
The car-following model and parameter.
Definition: MSVehicleType.h:66
double followSpeed(const MSVehicle *const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle *const pred=0) const
Computes the vehicle&#39;s safe speed (no dawdling)
const double myCC9
int getModelID() const
Returns the model&#39;s name.
MSCFModel_W99 & operator=(const MSCFModel_W99 &s)
Invalidated assignment operator.
const double myCC4
double getSecureGap(const double speed, const double leaderSpeed, const double leaderMaxDecel) const
Returns the minimum gap to reserve if the leader is braking at maximum (>=0)
const double myCC5
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
MSCFModel_W99(const MSVehicleType *vtype)
Constructor.
const double myCC8
double interactionGap(const MSVehicle *const, double vL) const
Returns the maximum gap at which an interaction between both vehicles occurs.
const double myCC1
double stopSpeed(const MSVehicle *const veh, const double speed, double gap) const
Computes the vehicle&#39;s safe speed for approaching a non-moving obstacle (no dawdling) ...
const double myCC2
The W99 Model car-following model.
Definition: MSCFModel_W99.h:42