Autopysta
Loading...
Searching...
No Matches
linear Class Reference

Linear car-following model. More...

#include <linear.h>

Inheritance diagram for linear:
model

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 pointnew_point (point *leader, point *follower, params *p=nullptr)
 Compute the next point for a vehicle.
 
virtual pointnew_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
paramspars
 Parameters for the car-following model.
 
- Protected Member Functions inherited from model

Detailed Description

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.

Constructor & Destructor Documentation

◆ linear() [1/2]

linear::linear ( )

Default constructor for the linear model.

Initializes the linear model with default parameter values.

◆ linear() [2/2]

linear::linear ( p_linear * p)

Constructor with custom parameters.

Initializes the linear model with custom parameters provided via the p_linear class.

Parameters
pA pointer to the p_linear parameter object containing the model's parameters.

Member Function Documentation

◆ equil_spcg()

double linear::equil_spcg ( double vl,
double vf,
params * 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.

Parameters
vlThe velocity of the leader vehicle.
vfThe velocity of the follower vehicle.
pPointer to the linear model parameters.
Returns
The equilibrium spacing between the vehicles.

Implements model.

◆ free_flow_speed()

double linear::free_flow_speed ( params * p = nullptr)
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.

Parameters
pPointer to the linear model parameters.
Returns
The free-flow speed.

Implements model.

◆ wave_speed()

double linear::wave_speed ( point * leader,
point * follower,
params * p )
overridevirtual

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.

Parameters
leaderThe point representing the leader's position and speed.
followerThe point representing the follower's position and speed.
pPointer to the linear model parameters.
Returns
The computed wave speed.

Implements model.


The documentation for this class was generated from the following file: