-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathNode.java
More file actions
89 lines (81 loc) · 1.8 KB
/
Node.java
File metadata and controls
89 lines (81 loc) · 1.8 KB
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
/**
* @author kolovsky
* @author jmacura
* @version 2.00.000
*/
public class Node
{
/**
* Jmeno vrcholu.
*/
//vlastnosti
public int id;
public int x;
public int y;
public int people;
public boolean isSimple;
public boolean isHeliport = false;
public Process proces;
//vnitrni propojeni a promene pro algoritmy
public Node next = null;
// for dijkstra
public boolean isCloud = false;
public int cost = Integer.MAX_VALUE; //[minutes:time]
public Node prev = null;
//ceny do jednotlivich letist
public int [] costToAirAll;
// nalezi ke grafu
public AirportNode suppliedFrom = null; //prislusnost k letisti
public int costToAir;
public Node [] path;
//zaznamy a statistiky
public Statistic log = new Statistic();
//public Edge edges[];
public Edge firstEdge = null;
public Edge lastEdge = null;
/**
* Konstruktor objektu tridy {@code Node}.
*
* @param id Jmeno noveho vrcholu
* @param x X-ova souradnice
* @param y Y-ova souradnice
*/
public Node(int id, int x, int y)
{
setId(id);
//edges = null;
this.x = x;
this.y = y;
}
/**
* Prida hranu
* @param newEdge Nova hrana.
*/
public void addEdge(Edge newEdge){
if (firstEdge == null) {
firstEdge = newEdge;
lastEdge = newEdge;
}
else {
lastEdge.next = newEdge;
lastEdge = newEdge;
}
}
/**
* Nastavuje parametr id.
* @param newId Nove ID
*/
public void setId(int newId)
{
this.id = newId;
}
/**
* Vraci parametr id.
*
* @return ID vrcholu
*/
public int getId()
{
return this.id;
}
}