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

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.
 
pointget_intersection (point *p1, point *p2)
 Computes the intersection of two points with the edges of the box.
 
pointinter_hor (point *p1, point *p2, double x)
 Calculates the intersection with a horizontal line at a given x value.
 
pointinter_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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Box()

Box::Box ( double xa,
double xb,
double ta,
double tb )

Constructor that defines a time-space box for measuring flow and density.

Parameters
xaLower bound of the distance range.
xbUpper bound of the distance range.
taLower bound of the time range.
tbUpper bound of the time range.

Member Function Documentation

◆ contains()

bool Box::contains ( point * p)

Checks whether a point lies within the box.

Parameters
pThe point to check.
Returns
true if the point is inside the box, false otherwise.

◆ get_edie()

vector< double > * Box::get_edie ( )

Computes Edie's flow and density values for the box.

Returns
A vector containing flow (Q) and density (K) values for the box.

◆ get_intersection()

point * Box::get_intersection ( point * p1,
point * p2 )

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.

Parameters
p1First point of the line segment.
p2Second point of the line segment.
Returns
The point of intersection with the box edges.

◆ inter_hor()

point * Box::inter_hor ( point * p1,
point * p2,
double x )

Calculates the intersection with a horizontal line at a given x value.

Parameters
p1First point of the line segment.
p2Second point of the line segment.
xThe x-coordinate of the horizontal line.
Returns
The intersection point.

◆ inter_ver()

point * Box::inter_ver ( point * p1,
point * p2,
double t )

Calculates the intersection with a vertical line at a given t value.

Parameters
p1First point of the line segment.
p2Second point of the line segment.
tThe t-coordinate of the vertical line.
Returns
The intersection point.

◆ print()

void Box::print ( )

Prints the trails (vehicle paths) that pass through the box.

This is used for debugging and visualization purposes.


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