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 /****************************************************************************/
15 // CACC 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_CACC_H
25 #define MSCFModel_CACC_H
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #include <config.h>
31 
32 #include "MSCFModel.h"
33 #include "MSCFModel_ACC.h"
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
39 class MSVehicle;
40 class MSVehicleType;
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
49 class MSCFModel_CACC : public MSCFModel {
50 public:
55  MSCFModel_CACC(const MSVehicleType* vtype);
56 
59 
60 
63 
72  double followSpeed(const MSVehicle* const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle* const pred = 0) const;
73 
74 
82  double stopSpeed(const MSVehicle* const veh, const double speed, double gap2pred) const;
83 
84 
90  double getSecureGap(const double speed, const double leaderSpeed, const double leaderMaxDecel) const;
91 
99  double insertionFollowSpeed(const MSVehicle* const v, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle* const pred = 0) const;
100 
101 
111  double interactionGap(const MSVehicle* const, double vL) const;
112 
113 
118  int getModelID() const {
119  return SUMO_TAG_CF_CACC;
120  }
122 
123 
124 
129  MSCFModel* duplicate(const MSVehicleType* vtype) const;
130 
133  ret->CACC_ControlMode = 0;
134  ret->lastUpdateTime = 0;
135  return ret;
136  }
137 
138 
139 private:
141  public:
146  };
147 
148 
149 private:
150  double _v(const MSVehicle* const veh, const MSVehicle* const pred, const double gap2pred, const double mySpeed,
151  const double predSpeed, const double desSpeed, const bool respectMinGap = true) const;
152 
153  double speedSpeedContol(const double speed, double vErr) const;
154  double speedGapControl(const MSVehicle* const veh, const double gap2pred,
155  const double speed, const double predSpeed, const double desSpeed, double vErr,
156  const MSVehicle* const pred) const;
157 
158 private:
168 
169 private:
172 };
173 
174 #endif /* MSCFModel_CACC_H */
double myHeadwayTimeACC
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
double insertionFollowSpeed(const MSVehicle *const v, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle *const pred=0) const
Computes the vehicle&#39;s acceptable speed at insertion.
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:80
long long int SUMOTime
Definition: SUMOTime.h:35
The car-following model abstraction.
Definition: MSCFModel.h:57
int CACC_ControlMode
The vehicle&#39;s CACC precious time step gap error.
The CACC car-following model.
The car-following model and parameter.
Definition: MSVehicleType.h:66
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
double myCollisionAvoidanceGainGapDot
double myGapClosingControlGainGapDot
double speedSpeedContol(const double speed, double vErr) const
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
double interactionGap(const MSVehicle *const, double vL) const
Returns the maximum gap at which an interaction between both vehicles occurs.
The ACC car-following model.
Definition: MSCFModel_ACC.h:49
MSCFModel_ACC acc_CFM
double myCollisionAvoidanceGainGap
MSCFModel_CACC & operator=(const MSCFModel_CACC &s)
Invalidated assignment operator.
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)
MSCFModel_CACC(const MSVehicleType *vtype)
Constructor.
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.
~MSCFModel_CACC()
Destructor.
virtual MSCFModel::VehicleVariables * createVehicleVariables() const
Returns model specific values which are stored inside a vehicle and must be used with casting...
double myGapControlGainGap
int getModelID() const
Returns the model&#39;s name.
double myGapClosingControlGainGap
double mySpeedControlGain
double myGapControlGainGapDot
double stopSpeed(const MSVehicle *const veh, const double speed, double gap2pred) const
Computes the vehicle&#39;s safe speed for approaching a non-moving obstacle (no dawdling) ...