Autopysta
Loading...
Searching...
No Matches
results.h
Go to the documentation of this file.
1
11#ifndef _RESULTS
12#define _RESULTS
13
14#include "trajectory.h"
15#include <map>
16#include <vector>
17
25class results {
26private:
27 vector<trajectory*>* all_t;
28 map<int, vector<trajectory*>*>* lanes;
29
36 void add_t_to_lanes(int lane, trajectory* t);
37
51 void classify();
52
61 vector<vector<double>*>* get_box_edges(double ta, double tb, double dt);
62
63public:
69 results(vector<trajectory*>* r);
70
80 vector<trajectory*>* porpista(int c);
81
88 vector<trajectory*>* by_lane(int l);
89
95 vector<trajectory*>* all_lanes();
96
102 vector<trajectory*>* get_all_t();
103
118 vector<vector<double>*>* edie(double ta, double tb, double dt, double xa, double xb, int l);
119
127 vector<point*>* passes_on_t(double t, int l);
128
136 vector<point*>* passes_on_x(double x, int l);
137};
138
145class Box {
146private:
147 double x_a;
148 double x_b;
149 double t_a;
150 double t_b;
151 double A;
152
153public:
154 vector<vector<point*>*>* trails;
155
164 Box(double xa, double xb, double ta, double tb);
165
172 bool contains(point* p);
173
185
194 point* inter_hor(point* p1, point* p2, double x);
195
204 point* inter_ver(point* p1, point* p2, double t);
205
211 vector<double>* get_edie();
212
218 void print();
219};
220
221#endif
The Box class defines a time-space region for measuring Edie's flow and density.
Definition results.h:145
Box(double xa, double xb, double ta, double tb)
Constructor that defines a time-space box for measuring flow and density.
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.
vector< vector< point * > * > * trails
Stores the start and end points of trajectories crossing the box.
Definition results.h:154
void print()
Prints the trails (vehicle paths) that pass through the box.
point * inter_hor(point *p1, point *p2, double x)
Calculates the intersection with a horizontal line at a given x value.
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.
Represents a point in time for a vehicle in a traffic simulation.
Definition point.h:23
The results class manages and processes simulation results.
Definition results.h:25
vector< trajectory * > * by_lane(int l)
Retrieves all trajectories in a specific lane.
results(vector< trajectory * > *r)
Constructor that initializes the results object with a list of trajectories.
vector< vector< double > * > * edie(double ta, double tb, double dt, double xa, double xb, int l)
Computes Edie's flow and density for a specific time interval and distance.
vector< point * > * passes_on_x(double x, int l)
Retrieves the list of points where vehicles pass at a specific distance in a given lane.
vector< trajectory * > * all_lanes()
Retrieves all trajectories across all lanes.
vector< trajectory * > * porpista(int c)
Splits a vehicle's trajectory by lane.
vector< trajectory * > * get_all_t()
Gets all vehicle trajectories.
vector< point * > * passes_on_t(double t, int l)
Retrieves the list of points where vehicles pass at a specific time in a given lane.
Represents a dynamic trajectory of a moving object.
Definition trajectory.h:59
Contains definitions for the generalized_trajectory, static_trajectory, and trajectory classes.