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

Represents a point in time for a vehicle in a traffic simulation. More...

#include <point.h>

Public Member Functions

 point (double _t, double _x, double _v, double _a, int _lane)
 Constructor for the point class.
 
 point (point *p)
 Copy constructor for the point class.
 
std::string to_str ()
 Converts the point object to a string representation.
 
void set_accel (double _a)
 Sets the acceleration of the point.
 
void set_velocity (double _v)
 Sets the velocity of the point.
 
void set_x (double _x)
 Sets the position of the point.
 
void set_lane (int _lane)
 Sets the lane of the point.
 
void reset_time ()
 Resets the time of the point to zero.
 
double T ()
 Gets the time value.
 
double X ()
 Gets the position value.
 
double V ()
 Gets the velocity value.
 
double A ()
 Gets the acceleration value.
 
int LANE ()
 Gets the lane value.
 

Detailed Description

Represents a point in time for a vehicle in a traffic simulation.

The point class stores and manages the time, position, velocity, acceleration, and lane of a vehicle during simulation.

Constructor & Destructor Documentation

◆ point() [1/2]

point::point ( double _t,
double _x,
double _v,
double _a,
int _lane )

Constructor for the point class.

Initializes the point object with the specified time, position, velocity, acceleration, and lane.

Parameters
_tTime.
_xPosition.
_vSpeed.
_aAcceleration.
_laneLane.

◆ point() [2/2]

point::point ( point * p)

Copy constructor for the point class.

Creates a new point object by copying the values from another point object.

Parameters
pPointer to another point object to duplicate.

Member Function Documentation

◆ A()

double point::A ( )

Gets the acceleration value.

Retrieves the current acceleration value of the point.

Returns
Acceleration value.

◆ LANE()

int point::LANE ( )

Gets the lane value.

Retrieves the current lane value of the point.

Returns
Lane value.

◆ reset_time()

void point::reset_time ( )

Resets the time of the point to zero.

This function resets the time value of the point object to zero.

◆ set_accel()

void point::set_accel ( double _a)

Sets the acceleration of the point.

Updates the acceleration value for the point.

Parameters
_aNew acceleration value.

◆ set_lane()

void point::set_lane ( int _lane)

Sets the lane of the point.

Updates the lane value for the point.

Parameters
_laneNew lane value.

◆ set_velocity()

void point::set_velocity ( double _v)

Sets the velocity of the point.

Updates the velocity value for the point.

Parameters
_vNew velocity value.

◆ set_x()

void point::set_x ( double _x)

Sets the position of the point.

Updates the position value for the point.

Parameters
_xNew position value.

◆ T()

double point::T ( )

Gets the time value.

Retrieves the current time value of the point.

Returns
Time value.

◆ to_str()

std::string point::to_str ( )

Converts the point object to a string representation.

This function generates a string that represents the current state of the point object with its time, position, velocity, acceleration, and lane.

Returns
A string representing the point object.

◆ V()

double point::V ( )

Gets the velocity value.

Retrieves the current velocity value of the point.

Returns
Velocity value.

◆ X()

double point::X ( )

Gets the position value.

Retrieves the current position value of the point.

Returns
Position value.

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