-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDistancePath.h
93 lines (62 loc) · 2.53 KB
/
DistancePath.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/**
* @file DistancePath.h
* @brief This file contains the implementation of system to store information while performing a search of a path on the graph
* and its info
*
* @author Marcos William Ferreira Pinto, Matias Freitas Guimarães, Tiago Ribeiro
*
* @date 27/1/2022
*/
#ifndef AEDAGRAFOS_DISTANCEPATH_H
#define AEDAGRAFOS_DISTANCEPATH_H
#include <string>
#include <vector>
#include <set>
/**
* This class is a system to store information while performing a search of a path on the graph
* @param code This is the code of the bus stop it stores information from
* @param lineCode This is the code of the bus line we are using in this stop
* @param distance This is the distance from this bus top to the start the user selected
* @param previous This is the bus stop previous to getting to this one of the path
* @param visit This stores if this bus stop was already visited or not
* @param linesChanged This stores the lines we used to get from the start (user selected) to this bus stop
* @param nlinesChanged The number of lines we used to get from the start (user selected) to this bus stop
* @param zones This is the zones we used to get from the start (user selected) to this bus stop
*/
class DistancePath {
public:
DistancePath(const std::string &code, double distance, std::string lineCode);
DistancePath();
bool operator<(const DistancePath &rhs) const;
bool operator>(const DistancePath &rhs) const;
bool operator<=(const DistancePath &rhs) const;
bool operator>=(const DistancePath &rhs) const;
bool operator==(const std::string &rhs) const;
bool operator!=(const std::string &rhs) const;
void setCode(const std::string &code);
void setDistance(double distance);
const std::string &getCode() const;
double getDistance() const;
const std::string &getPrevious() const;
void setPrevious(const std::string &previous);
bool isVisited() const;
void visited();
const std::string &getLineCode() const;
void setLinesChanged(std::vector<std::string> linesChanged);
std::vector<std::string> getLinesChanged() const;
void setZones(std::set<std::string> zones);
std::set<std::string> getZones() const;
int getNLinesChanged() const;
void setNLinesChanged(int nLinesChanged);
void setForInit();
private:
std::string code;
std::string lineCode;
double distance;
std::string previous;
bool visit;
std::vector<std::string> linesChanged;
std::set<std::string> zones;
int nLinesChanged;
};
#endif //AEDAGRAFOS_DISTANCEPATH_H