-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcluster_sizes_np.cpp
More file actions
60 lines (42 loc) · 1.31 KB
/
cluster_sizes_np.cpp
File metadata and controls
60 lines (42 loc) · 1.31 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
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
#include "cluster_dynamics.h"
int main() {
increase_stack_limit(64);
int grid_size;
float birth_probability;
float density;
int update_per_site;
int number_of_census;
int replicate;
int lag;
int collect_frames = 1;
vector <int> cluster_sizes;
cout << "Enter grid size: ";
cin >> grid_size;
cout << "Enter birth probability: ";
cin >> birth_probability;
cout << "What is the corresponding density? : ";
cin >> density;
cout << "Enter updates per site: ";
cin >> update_per_site;
cout << "Enter number of census: ";
cin >> number_of_census;
cout << "Enter lag between frames: ";
cin >> lag;
cout << "Which replicate is this? : ";
cin >> replicate;
cout << "Do you want to collect frames? Answer with 1 or 0: ";
cin >> collect_frames;
find_patch_sizes_np(cluster_sizes, grid_size, birth_probability, number_of_census, lag, update_per_site, collect_frames);
ofstream outdata;
stringstream d;
d << setprecision(3) << density;
outdata.open("dump/np_cluster_sizes_"+std::to_string(grid_size)+"_"+d.str()+"_"+std::to_string(number_of_census)+"_"+std::to_string(replicate)+".txt");
if( !outdata ) {
cerr << "File error, try again." << endl;
exit(1);
}
for (int i=0; i< cluster_sizes.size(); i++){
outdata << cluster_sizes[i] << " ";
}
outdata.close();
}