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-2022 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
18 // The psycho-physical model of Wiedemann (10-Parameter version from 1999)
19 // code adapted from https://github.com/glgh/w99-demo
20 // (MIT License, Copyright (c) 2016 glgh)
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
25 #include "MSCFModel.h"
26 #include <microsim/MSLane.h>
27 #include <microsim/MSVehicle.h>
28 #include <microsim/MSVehicleType.h>
30 
31 
32 // ===========================================================================
33 // class definitions
34 // ===========================================================================
39 // XXX: which W99 is this? There are several versions... Below it is stated that it is modified it with Krauss vsafe... (Leo)
40 class MSCFModel_W99 : public MSCFModel {
41 public:
42 
46  MSCFModel_W99(const MSVehicleType* vtype);
47 
48 
51 
52 
55 
56 
65  double followSpeed(const MSVehicle* const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle* const pred = 0) const;
66 
67 
75  double stopSpeed(const MSVehicle* const veh, const double speed, double gap, double decel) const;
76 
77 
87  double interactionGap(const MSVehicle* const, double vL) const;
88 
93  int getModelID() const {
94  return SUMO_TAG_CF_W99;
95  }
96 
97 
102  MSCFModel* duplicate(const MSVehicleType* vtype) const;
103 
104 
106 
107  /*
108  enum Status {
109  DECEL1,
110  DECEL2,
111  FOLLOW,
112  FREE_FLOW,
113  }
114 
115  private:
116  class VehicleVariables : public MSCFModel::VehicleVariables {
117  public:
118  VehicleVariables() : lastStatus(FREE_FLOW) {}
120  Status lastStatus;
121  };
122  */
123 
124 
125 private:
128 
129  //const double myCC0; // StandStill Distance - (using minGap)
130  const double myCC1; // Spacing Time - s
131  const double myCC2; // Following Variation ("max drift") - m
132  const double myCC3; // Threshold for Entering 'Following' - s
133  const double myCC4; // Negative 'Following' Threshold - m/s
134  const double myCC5; // Positive 'Following' Threshold - m/s
135  const double myCC6; // Speed Dependency of Oscillation - 10^-4 rad/s
136  const double myCC7; // Oscillation Acceleration - m/s^2
137  const double myCC8; // Standstill Acceleration - m/s^2
138  const double myCC9; // Acceleration at 80km/h - m/s^2
140 
141 
142  void computeThresholds(double speed, double predSpeed, double leaderAccel, double rndVal,
143  double& sdxc, double& sdxo, double& sdxv) const;
144 
145 private:
148 };
149 
@ SUMO_TAG_CF_W99
The W99 Model car-following model.
Definition: MSCFModel_W99.h:40
const double myCC8
const double myCC7
const double myCC6
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)
MSCFModel_W99(const MSVehicleType *vtype)
Constructor.
const double myCC9
const double myCC2
double interactionGap(const MSVehicle *const, double vL) const
Returns the maximum gap at which an interaction between both vehicles occurs.
const double myCC1
const double myCC5
double stopSpeed(const MSVehicle *const veh, const double speed, double gap, double decel) const
Computes the vehicle's safe speed for approaching a non-moving obstacle (no dawdling)
const double myCC3
void computeThresholds(double speed, double predSpeed, double leaderAccel, double rndVal, double &sdxc, double &sdxo, double &sdxv) const
~MSCFModel_W99()
Destructor.
const double myCC4
int getModelID() const
Returns the model's name.
Definition: MSCFModel_W99.h:93
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
MSCFModel_W99 & operator=(const MSCFModel_W99 &s)
Invalidated assignment operator.
The car-following model abstraction.
Definition: MSCFModel.h:55
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:75
The car-following model and parameter.
Definition: MSVehicleType.h:62