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.dev/sumo
3 // Copyright (C) 2001-2024 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,
66  double predMaxDecel, const MSVehicle* const pred = 0, const CalcReason usage = CalcReason::CURRENT) const;
67 
68 
76  double stopSpeed(const MSVehicle* const veh, const double speed, double gap, double decel, const CalcReason usage = CalcReason::CURRENT) const;
77 
78 
88  double interactionGap(const MSVehicle* const, double vL) const;
89 
94  int getModelID() const {
95  return SUMO_TAG_CF_W99;
96  }
97 
98 
103  MSCFModel* duplicate(const MSVehicleType* vtype) const;
104 
105 
107 
108  /*
109  enum Status {
110  DECEL1,
111  DECEL2,
112  FOLLOW,
113  FREE_FLOW,
114  }
115 
116  private:
117  class VehicleVariables : public MSCFModel::VehicleVariables {
118  public:
119  VehicleVariables() : lastStatus(FREE_FLOW) {}
121  Status lastStatus;
122  };
123  */
124 
125 
126 private:
129 
130  //const double myCC0; // StandStill Distance - (using minGap)
131  const double myCC1; // Spacing Time - s
132  const double myCC2; // Following Variation ("max drift") - m
133  const double myCC3; // Threshold for Entering 'Following' - s
134  const double myCC4; // Negative 'Following' Threshold - m/s
135  const double myCC5; // Positive 'Following' Threshold - m/s
136  const double myCC6; // Speed Dependency of Oscillation - 10^-4 rad/s
137  const double myCC7; // Oscillation Acceleration - m/s^2
138  const double myCC8; // Standstill Acceleration - m/s^2
139  const double myCC9; // Acceleration at 80km/h - m/s^2
141 
142 
143  void computeThresholds(double speed, double predSpeed, double leaderAccel, double rndVal,
144  double& sdxc, double& sdxo, double& sdxv) const;
145 
146 private:
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
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
const double myCC3
double stopSpeed(const MSVehicle *const veh, const double speed, double gap, double decel, const CalcReason usage=CalcReason::CURRENT) const
Computes the vehicle's safe speed for approaching a non-moving obstacle (no dawdling)
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:94
double followSpeed(const MSVehicle *const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle *const pred=0, const CalcReason usage=CalcReason::CURRENT) const
Computes the vehicle's safe speed (no dawdling)
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
CalcReason
What the return value of stop/follow/free-Speed is used for.
Definition: MSCFModel.h:77
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:77
The car-following model and parameter.
Definition: MSVehicleType.h:63