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-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// 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 int getModelID() const {
118 return SUMO_TAG_CF_ACC;
119 }
121
122
123
128 MSCFModel* duplicate(const MSVehicleType* vtype) const;
129
132 ret->ACC_ControlMode = 0;
133 ret->lastUpdateTime = 0;
134 return ret;
135 }
136
137 friend class MSCFModel_CACC;
138
139private:
147
148
149private:
150 double _v(const MSVehicle* const veh, const double gap2pred, const double mySpeed,
151 const double predSpeed, const double desSpeed, const bool respectMinGap = true) const;
152
153 double accelSpeedControl(double vErr) const;
154 double accelGapControl(const MSVehicle* const veh, const double gap2pred, const double speed, const double predSpeed, double vErr) const;
155
156
157private:
166
167private:
170};
long long int SUMOTime
Definition GUI.h:36
@ SUMO_TAG_CF_ACC
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 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 myGapClosingControlGainSpace
int getModelID() const
Returns the model's name.
double mySpeedControlGain
The CACC car-following model.
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
@ CURRENT
the return value is used for calculating the next speed
Definition MSCFModel.h:79
Representation of a vehicle in the micro simulation.
Definition MSVehicle.h:77
The car-following model and parameter.