-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclasses.hpp
57 lines (52 loc) · 1.2 KB
/
classes.hpp
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
#ifndef CLASSES_HPP
#define CLASSES_HPP
#include "include.hpp"
using namespace std;
using namespace std::chrono;
struct Edge
{
string source;
string destination;
int h;
};
struct Path
{
vector <Edge> edges;
int numOfCars;
int pathId;
};
class Car {
private :
int p;
Path carPath;
int position;
double curEmission;
vector <double> emissions;
vector <double> totalEmissions;
vector <milliseconds> enterTimes;
vector <milliseconds> finishTimes;
int pathId;
int carId;
public :
Car(Path path, int id, int pathId);
void printInfo();
int getP();
string getSource();
string getDestination();
int goAhead();
void addPollution(double newPollution);
int getPosition();
int getPathlength();
void addEnterTime(milliseconds enterTime);
void addFinishTime(milliseconds finishTime);
void setNewEmission(double newEmission, double newTotalEmission);
double getCurrentEmission();
void printEmissions();
void printTimes();
int getPathId();
vector <double> getEmissions();
vector <double> getTotalEmissions();
vector <milliseconds> getEnterTimes();
vector <milliseconds> getFinishTimes();
};
#endif