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

Newell (2002) car-following model with a constrained timestep of 1. More...

#include <newell_constrained_timestep.h>

Inheritance diagram for newell_constrained_timestep:
newell model martinez_jin_2020

Public Member Functions

 newell_constrained_timestep ()
 Default constructor for the newell_constrained_timestep model.
 
 newell_constrained_timestep (p_newell *p)
 Constructor with custom parameters for Newell's model.
 
void validate_parameters (params *p=nullptr) override
 Validates the model parameters, ensuring the timestep is constrained to 1.
 
pointnew_point (generalized_trajectory *leader, trajectory *follower, params *p=nullptr) override
 Computes the next point in the follower's trajectory.
 
- Public Member Functions inherited from newell
 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.
 
- Public Member Functions inherited from model

Additional Inherited Members

- Public Attributes inherited from model
paramspars
 Parameters for the car-following model.
 
- Protected Member Functions inherited from newell
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.
 
pointnew_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 inherited from newell
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.
 

Detailed Description

Newell (2002) car-following model with a constrained timestep of 1.

This class is a variant of the Newell car-following model, with the only difference being that the timestep is validated and fixed to 1. It inherits all properties and functionalities of the original Newell model.

Constructor & Destructor Documentation

◆ newell_constrained_timestep() [1/2]

newell_constrained_timestep::newell_constrained_timestep ( )

Default constructor for the newell_constrained_timestep model.

This constructor initializes the model using default parameters for Newell’s car-following model with the timestep constrained to 1.

◆ newell_constrained_timestep() [2/2]

newell_constrained_timestep::newell_constrained_timestep ( p_newell * p)

Constructor with custom parameters for Newell's model.

This constructor allows setting custom values for Newell’s car-following model, with the timestep validation constrained to 1.

Parameters
pPointer to the p_newell parameter class containing model parameters.

Member Function Documentation

◆ new_point()

point * newell_constrained_timestep::new_point ( generalized_trajectory * leader,
trajectory * follower,
params * p = nullptr )
overridevirtual

Computes the next point in the follower's trajectory.

This method calculates the follower’s next position and velocity based on the constrained timestep model.

Parameters
leaderGeneralized trajectory of the leader vehicle.
followerTrajectory of the follower vehicle.
pParameters for Newell's car-following model.
Returns
A point representing the follower's updated position and speed.

Reimplemented from newell.

◆ validate_parameters()

void newell_constrained_timestep::validate_parameters ( params * p = nullptr)
overridevirtual

Validates the model parameters, ensuring the timestep is constrained to 1.

This method ensures that the timestep of the model adheres to the fixed value of 1. If any parameter violates this condition, an exception is raised.

Parameters
pPointer to the params class containing model parameters.

Reimplemented from model.


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