forked from skyrahul/DTA2020
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unnecessary.py
45 lines (38 loc) · 1.48 KB
/
unnecessary.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
''' -------------------------------------------------------------------------------
----------------------------INITIALIZATION OF GUI----------- ----------------------
-----------------------------------------------------------------------------------'''
'''-----------------------------------------------------
----------------INCOMING FLOWS INITIALIZATION---------
--------------------------------------------------------'''
'''for i in incoming_links:
if(i in origin and i in destination):
incoming_flows[i] = [0,0,0,0]*(len(incoming_links[i])+2)
elif(i in origin or i in destination):
incoming_flows[i] = [0,0,0,0]*(len(incoming_links[i])+1)
else:
incoming_flows[i] = [0,0,0,0]*(len(incoming_links[i]))'''
'''-----------------------------------------------------------
----------------DEMAND INPUT (ASSUMED CONSTANT --------------
--------------------------------------------------------------'''
'''file = open("demand1.txt", "r")
demand_data = file.readlines()
temp=[]
for i in demand_data:
i = i.replace('\t',' ')
temp.append(list(map(int,i.split(' '))))
sum_OD = list(map(sum,zip(*temp)))
demand = defaultdict(list)
temp = 0
for i in OD:
demand[tuple(i)] = sum_OD[temp*4:temp*4+4]'''
file = open('demand1.txt','r+')
demand = file.readlines()
for i in range(len(demand)):
demand[i] = list(map(int,demand[i].split()))
f = open('demand.txt','w')
for i in demand:
s=""
for j in i[1:]:
s+=str(j)+" "
f.write(s+"\n")
f.close()