|
Autopysta
|
Newell's car-following model (2002). More...
#include <newell.h>
Public Member Functions | |
| newell () | |
| Default constructor for Newell's model. | |
| newell (p_newell *p) | |
| Constructor for Newell's model with custom parameters. | |
| double | equil_spcg (double vl, double vf, params *p=nullptr) override |
| Computes the equilibrium spacing between the leader and follower vehicles. | |
| double | wave_speed (point *leader, point *follower, params *p) override |
| Returns the wave speed for Newell's model. | |
| double | free_flow_speed (params *p=nullptr) override |
| Returns the free-flow speed for Newell's model. | |
| point * | new_point (generalized_trajectory *leader, trajectory *follower, params *p=nullptr) override |
| Computes the next point in the follower's trajectory using generalized trajectories. | |
Public Member Functions inherited from model | |
| virtual void | validate_parameters (params *p=nullptr) |
| Validate the model parameters. | |
Protected Member Functions | |
| void | initialize_parameters (p_newell *p) |
| Initializes the model parameters for Newell's model. | |
| double | accel (point *leader, point *follower, params *p) override |
| Computes the follower vehicle's acceleration based on the leader's position. | |
| point * | new_point (point *leader, point *follower, params *p=nullptr) override |
| Computes the next point in the follower's trajectory. | |
Protected Member Functions inherited from model | |
Protected Attributes | |
| float | tau |
| Time gap (τ) between the trajectories of the follower and the leader. | |
| float | sj |
| Jam spacing (δ), the minimum distance between vehicles in a jam. | |
Additional Inherited Members | |
Public Attributes inherited from model | |
| params * | pars |
| Parameters for the car-following model. | |
Newell's car-following model (2002).
This class implements Newell's car-following model, which is a simplified model that describes how vehicles follow one another in traffic. The model assumes that each vehicle follows the same trajectory as the vehicle in front but delayed by a time gap (τ) and space gap (δ). These parameters are derived from the wave speed (w) and jam density (kj), which are the core elements of the model.
| newell::newell | ( | ) |
Default constructor for Newell's model.
This constructor initializes the model using default values for the wave speed (w), jam density (kj), and free-flow speed.
| newell::newell | ( | p_newell * | p | ) |
Computes the follower vehicle's acceleration based on the leader's position.
This method calculates the acceleration of the follower vehicle by translating the leader's position and velocity using Newell's piecewise linear trajectory rule.
| leader | A point representing the leader's position and velocity. |
| follower | A point representing the follower's position and velocity. |
| p | Parameters for Newell's model. |
Implements model.
|
overridevirtual |
Computes the equilibrium spacing between the leader and follower vehicles.
This method calculates the equilibrium spacing between the leader and follower vehicles based on their velocities. The equilibrium spacing increases with higher speeds.
| vl | The velocity of the leader vehicle. |
| vf | The velocity of the follower vehicle. |
| p | Pointer to the parameters for Newell's model. |
Implements model.
|
overridevirtual |
Returns the free-flow speed for Newell's model.
The free-flow speed is the maximum speed at which vehicles travel when there is no congestion.
| p | Parameters for Newell's model. |
Implements model.
|
protected |
Initializes the model parameters for Newell's model.
This function sets the time gap (τ) and jam spacing (δ) based on the wave speed and jam density of the model.
| p | Pointer to the p_newell parameters containing wave speed and jam density values. |
|
overridevirtual |
Computes the next point in the follower's trajectory using generalized trajectories.
This method calculates the next point in the follower vehicle's trajectory by considering both the leader and follower's current trajectories. It applies Newell's piecewise linear trajectory rule to compute the follower's next position and velocity.
| leader | Generalized trajectory representing the leader vehicle's path. |
| follower | Trajectory representing the follower vehicle's path. |
| p | Parameters for Newell's model. |
Reimplemented from model.
Reimplemented in newell_constrained_timestep, and newell_random_acceleration.
|
overrideprotectedvirtual |
Computes the next point in the follower's trajectory.
This method determines the next position and velocity for the follower vehicle by translating the leader's trajectory by a time gap (τ) and space gap (δ).
| leader | A point representing the leader's position and velocity. |
| follower | A point representing the follower's position and velocity. |
| p | Parameters for Newell's model. |
Reimplemented from model.
Returns the wave speed for Newell's model.
The wave speed represents the speed at which traffic disturbances propagate backward through a line of vehicles in congestion.
| leader | A point representing the leader's position and speed. |
| follower | A point representing the follower's position and speed. |
| p | Parameters for Newell's model. |
Implements model.