From 83671d794e5340bed1989d631a6cf0961deb1fb1 Mon Sep 17 00:00:00 2001 From: Dariusz Murakowski Date: Thu, 26 Sep 2013 18:38:00 -0400 Subject: [PATCH] Add write_mod option to write population at regular time intervals (two-site/two-allele only). --- wf.cpp | 8 +++++++- wf.h | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/wf.cpp b/wf.cpp index 6294977..fa6e343 100644 --- a/wf.cpp +++ b/wf.cpp @@ -72,7 +72,10 @@ void run(RunParameters &r, unsigned seed) { //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; @@ -255,6 +258,7 @@ void usage() " (note the sign convention on these is P ~ exp(-H),\n" " H = sum_i h_i s_i + sum_{i > initPop; // Initial population sequences std::vector initFrac; // Initial population fraction @@ -137,6 +139,8 @@ public: h1 = 0.0; h2 = 0.0; J12 = 0.0; + + write_mod = 1; } void setFiles() { -- 2.7.4