Eclipse SUMO - Simulation of Urban MObility
MSCFModel_ACC.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 // ACC car-following model based on [1], [2].
16 // [1] Milanes, V., and S. E. Shladover. Handling Cut-In Vehicles in Strings
17 // of Cooperative Adaptive Cruise Control Vehicles. Journal of Intelligent
18 // Transportation Systems, Vol. 20, No. 2, 2015, pp. 178-191.
19 // [2] Xiao, L., M. Wang and B. van Arem. Realistic Car-Following Models for
20 // Microscopic Simulation of Adaptive and Cooperative Adaptive Cruise
21 // Control Vehicles. Transportation Research Record: Journal of the
22 // Transportation Research Board, No. 2623, 2017. (DOI: 10.3141/2623-01).
23 /****************************************************************************/
24 #ifndef MSCFModel_ACC_H
25 #define MSCFModel_ACC_H
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #include <config.h>
31 
32 #include "MSCFModel.h"
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
38 class MSVehicle;
39 class MSVehicleType;
40 class MSCFModel_CACC;
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
49 class MSCFModel_ACC : public MSCFModel {
50 public:
54  MSCFModel_ACC(const MSVehicleType* vtype);
55 
58 
59 
62 
71  double followSpeed(const MSVehicle* const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle* const pred = 0) const;
72 
73 
81  double stopSpeed(const MSVehicle* const veh, const double speed, double gap2pred) const;
82 
88  double getSecureGap(const double speed, const double leaderSpeed, const double leaderMaxDecel) const;
89 
97  double insertionFollowSpeed(const MSVehicle* const v, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle* const pred = 0) const;
98 
99 
109  double interactionGap(const MSVehicle* const, double vL) const;
110 
111 
116  int getModelID() const {
117  return SUMO_TAG_CF_ACC;
118  }
120 
121 
122 
127  MSCFModel* duplicate(const MSVehicleType* vtype) const;
128 
131  ret->ACC_ControlMode = 0;
132  ret->lastUpdateTime = 0;
133  return ret;
134  }
135 
136  friend class MSCFModel_CACC;
137 
138 private:
140  public:
145  };
146 
147 
148 private:
149  double _v(const MSVehicle* const veh, const double gap2pred, const double mySpeed,
150  const double predSpeed, const double desSpeed, const bool respectMinGap = true) const;
151 
152  double accelSpeedControl(double vErr) const;
153  double accelGapControl(const MSVehicle* const veh, const double gap2pred, const double speed, const double predSpeed, double vErr) const;
154 
155 
156 private:
164 
165 private:
168 };
169 
170 #endif /* MSCFModel_ACC_H */
MSVehicleType
The car-following model and parameter.
Definition: MSVehicleType.h:66
MSCFModel_ACC::accelGapControl
double accelGapControl(const MSVehicle *const veh, const double gap2pred, const double speed, const double predSpeed, double vErr) const
Definition: MSCFModel_ACC.cpp:170
MSCFModel_ACC::myCollisionAvoidanceGainSpeed
double myCollisionAvoidanceGainSpeed
Definition: MSCFModel_ACC.h:162
MSCFModel_ACC::myCollisionAvoidanceGainSpace
double myCollisionAvoidanceGainSpace
Definition: MSCFModel_ACC.h:163
MSCFModel_ACC::createVehicleVariables
VehicleVariables * createVehicleVariables() const
Returns model specific values which are stored inside a vehicle and must be used with casting.
Definition: MSCFModel_ACC.h:129
MSCFModel_ACC::ACCVehicleVariables::lastUpdateTime
SUMOTime lastUpdateTime
Definition: MSCFModel_ACC.h:144
MSCFModel_ACC::interactionGap
double interactionGap(const MSVehicle *const, double vL) const
Returns the maximum gap at which an interaction between both vehicles occurs.
Definition: MSCFModel_ACC.cpp:160
MSCFModel_ACC::_v
double _v(const MSVehicle *const veh, const double gap2pred, const double mySpeed, const double predSpeed, const double desSpeed, const bool respectMinGap=true) const
Definition: MSCFModel_ACC.cpp:204
MSCFModel_ACC::myGapClosingControlGainSpeed
double myGapClosingControlGainSpeed
Definition: MSCFModel_ACC.h:158
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:35
MSCFModel_ACC::ACCVehicleVariables::ACCVehicleVariables
ACCVehicleVariables()
Definition: MSCFModel_ACC.h:141
MSCFModel_CACC
The CACC car-following model.
Definition: MSCFModel_CACC.h:49
MSCFModel_ACC::mySpeedControlGain
double mySpeedControlGain
Definition: MSCFModel_ACC.h:157
MSCFModel_ACC::myGapControlGainSpace
double myGapControlGainSpace
Definition: MSCFModel_ACC.h:161
MSCFModel_ACC::accelSpeedControl
double accelSpeedControl(double vErr) const
Definition: MSCFModel_ACC.cpp:165
MSCFModel_ACC::myGapClosingControlGainSpace
double myGapClosingControlGainSpace
Definition: MSCFModel_ACC.h:159
SUMO_TAG_CF_ACC
Definition: SUMOXMLDefinitions.h:288
MSCFModel_ACC::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_ACC.cpp:96
MSCFModel_ACC::getModelID
int getModelID() const
Returns the model's name.
Definition: MSCFModel_ACC.h:116
MSCFModel_ACC::insertionFollowSpeed
double insertionFollowSpeed(const MSVehicle *const v, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle *const pred=0) const
Computes the vehicle's acceptable speed at insertion.
Definition: MSCFModel_ACC.cpp:129
MSCFModel_ACC::operator=
MSCFModel_ACC & operator=(const MSCFModel_ACC &s)
Invalidated assignment operator.
MSCFModel_ACC
The ACC car-following model.
Definition: MSCFModel_ACC.h:49
MSCFModel_ACC::getSecureGap
double getSecureGap(const double speed, const double leaderSpeed, const double leaderMaxDecel) const
Returns the a gap such that the gap mode acceleration of the follower is zero.
Definition: MSCFModel_ACC.cpp:119
MSCFModel_ACC::ACCVehicleVariables
Definition: MSCFModel_ACC.h:139
MSCFModel_ACC::~MSCFModel_ACC
~MSCFModel_ACC()
Destructor.
Definition: MSCFModel_ACC.cpp:92
MSCFModel_ACC::ACCVehicleVariables::ACC_ControlMode
int ACC_ControlMode
The vehicle's ACC control mode. 0 for speed control and 1 for gap control.
Definition: MSCFModel_ACC.h:143
MSCFModel_ACC::myGapControlGainSpeed
double myGapControlGainSpeed
Definition: MSCFModel_ACC.h:160
MSCFModel::VehicleVariables
Definition: MSCFModel.h:61
MSCFModel.h
MSCFModel_ACC::MSCFModel_ACC
MSCFModel_ACC(const MSVehicleType *vtype)
Constructor.
Definition: MSCFModel_ACC.cpp:79
MSCFModel
The car-following model abstraction.
Definition: MSCFModel.h:57
config.h
MSCFModel_ACC::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_ACC.cpp:110
MSCFModel_ACC::duplicate
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
Definition: MSCFModel_ACC.cpp:278
SUMOXMLDefinitions.h
MSVehicle
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:80