-
Notifications
You must be signed in to change notification settings - Fork 0
/
params.py
71 lines (51 loc) · 2.2 KB
/
params.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
# Written 4/7/14 by dh4gan
# Reads in data from parameters file
def read_parameters_single(paramfile):
'''
Reads in parameters for cliques_single.py
'''
rowdict = {'nCivilisations':0.0,'innerGHZ':0.0,'outerGHZ':0.0,'rScale':0.0,'zMin':0.0, 'Zmax':0.0,
'meanLifetime':0.0,'sdLifetime':0.0,'meanArrival':0.0,'sdArrival':0.0}
print '---'
for line in open(paramfile,'r'):
data = line.split()
key = data[0]
rowdict[key] = data[1]
print key,' \t',rowdict[key]
print '---'
nciv = int(rowdict['nCivilisations'])
rinner = float(rowdict['innerGHZ'])
router = float(rowdict['outerGHZ'])
rscale = float(rowdict['rScale'])
zmin = float(rowdict['zMin'])
zmax = float(rowdict['zMax'])
mu_life = float(rowdict['meanLifetime'])
sigma_life = float(rowdict['sdLifetime'])
mu_arrive = float(rowdict['meanArrival'])
sigma_arrive = float(rowdict['sdArrival'])
return nciv, rinner, router,rscale, zmin,zmax,mu_life,sigma_life, mu_arrive,sigma_arrive
def read_parameters_mcr(paramfile):
'''
Reads in parameters for cliques_MCR.py (multiple realisations)
'''
rowdict = {'nRuns': 0.0,'nCivilisations':0.0,'innerGHZ':0.0,'outerGHZ':0.0,'rScale':0.0,'zMin':0.0, 'Zmax':0.0,
'meanLifetime':0.0,'sdLifetime':0.0,'meanArrival':0.0,'sdArrival':0.0}
print '---'
for line in open(paramfile,'r'):
data = line.split()
key = data[0]
rowdict[key] = data[1]
print key,' \t',rowdict[key]
print '---'
nruns = int(rowdict['nRuns'])
nciv = int(rowdict['nCivilisations'])
rinner = float(rowdict['innerGHZ'])
router = float(rowdict['outerGHZ'])
rscale = float(rowdict['rScale'])
zmin = float(rowdict['zMin'])
zmax = float(rowdict['zMax'])
mu_life = float(rowdict['meanLifetime'])
sigma_life = float(rowdict['sdLifetime'])
mu_arrive = float(rowdict['meanArrival'])
sigma_arrive = float(rowdict['sdArrival'])
return nruns,nciv, rinner, router,rscale, zmin,zmax,mu_life,sigma_life, mu_arrive,sigma_arrive