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

Gipps car-following model (1981). More...

#include <gipps.h>

Inheritance diagram for gipps:
model

Public Member Functions

 gipps ()
 Default constructor for the Gipps model.
 
 gipps (p_gipps *p)
 Constructor with custom parameters for the Gipps model.
 
void validate_parameters (params *p=(params *) nullptr) override
 Validates the parameters of the Gipps model.
 
double equil_spcg (double vl, double vf, params *p=(params *) nullptr) override
 Computes the equilibrium spacing between vehicles according to the Gipps model.
 
double wave_speed (point *leader, point *follower, params *p) override
 Not implemented yet.
 
double free_flow_speed (params *p=(params *) nullptr) override
 Computes the free-flow speed for the Gipps model.
 
pointnew_point (generalized_trajectory *leader, trajectory *follower, params *p=(params *) nullptr)
 Computes the next point in the follower's trajectory based on the leader's movement.
 
- Public Member Functions inherited from model
virtual pointnew_point (point *leader, point *follower, params *p=nullptr)
 Compute the next point for a vehicle.
 

Additional Inherited Members

- Public Attributes inherited from model
paramspars
 Parameters for the car-following model.
 
- Protected Member Functions inherited from model

Detailed Description

Gipps car-following model (1981).

This class implements the Gipps (1981) car-following model, which aims to simulate the behavior of vehicles in a traffic stream, particularly how a vehicle responds to the movement of the preceding vehicle. The model is based on realistic driver and vehicle behavior constraints such as maximum acceleration, braking, and desired speeds.

The model introduces two main constraints:

  • A free acceleration component that limits acceleration as the vehicle approaches its desired speed.
  • A braking component that ensures the vehicle can safely stop if the vehicle ahead brakes suddenly.

Reference: Gipps, P.G. (1981), "A Behavioural Car-Following Model for Computer Simulation", Transport Research Part B, Vol. 15, pp. 105-111.

Constructor & Destructor Documentation

◆ gipps() [1/2]

gipps::gipps ( )

Default constructor for the Gipps model.

Initializes the model with default parameter values, including default values for maximum acceleration, braking, and reaction time.

◆ gipps() [2/2]

gipps::gipps ( p_gipps * p)

Constructor with custom parameters for the Gipps model.

Initializes the model with a custom set of parameters, allowing the simulation to represent different vehicle and driver behaviors.

Parameters
pA pointer to a p_gipps parameter class containing the custom parameters.

Member Function Documentation

◆ equil_spcg()

double gipps::equil_spcg ( double vl,
double vf,
params * p = (params *) nullptr )
overridevirtual

Computes the equilibrium spacing between vehicles according to the Gipps model.

The equilibrium spacing is the safe distance that vehicles should maintain, accounting for the vehicle's speed and the driver's braking limits.

Parameters
vlThe velocity of the leader vehicle.
vfThe velocity of the follower vehicle.
pParameters for the Gipps model. If null, the model uses its default parameters.
Returns
The equilibrium spacing between the vehicles.

Implements model.

◆ free_flow_speed()

double gipps::free_flow_speed ( params * p = (params *) nullptr)
overridevirtual

Computes the free-flow speed for the Gipps model.

The free-flow speed represents the maximum speed the vehicle can travel at, assuming there is no interaction with other vehicles ahead (i.e., no leader).

Parameters
pParameters for the Gipps model. If null, the model uses its default parameters.
Returns
The free-flow speed of the vehicle.

Implements model.

◆ new_point()

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

Computes the next point in the follower's trajectory based on the leader's movement.

This function computes the next position, speed, and acceleration of the follower vehicle based on the current position of both the leader and follower vehicles. The model applies both acceleration and braking constraints to ensure safe car-following behavior.

Parameters
leaderGeneralized trajectory of the leader vehicle.
followerTrajectory of the follower vehicle.
pParameters for the Gipps model. If null, the model uses its default parameters.
Returns
A new point representing the updated position, speed, and acceleration of the follower.

Reimplemented from model.

◆ validate_parameters()

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

Validates the parameters of the Gipps model.

Ensures that the parameters for maximum acceleration, braking, and reaction time are non-zero and valid. If invalid, an exception is thrown.

Parameters
pParameters for the Gipps model. If null, the model uses its default parameters.

Reimplemented from model.

◆ wave_speed()

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

Not implemented yet.

This function is a placeholder for the wave speed calculation. In the Gipps model, the wave speed is not explicitly calculated.

Parameters
leaderA point representing the leader's position and speed.
followerA point representing the follower's position and speed.
pParameters for the Gipps model.
Returns
Always returns zero (0.0).

Implements model.


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