//printf("%d\t%d\n",n,i);
P.next_generation(H, rnd, r.useRelative, r.useVerbose);
- P.write_two_site_population(popout,H,i+1);
+
+ if ((i+1) % r.write_mod == 0) {
+ P.write_two_site_population(popout,H,i+1);
+ }
//if (r.runUntilEscape && P.escaped(H)) break;
" (note the sign convention on these is P ~ exp(-H),\n"
" H = sum_i h_i s_i + sum_{i<j} J_{ij} s_i s_j\n"
" although internal representation is opposite)\n"
+" -write_mod (int) write out state every 'write_mod' generations\n"
; std::cout.flush();
}
else if (strcmp(argv[i],"-seed")==0) { if (++i==argc) break; else seed=(unsigned)strtodouble(argv[i]); }
+ else if (strcmp(argv[i],"-write_mod")==0) { if (++i==argc) break; else r.write_mod=(unsigned int)strtodouble(argv[i]); }
+
else if (strcmp(argv[i],"-h")==0) { usage(); return 0; }
else printf("Unrecognized command! '%s'\n",argv[i]);
double h1;
double h2;
double J12;
+
+ unsigned int write_mod; // Write state of the population every __ generations
std::vector<std::set<unsigned int> > initPop; // Initial population sequences
std::vector<double> initFrac; // Initial population fraction
h1 = 0.0;
h2 = 0.0;
J12 = 0.0;
+
+ write_mod = 1;
}
void setFiles() {