Autopysta
Loading...
Searching...
No Matches
model Class Referenceabstract

Abstract car-following model class. More...

#include <model.h>

Inheritance diagram for model:
example_car gipps idm linear newell newell_constrained_timestep newell_random_acceleration martinez_jin_2020

Public Member Functions

virtual void validate_parameters (params *p=nullptr)
 Validate the model parameters.
 
virtual double equil_spcg (double vl, double vf, params *p=nullptr)=0
 Compute the equilibrium spacing between vehicles.
 
virtual double wave_speed (point *leader, point *follower, params *p)=0
 Compute the wave speed of a traffic flow disturbance.
 
virtual double free_flow_speed (params *p=nullptr)=0
 Get the free-flow speed of the model.
 
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.
 

Public Attributes

paramspars
 Parameters for the car-following model.
 

Protected Member Functions

virtual double accel (point *leader, point *follower, params *p)=0
 Compute a vehicle's acceleration based on its leader.
 

Detailed Description

Abstract car-following model class.

This class serves as the base for various car-following models, where vehicles adjust their speed based on the behavior of a leading vehicle and certain model-specific parameters.

Member Function Documentation

◆ accel()

virtual double model::accel ( point * leader,
point * follower,
params * p )
protectedpure virtual

Compute a vehicle's acceleration based on its leader.

This method computes the acceleration of the subject vehicle (follower) based on the position and speed of the leading vehicle (leader). If no leader is present, the behavior will depend on the model's specific implementation.

Parameters
leaderA point representing the leader's position and speed. Can be null for no leader.
followerA point representing the subject vehicle's position and speed.
pParameters for the model.
Returns
The computed acceleration.

Implemented in example_car, and newell.

◆ equil_spcg()

virtual double model::equil_spcg ( double vl,
double vf,
params * p = nullptr )
pure virtual

Compute the equilibrium spacing between vehicles.

This method calculates the equilibrium spacing between the leader and follower vehicles based on their velocities and model parameters.

Parameters
vlLeader's velocity.
vfFollower's velocity.
pModel parameters.
Returns
The equilibrium spacing.

Implemented in example_car, gipps, idm, linear, and newell.

◆ free_flow_speed()

virtual double model::free_flow_speed ( params * p = nullptr)
pure virtual

Get the free-flow speed of the model.

This method returns the free-flow speed, which is the speed vehicles travel at when there are no constraints (such as leading vehicles or road conditions).

Parameters
pModel parameters.
Returns
The free-flow speed.

Implemented in example_car, gipps, idm, linear, and newell.

◆ new_point() [1/2]

virtual point * model::new_point ( generalized_trajectory * leader,
trajectory * follower,
params * p = nullptr )
virtual

Compute the next point for a vehicle using trajectories.

This method computes the next position and speed of a follower vehicle based on the current trajectory of both the leader and the follower.

Parameters
leaderA generalized trajectory for the leader vehicle. Can be null for no leader.
followerA trajectory for the follower vehicle.
pModel parameters.
Returns
A point representing the follower's next position and speed.

Reimplemented in example_car, gipps, newell, newell_constrained_timestep, and newell_random_acceleration.

◆ new_point() [2/2]

virtual point * model::new_point ( point * leader,
point * follower,
params * p = nullptr )
virtual

Compute the next point for a vehicle.

Given the current positions of a leader and follower vehicle, this method calculates the next position and speed of the follower.

Parameters
leaderA point representing the leader's position and speed. Can be null for no leader.
followerA point representing the follower's position and speed.
pModel parameters.
Returns
A point representing the follower's next position and speed.

Reimplemented in newell.

◆ validate_parameters()

virtual void model::validate_parameters ( params * p = nullptr)
virtual

Validate the model parameters.

Validates that the model's parameters meet certain constraints. This ensures that the model works within its defined boundaries.

Parameters
pParameters for the car-following model. If null, uses the model's internal parameters.

Reimplemented in gipps, newell_constrained_timestep, and newell_random_acceleration.

◆ wave_speed()

virtual double model::wave_speed ( point * leader,
point * follower,
params * p )
pure virtual

Compute the wave speed of a traffic flow disturbance.

This method computes the wave speed of traffic disturbances based on the leader's and follower's positions and velocities.

Parameters
leaderA point representing the leader's position and velocity.
followerA point representing the follower's position and velocity.
pModel parameters.
Returns
The computed wave speed (typically 0 unless overridden).

Implemented in example_car, gipps, idm, linear, and newell.


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