-
Notifications
You must be signed in to change notification settings - Fork 1
/
station.h
60 lines (48 loc) · 1.78 KB
/
station.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
// D O W N W I T H M A T T H E W A H N
#ifndef station_h_
#define station_h_
#include <utility> // pair
#include <vector>
#include "trip.h"
class Station{
public:
// defualt constructor
Station();
// constructor
Station(int id, std::string inName, double lon, double lat, std::list<std::pair<std::string,int>> inLines = {});
// setters
void setTrips(std::list<Trip> inTrips);
void addTrip(Trip inTrip);
void addLine(std::string inStr, int inIndex);
// void removeTrip(Trip& t) {trips.remove(t);}
void removeDups();
void setVisited(bool inVisited) {visited = inVisited;}
void addLine(std::pair<std::string, int> line);
void addHeuristic(int val) {heuristic += val;}
void setId(int newId) {id = newId;}
// getters
int getId() const {return id;}
const std::string &getName() const {return name;}
const std::list<std::pair<std::string,int>> &getLines() const
{return lines;}
const std::list<Trip> &getTrips() const {return trips;}
bool isOpen() const {return open;}
bool isVisited() const {return visited;}
int getHeuristic() const {return heuristic;}
std::string getCordStr() const;
const std::pair<double, double>& getCords() const {return cords;}
//Backpointer for UCS algorithm
Station* predecessor;
private:
int id;
std::string name;
std::pair<double,double> cords;
std::list<std::pair<std::string,int> > lines;
std::list<Trip> trips;
bool open;
bool visited;
int heuristic = 0;
// ? possibly operating hours
};
std::ostream& operator<<(std::ostream& os, const Station& s);
#endif