-
Notifications
You must be signed in to change notification settings - Fork 1
/
Generate_Zoo.py
41 lines (35 loc) · 1.22 KB
/
Generate_Zoo.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
import utils.TAPNBuilder as TB
import utils.TestNets as TN
import utils.DTAPNBuilder as DB
import utils.CSVMaker as CM
import utils.LtLBuilder as LTL
import utils.JsonBuilder as JB
import time,os
### Writes a json, then xml,q,tapn and then a ltl file for a Zoo Topo
## Can be chained by increasing scale
def write_zoo(network, scale=1):
JB.jsonbuilder(network)
TB.write_to_file(network, scale=scale)
LTL.make_ltl_zoo(network, scale=scale)
def write_all_to_file(scale):
start = time.time()
cnt = 0
for f in os.listdir("data/gml"):
try:
write_zoo(f[:-4], scale=scale)
cnt += 1
except:
print(f"Failure! {f[:-5]} not converted..")
print("Operation done in: {} seconds".format((str(time.time()-start))[:5]))
print(f"Succesfully written {cnt} files.")
write_all_to_file(1)
######- I N F O -######
## This will build all the json files
#JB.build_all()
## This will build all the xml,q and tapaal files
#TB.write_all_to_file()
## This will build all the ltl files
#LTL.make_all_zoo()
### This will chain writing a json, (xml,q,tapaal) and ltl, one after the other
# By default, scale is already 1, so it can be used also without it.
#write_zoo("Network", scale=10)