Go to the source code of this file.
◆ cone_vector_from_file()
Retrieves a cone vector from a file.
- Parameters
-
| filename | The filename to be open |
Definition at line 19 of file utils.cpp.
◆ consecutive_max_distance()
Retrieves the max consecutive distance between adjacent cones in a vector.
- Parameters
-
| filename | The filename to be open |
Definition at line 107 of file utils.cpp.
◆ extract_info()
| void extract_info |
( |
const std::string_view & |
filename_view, |
|
|
int & |
size, |
|
|
int & |
n_outliers |
|
) |
| |
Extracts the size and number of outliers from a filename.
- Parameters
-
| filename | The filename containing size and number of outliers information. |
| size | Output parameter to store the extracted size. |
| n_outliers | Output parameter to store the extracted number of outliers. |
The filename should be in the format "map_{size}_{n_outliers}.txt", where:
- "size" is an integer representing the size.
- "n_outliers" is an integer representing the number of outliers.
Example: If filename is "map_100_5.txt", size will be set to 100 and n_outliers to 5.
Definition at line 96 of file utils.cpp.
◆ get_current_date_time_as_string()
| std::string get_current_date_time_as_string |
( |
| ) |
|
Get current date and time as a string.
- Returns
- Current date and time as a string in "YYYY-MM-DD-HH:MM" format.
Definition at line 125 of file utils.cpp.
◆ open_read_file()
| std::ifstream open_read_file |
( |
const std::string & |
filename | ) |
|
Opens a file for reading.
- Parameters
-
| filename | The filename to be open |
- Returns
- returns the input ifstream buffer
Definition at line 3 of file utils.cpp.
◆ order_vector_of_pairs()
| std::vector< std::pair< double, double > > order_vector_of_pairs |
( |
const std::vector< std::pair< double, double > > & |
vec | ) |
|
orders a vector of pairs to make it easier to compare them
- Parameters
-
| vec | vector of pairs to be ordered |
- Returns
- ordered vector of pairs
Definition at line 118 of file utils.cpp.
◆ path_from_file()
Retrieves a path point vector from a file.
- Parameters
-
| filename | The filename to be open |
Definition at line 76 of file utils.cpp.
◆ round_n()
| float round_n |
( |
float |
num, |
|
|
int |
decimal_places |
|
) |
| |
rounds float to n decimal places
- Parameters
-
| num | number to be rounded |
| decimal_places | number of decimal places |
- Returns
- rounded number
Definition at line 136 of file utils.cpp.
◆ track_from_file()
Retrieves a track (a pair of colored cone vectors from each side) from a file.
- Parameters
-
| filename | The filename to be open |
Definition at line 51 of file utils.cpp.