-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathintersection.h
58 lines (47 loc) · 1.29 KB
/
intersection.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
#ifndef _intersection_H
#define _intersection_H
#include "coordinate.h"
#include <vector>
#include "cell.h"
#include "arc.h"
using std::vector;
class phase{
public:
int id;
vector<int> from_arc,to_arc;
//phase();
explicit phase( int i = 0 );
void add_flow( int _from,int _to );
void set_on();
void set_off();
};
class intersection{
public:
static int size;
intersection();
intersection( int i,int t,int px,int py );
intersection( int i,int t,int px,int py,int min_g,int max_g,int rturn,int num_p );
int get_id()const{ return id; }
int get_type()const{ return type; }
coordinate get_pos()const{ return pos; }
int get_min_green()const{ return min_green; }
int get_max_green()const{ return max_green; }
int get_min_green_ticks()const{ return min_green_ticks; }
int get_max_green_ticks()const{ return max_green_ticks; }
bool get_right_turning()const{ return right_turning; }
int get_num_phases()const{ return num_phases; }
void add_node( int i );
void add_phase( int i,int from_arc,int to_arc );
void update_signal();
private:
int id;
int type;
coordinate pos;
int min_green,max_green;
bool right_turning;
int num_phases;
vector<int> connected_nodes;
vector<phase> phases;
int min_green_ticks,max_green_ticks;
};
#endif