-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathVertice.py
49 lines (35 loc) · 1.15 KB
/
Vertice.py
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
class Vertice():
def __init__(self, id):
self.id = id
self.estimativa = 999999
self.input = 0
self.output = 0
self.visitado = False
self.predecessor = []
def setVisitado(self, valor):
self.visitado = valor
def getVisitado(self):
return self.visitado
def setId(self, id):
self.id = id
def getId(self):
return self.id
def setImput(self, inp):
self.input = inp
def setOutput(self, out):
self.output = out
def setEstimativa(self, estimativa):
self.estimativa = estimativa
def getEstimativa(self):
return self.estimativa
def __str__(self):
return (" Vertice : %s \n Estimativa: %i \n Tempo(%i\%i): " % (
self.id, self.estimativa, self.input, self.output)) # imprimir o predecesso
def __lt__(self, v):
return self.estimativa < v.estimativa
def __eq__(self, v):
return self.estimativa == v.estimativa
def __eq__(self, v):
return self.id == v.id
def __gt__(self, v):
return self.estimativa > v.estimativa