|
Autopysta
|
Linear car-following model. More...
#include <linear.h>
Public Member Functions | |
| linear () | |
| Default constructor for the linear model. | |
| linear (p_linear *p) | |
| Constructor with custom parameters. | |
| double | equil_spcg (double vl, double vf, params *p) override |
| Computes the equilibrium spacing between vehicles. | |
| double | wave_speed (point *leader, point *follower, params *p) override |
| Computes the wave speed in the model. | |
| double | free_flow_speed (params *p=nullptr) override |
| Returns the free-flow speed of the linear model. | |
Public Member Functions inherited from model | |
| virtual void | validate_parameters (params *p=nullptr) |
| Validate the model parameters. | |
| virtual point * | new_point (point *leader, point *follower, params *p=nullptr) |
| Compute the next point for a vehicle. | |
| virtual point * | new_point (generalized_trajectory *leader, trajectory *follower, params *p=nullptr) |
| Compute the next point for a vehicle using trajectories. | |
Additional Inherited Members | |
Public Attributes inherited from model | |
| params * | pars |
| Parameters for the car-following model. | |
Protected Member Functions inherited from model | |
Linear car-following model.
The linear car-following model is a simple model that calculates the acceleration of a vehicle based on a linear function of the speed difference between the vehicle and the vehicle ahead (leader). It uses parameters such as free-flow speed, reaction time, and spacing to simulate vehicle behavior in traffic flow.
| linear::linear | ( | ) |
Default constructor for the linear model.
Initializes the linear model with default parameter values.
| linear::linear | ( | p_linear * | p | ) |
|
overridevirtual |
Computes the equilibrium spacing between vehicles.
This function calculates the equilibrium spacing between the leader and follower vehicles based on their velocities. The equilibrium spacing depends on the free-flow speed, reaction time, and spacing parameters.
| vl | The velocity of the leader vehicle. |
| vf | The velocity of the follower vehicle. |
| p | Pointer to the linear model parameters. |
Implements model.
|
overridevirtual |
Returns the free-flow speed of the linear model.
This function returns the free-flow speed, which is the speed at which vehicles travel in the absence of traffic congestion.
| p | Pointer to the linear model parameters. |
Implements model.
Computes the wave speed in the model.
The wave speed represents the speed at which traffic congestion propagates backward through a line of vehicles. This function calculates the wave speed based on model parameters such as reaction time and spacing.
| leader | The point representing the leader's position and speed. |
| follower | The point representing the follower's position and speed. |
| p | Pointer to the linear model parameters. |
Implements model.