Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSCFModel_ACC.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-2026 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// ACC car-following model based on [1], [2].
19// [1] Milanes, V., and S. E. Shladover. Handling Cut-In Vehicles in Strings
20// of Cooperative Adaptive Cruise Control Vehicles. Journal of Intelligent
21// Transportation Systems, Vol. 20, No. 2, 2015, pp. 178-191.
22// [2] Xiao, L., M. Wang and B. van Arem. Realistic Car-Following Models for
23// Microscopic Simulation of Adaptive and Cooperative Adaptive Cruise
24// Control Vehicles. Transportation Research Record: Journal of the
25// Transportation Research Board, No. 2623, 2017. (DOI: 10.3141/2623-01).
26/****************************************************************************/
27#pragma once
28#include <config.h>
29
30#include "MSCFModel.h"
32
33// ===========================================================================
34// class declarations
35// ===========================================================================
36class MSVehicle;
37class MSVehicleType;
38class MSCFModel_CACC;
39
40// ===========================================================================
41// class definitions
42// ===========================================================================
47class MSCFModel_ACC : public MSCFModel {
48public:
52 MSCFModel_ACC(const MSVehicleType* vtype);
53
56
57
60
69 double followSpeed(const MSVehicle* const veh, double speed, double gap2pred, double predSpeed,
70 double predMaxDecel, const MSVehicle* const pred = 0, const CalcReason usage = CalcReason::CURRENT) const;
71
72
80 double stopSpeed(const MSVehicle* const veh, const double speed, double gap2pred, double decel, const CalcReason usage = CalcReason::CURRENT) const;
81
88 double getSecureGap(const MSVehicle* const veh, const MSVehicle* const pred, const double speed, const double leaderSpeed, const double leaderMaxDecel) const;
89
98 double insertionFollowSpeed(const MSVehicle* const v, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle* const pred = 0) const;
99
100
110 double interactionGap(const MSVehicle* const, double vL) const;
111
112
117 double maximumLaneSpeedCF(const MSVehicle* const veh, double maxSpeed, double maxSpeedLane) const {
118 double result = MIN2(maxSpeed, maxSpeedLane);
119 if (myApplyDriverstate) {
120 applyOwnSpeedPerceptionError(veh, result);
121 }
122 return result;
123 }
128 int getModelID() const {
129 return SUMO_TAG_CF_ACC;
130 }
132
133
134
139 MSCFModel* duplicate(const MSVehicleType* vtype) const;
140
143 ret->ACC_ControlMode = 0;
144 ret->lastUpdateTime = 0;
145 return ret;
146 }
147
148 friend class MSCFModel_CACC;
149
150private:
158
159
160private:
161 double _v(const MSVehicle* const veh, const double gap2pred, const double mySpeed,
162 const double predSpeed, const double desSpeed, const bool respectMinGap = true) const;
163
164 double accelSpeedControl(double vErr) const;
165 double accelGapControl(const MSVehicle* const veh, const double gap2pred, const double speed, const double predSpeed, double vErr) const;
166
167
168private:
178
179private:
182};
long long int SUMOTime
Definition GUI.h:36
@ SUMO_TAG_CF_ACC
T MIN2(T a, T b)
Definition StdDefs.h:80
int ACC_ControlMode
The vehicle's ACC control mode. 0 for speed control and 1 for gap control.
The ACC car-following model.
double accelSpeedControl(double vErr) const
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)
double myCollisionAvoidanceGainSpeed
VehicleVariables * createVehicleVariables() const
Returns model specific values which are stored inside a vehicle and must be used with casting.
double myCollisionAvoidanceGainSpace
double maximumLaneSpeedCF(const MSVehicle *const veh, double maxSpeed, double maxSpeedLane) const
Returns the maximum velocity the CF-model wants to achieve in the next step.
double myGapControlGainSpace
double interactionGap(const MSVehicle *const, double vL) const
Returns the maximum gap at which an interaction between both vehicles occurs.
MSCFModel_ACC & operator=(const MSCFModel_ACC &s)
Invalidated assignment operator.
double stopSpeed(const MSVehicle *const veh, const double speed, double gap2pred, double decel, const CalcReason usage=CalcReason::CURRENT) const
Computes the vehicle's safe speed for approaching a non-moving obstacle (no dawdling)
double accelGapControl(const MSVehicle *const veh, const double gap2pred, const double speed, const double predSpeed, double vErr) const
double myGapClosingControlGainSpeed
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.
double myGapControlGainSpeed
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.
~MSCFModel_ACC()
Destructor.
double myEmergencyThreshold
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
double _v(const MSVehicle *const veh, const double gap2pred, const double mySpeed, const double predSpeed, const double desSpeed, const bool respectMinGap=true) const
double myApplyDriverstate
double myGapClosingControlGainSpace
int getModelID() const
Returns the model's name.
double mySpeedControlGain
The CACC car-following model.
The car-following model abstraction.
Definition MSCFModel.h:57
CalcReason
What the return value of stop/follow/free-Speed is used for.
Definition MSCFModel.h:79
@ CURRENT
the return value is used for calculating the next speed
Definition MSCFModel.h:81
void applyOwnSpeedPerceptionError(const MSVehicle *const veh, double &speed) const
Overwrites sped by the perceived values obtained from the vehicle's driver state,.
Representation of a vehicle in the micro simulation.
Definition MSVehicle.h:77
The car-following model and parameter.