|
Autopysta
|
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. | |
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.
| 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.
| _t | Time. |
| _x | Position. |
| _v | Speed. |
| _a | Acceleration. |
| _lane | Lane. |
| point::point | ( | point * | p | ) |
Copy constructor for the point class.
Creates a new point object by copying the values from another point object.
| p | Pointer to another point object to duplicate. |
| double point::A | ( | ) |
Gets the acceleration value.
Retrieves the current acceleration value of the point.
| int point::LANE | ( | ) |
Gets the lane value.
Retrieves the current lane value of the point.
| void point::reset_time | ( | ) |
Resets the time of the point to zero.
This function resets the time value of the point object to zero.
| void point::set_accel | ( | double | _a | ) |
Sets the acceleration of the point.
Updates the acceleration value for the point.
| _a | New acceleration value. |
| void point::set_lane | ( | int | _lane | ) |
Sets the lane of the point.
Updates the lane value for the point.
| _lane | New lane value. |
| void point::set_velocity | ( | double | _v | ) |
Sets the velocity of the point.
Updates the velocity value for the point.
| _v | New velocity value. |
| void point::set_x | ( | double | _x | ) |
Sets the position of the point.
Updates the position value for the point.
| _x | New position value. |
| double point::T | ( | ) |
Gets the time value.
Retrieves the current time value of the point.
| 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.
| double point::V | ( | ) |
Gets the velocity value.
Retrieves the current velocity value of the point.
| double point::X | ( | ) |
Gets the position value.
Retrieves the current position value of the point.