Eclipse SUMO - Simulation of Urban MObility
MSCFModel_CACC.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 /****************************************************************************/
14 // CACC car-following model based on [1], [2].
15 // [1] Milanes, V., and S. E. Shladover. Handling Cut-In Vehicles in Strings
16 // of Cooperative Adaptive Cruise Control Vehicles. Journal of Intelligent
17 // Transportation Systems, Vol. 20, No. 2, 2015, pp. 178-191.
18 // [2] Xiao, L., M. Wang and B. van Arem. Realistic Car-Following Models for
19 // Microscopic Simulation of Adaptive and Cooperative Adaptive Cruise
20 // Control Vehicles. Transportation Research Record: Journal of the
21 // Transportation Research Board, No. 2623, 2017. (DOI: 10.3141/2623-01).
22 /****************************************************************************/
23 #ifndef MSCFModel_CACC_H
24 #define MSCFModel_CACC_H
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #include <config.h>
30 
31 #include "MSCFModel.h"
32 #include "MSCFModel_ACC.h"
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
38 class MSVehicle;
39 class MSVehicleType;
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
48 class MSCFModel_CACC : public MSCFModel {
49 public:
54  MSCFModel_CACC(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 
83 
91  double getSecureGap(const MSVehicle* const veh, const MSVehicle* const pred, const double speed, const double leaderSpeed, const double leaderMaxDecel) const;
92 
100  double insertionFollowSpeed(const MSVehicle* const v, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle* const pred = 0) const;
101 
102 
112  double interactionGap(const MSVehicle* const, double vL) const;
113 
114 
119  int getModelID() const {
120  return SUMO_TAG_CF_CACC;
121  }
123 
124 
125 
130  MSCFModel* duplicate(const MSVehicleType* vtype) const;
131 
134  ret->CACC_ControlMode = 0;
135  ret->lastUpdateTime = 0;
136  return ret;
137  }
138 
139 
140 private:
142  public:
147  };
148 
149 
150 private:
151  double _v(const MSVehicle* const veh, const MSVehicle* const pred, const double gap2pred, const double mySpeed,
152  const double predSpeed, const double desSpeed, const bool respectMinGap = true) const;
153 
154  double speedSpeedContol(const double speed, double vErr) const;
155  double speedGapControl(const MSVehicle* const veh, const double gap2pred,
156  const double speed, const double predSpeed, const double desSpeed, double vErr,
157  const MSVehicle* const pred) const;
158 
159 private:
169 
170 private:
173 };
174 
175 #endif /* MSCFModel_CACC_H */
MSVehicleType
The car-following model and parameter.
Definition: MSVehicleType.h:65
MSCFModel_CACC::getSecureGap
double getSecureGap(const MSVehicle *const veh, const MSVehicle *const pred, 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_CACC.cpp:127
MSCFModel_CACC::myGapControlGainGap
double myGapControlGainGap
Definition: MSCFModel_CACC.h:164
MSCFModel_CACC::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_CACC.cpp:148
MSCFModel_CACC::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_CACC.cpp:118
MSCFModel_CACC::duplicate
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
Definition: MSCFModel_CACC.cpp:351
MSCFModel_CACC::CACCVehicleVariables
Definition: MSCFModel_CACC.h:141
SUMO_TAG_CF_CACC
Definition: SUMOXMLDefinitions.h:288
MSCFModel_CACC::CACCVehicleVariables::CACCVehicleVariables
CACCVehicleVariables()
Definition: MSCFModel_CACC.h:143
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
MSCFModel_CACC
The CACC car-following model.
Definition: MSCFModel_CACC.h:48
MSCFModel_CACC::CACCVehicleVariables::lastUpdateTime
SUMOTime lastUpdateTime
Definition: MSCFModel_CACC.h:146
MSCFModel_CACC::myGapClosingControlGainGapDot
double myGapClosingControlGainGapDot
Definition: MSCFModel_CACC.h:163
MSCFModel_CACC::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_CACC.cpp:89
MSCFModel_CACC::myHeadwayTimeACC
double myHeadwayTimeACC
Definition: MSCFModel_CACC.h:168
MSCFModel_CACC::myGapControlGainGapDot
double myGapControlGainGapDot
Definition: MSCFModel_CACC.h:165
MSCFModel_CACC::mySpeedControlGain
double mySpeedControlGain
Definition: MSCFModel_CACC.h:161
MSCFModel_CACC::myCollisionAvoidanceGainGapDot
double myCollisionAvoidanceGainGapDot
Definition: MSCFModel_CACC.h:167
MSCFModel_CACC::acc_CFM
MSCFModel_ACC acc_CFM
Definition: MSCFModel_CACC.h:160
MSCFModel_CACC::createVehicleVariables
virtual MSCFModel::VehicleVariables * createVehicleVariables() const
Returns model specific values which are stored inside a vehicle and must be used with casting.
Definition: MSCFModel_CACC.h:132
MSCFModel_ACC.h
MSCFModel_CACC::CACCVehicleVariables::CACC_ControlMode
int CACC_ControlMode
The vehicle's CACC precious time step gap error.
Definition: MSCFModel_CACC.h:145
MSCFModel_CACC::myCollisionAvoidanceGainGap
double myCollisionAvoidanceGainGap
Definition: MSCFModel_CACC.h:166
MSCFModel_ACC
The ACC car-following model.
Definition: MSCFModel_ACC.h:48
MSCFModel_CACC::speedSpeedContol
double speedSpeedContol(const double speed, double vErr) const
Definition: MSCFModel_CACC.cpp:193
MSCFModel_CACC::_v
double _v(const MSVehicle *const veh, const MSVehicle *const pred, const double gap2pred, const double mySpeed, const double predSpeed, const double desSpeed, const bool respectMinGap=true) const
Definition: MSCFModel_CACC.cpp:272
MSCFModel::VehicleVariables
Definition: MSCFModel.h:60
MSCFModel.h
MSCFModel
The car-following model abstraction.
Definition: MSCFModel.h:56
config.h
MSCFModel_CACC::getModelID
int getModelID() const
Returns the model's name.
Definition: MSCFModel_CACC.h:119
MSCFModel_CACC::MSCFModel_CACC
MSCFModel_CACC(const MSVehicleType *vtype)
Constructor.
Definition: MSCFModel_CACC.cpp:71
MSCFModel_CACC::operator=
MSCFModel_CACC & operator=(const MSCFModel_CACC &s)
Invalidated assignment operator.
MSCFModel_CACC::interactionGap
double interactionGap(const MSVehicle *const, double vL) const
Returns the maximum gap at which an interaction between both vehicles occurs.
Definition: MSCFModel_CACC.cpp:188
MSCFModel_CACC::myGapClosingControlGainGap
double myGapClosingControlGainGap
Definition: MSCFModel_CACC.h:162
SUMOXMLDefinitions.h
MSCFModel_CACC::~MSCFModel_CACC
~MSCFModel_CACC()
Destructor.
Definition: MSCFModel_CACC.cpp:85
MSCFModel_CACC::speedGapControl
double speedGapControl(const MSVehicle *const veh, const double gap2pred, const double speed, const double predSpeed, const double desSpeed, double vErr, const MSVehicle *const pred) const
Definition: MSCFModel_CACC.cpp:200
MSVehicle
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:79