-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathterminalA.py
80 lines (64 loc) · 1.5 KB
/
terminalA.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
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
#------------ TERMINAL ACCUMULATOR --------------
import switchA01
import switchA02
import switchA03
#import switchA04
#import switchA05
#import switchA06
import threading
import coordenador
import valores
import time
import f1Score
nSwitches = valores.qntDeSwitches()
globalLimit = valores.limiteGlobal()
nPipes = valores.qntDePipes()
alfa = valores.alfa()
switchLimit = int(globalLimit/nSwitches)
import resource
import os
#Escolher e iniciar a quantidade de switches na rede
def executar():
def s1():
switchA01.main()
def s2():
switchA02.main()
def s3():
switchA03.main()
#def s4():
# switchA04.main()
#def s5():
# switchA05.main()
#def s6():
# switchA06.main()
t1 = threading.Thread(target=s1)
t2 = threading.Thread(target=s2)
t3 = threading.Thread(target=s3)
#t4 = threading.Thread(target=s4)
#t5 = threading.Thread(target=s5)
#t6 = threading.Thread(target=s6)
t1.start()
t2.start()
t3.start()
#t4.start()
#t5.start()
#t6.start()
t1.join()
t2.join()
t3.join()
#t4.join()
#t5.join()
#t6.join()
def main():
global globalLimit
print("\n --- ACCUMULATOR ---\n")
print("Limite Global:", globalLimit)
print("Quantidade de Switches:", nSwitches)
print("Quantidade de pipes:", nPipes)
print("Alfa:", alfa)
print("\ntrafego iniciado...\n")
executar()
coordenador.imprimir(globalLimit)
f1Score.main()
if __name__ == '__main__':
main()