-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_file.py
48 lines (39 loc) · 1.03 KB
/
test_file.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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 21 16:41:15 2018
@author: ellereyireland1
"""
import system as sys
import run_gravity as g
import numpy as np
import coarse_graining as cg
import numpy as np
import matplotlib.pyplot as plt
import save
from tqdm import tqdm
level_graining = [0]
flows = []
s = g.Gravity()
area_size = []
total_flows =[]
system = sys.System()
system.random_system(100)
s.set_system(system)
s.tuning_function()
s.set_flows()
area_size.append(0)
total_flows.append(np.sum(system.flow_matrix))
for i in range(2, 10):
coarse_grainer = cg.Coarse_graining(system, i)
cell_area = coarse_grainer.get_cell_area()
grained_system = coarse_grainer.generate_new_system()
area_size.append(cell_area)
total_flows.append(np.sum(grained_system.flow_matrix))
save.save_object([area_size, total_flows], '[area_size], [total_flow]')
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(area_size, total_flows, 'bo')
ax.set_xlabel("Minimum cell size")
ax.set_ylabel("Total flow")
plt.show()