-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
28 lines (25 loc) · 1.02 KB
/
example.py
File metadata and controls
28 lines (25 loc) · 1.02 KB
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
import time
from src.Simulator import Simulator
from src.Parameters.IntervalParameter import IntervalParameter
from src.Parameters.ListParameter import ListParameter
import winsound
parameters = {
'sizes': [1000],
'steps': 1000,
'save_location': './Data/BA/',
'filename': 'new',
'show_legend': True,
'beta': IntervalParameter('beta', 0, 0.80, 0.1),
'gamma': IntervalParameter('gamma', .1, .1, .1),
'delta': IntervalParameter('delta', .1, .1, .1),
'theta': IntervalParameter('theta', 0.8, .8, 1),
'zeta': IntervalParameter('zeta', 0, .80, .1),
'timescale': ListParameter( 'timescale', [ 0.5, 1, 2, 4 ] ),
'vaccinate': IntervalParameter('vaccinate', 1, 1, 0.05 ),
'infect': IntervalParameter('infect', 1, 1, 1),
}
start = time.time()
s = Simulator( 'rSIR_csV', [ 'SameBA' ], { 'inf': [ 'Random' ], 'vac': [ 'Acquaintance' ] }, parameters, 'SaveLast' )
s.simulate()
end = time.time()
print('total:', end - start)