|
Autopysta
|
The Box class defines a time-space region for measuring Edie's flow and density.
More...
#include <results.h>
Public Member Functions | |
| Box (double xa, double xb, double ta, double tb) | |
| Constructor that defines a time-space box for measuring flow and density. | |
| bool | contains (point *p) |
| Checks whether a point lies within the box. | |
| point * | get_intersection (point *p1, point *p2) |
| Computes the intersection of two points with the edges of the box. | |
| point * | inter_hor (point *p1, point *p2, double x) |
| Calculates the intersection with a horizontal line at a given x value. | |
| point * | inter_ver (point *p1, point *p2, double t) |
| Calculates the intersection with a vertical line at a given t value. | |
| vector< double > * | get_edie () |
| Computes Edie's flow and density values for the box. | |
| void | print () |
| Prints the trails (vehicle paths) that pass through the box. | |
Public Attributes | |
| vector< vector< point * > * > * | trails |
| Stores the start and end points of trajectories crossing the box. | |
The Box class defines a time-space region for measuring Edie's flow and density.
A Box is a rectangular area in time and space used to calculate flow and density values based on the vehicle trajectories that pass through it.
| Box::Box | ( | double | xa, |
| double | xb, | ||
| double | ta, | ||
| double | tb ) |
Constructor that defines a time-space box for measuring flow and density.
| xa | Lower bound of the distance range. |
| xb | Upper bound of the distance range. |
| ta | Lower bound of the time range. |
| tb | Upper bound of the time range. |
| bool Box::contains | ( | point * | p | ) |
Checks whether a point lies within the box.
| p | The point to check. |
true if the point is inside the box, false otherwise. | vector< double > * Box::get_edie | ( | ) |
Computes Edie's flow and density values for the box.
Computes the intersection of two points with the edges of the box.
This method calculates the intersection point of a line segment defined by two points (p1, p2) with the edges of the box.
| p1 | First point of the line segment. |
| p2 | Second point of the line segment. |
Calculates the intersection with a horizontal line at a given x value.
| p1 | First point of the line segment. |
| p2 | Second point of the line segment. |
| x | The x-coordinate of the horizontal line. |
Calculates the intersection with a vertical line at a given t value.
| p1 | First point of the line segment. |
| p2 | Second point of the line segment. |
| t | The t-coordinate of the vertical line. |
| void Box::print | ( | ) |
Prints the trails (vehicle paths) that pass through the box.
This is used for debugging and visualization purposes.