|
Autopysta
|
Abstract car-following model class. More...
#include <model.h>
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 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. | |
Public Attributes | |
| params * | pars |
| 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. | |
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.
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.
| leader | A point representing the leader's position and speed. Can be null for no leader. |
| follower | A point representing the subject vehicle's position and speed. |
| p | Parameters for the model. |
Implemented in example_car, and newell.
|
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.
| vl | Leader's velocity. |
| vf | Follower's velocity. |
| p | Model parameters. |
Implemented in example_car, gipps, idm, linear, and newell.
|
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).
| p | Model parameters. |
Implemented in example_car, gipps, idm, linear, and newell.
|
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.
| leader | A generalized trajectory for the leader vehicle. Can be null for no leader. |
| follower | A trajectory for the follower vehicle. |
| p | Model parameters. |
Reimplemented in example_car, gipps, newell, newell_constrained_timestep, and newell_random_acceleration.
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.
| leader | A point representing the leader's position and speed. Can be null for no leader. |
| follower | A point representing the follower's position and speed. |
| p | Model parameters. |
Reimplemented in newell.
|
virtual |
Validate the model parameters.
Validates that the model's parameters meet certain constraints. This ensures that the model works within its defined boundaries.
| p | Parameters for the car-following model. If null, uses the model's internal parameters. |
Reimplemented in gipps, newell_constrained_timestep, and newell_random_acceleration.
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.
| leader | A point representing the leader's position and velocity. |
| follower | A point representing the follower's position and velocity. |
| p | Model parameters. |
Implemented in example_car, gipps, idm, linear, and newell.