-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathattiki.h
87 lines (72 loc) · 1.45 KB
/
attiki.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
#include <iostream>
#include <list>
#include <vector>
#include <queue>
#include <iterator>
#include "vehicle.h"
#include "extern.h"
class Segment;
class Toll;
class Highway{
private:
list<Segment*> list_of_segs; // lista apo segment
list<Segment*>::iterator it3;
public:
static int Nsegs; //einai auta pou diavazo apo grammi entolwn einai public wste na exei prosvash h main
static int K;
static int Percent;
Highway();
~Highway();
void operate();
int GetVehicleNumber(); // gyrnaei ton arithmo twn oximatwn
void AddNode(int,int); // ftiaxnei kai allo segment
};
class Entrance{
private:
vector<Toll*>::iterator iter;
vector<Toll*> t;
int Seg;
int Tolls;
int eTolls;
public:
Entrance(int);
~Entrance();
vector<Vehicle*> operate(int);
int vehicles_in_toll_queue(); // ta oximata pou einai sthn oura
};
class Segment{
private:
Entrance ent;
int capacity;
int seg;
int number_of_vehicles;
vector<Vehicle*>::iterator iter2;
vector<Vehicle*> v;
public:
Segment(int,int);
~Segment();
int get_number_of_vehicles();
void operate(Segment*);
vector<Vehicle*> pass(Segment*);
int enter(vector<Vehicle*>);
void exit();
int get_cap() const;
bool check(int);
};
class Toll
{
private:
bool is_regular;
int K;
int eksodos;
int cap;
public:
queue<Vehicle*> vq;
Toll(int,int,bool);
~Toll();
int get_size_of_vq() const;
void push_into_vq(int);
Vehicle* pop1();//vgazei apo to queue
void modify();//allazei to k
};
class Highway;