static void setpop(struct afrhex *map, int hexid, int *pop) {
struct afrhex *hex;
int i;
+ int sum = 0;
hex = find_hex(map, hexid);
for (i=0; i < 2; i++) {
hex->freq[i] = pop[i];
+ sum += pop[i];
}
+ if (sum % 2) {
+ fprintf(stderr, "allele frequency for hex %d not even\n", hexid);
+ }
+ hex->pop = sum/2;
}
static void setpopstr(struct afrhex *map, char *spec) {
printf("{");
printf(" \"run\": %d, \"seed\": %d, \"gens\": %d", run, seed, gens);
+ printf(",\n\"options\": { \"capfactor\": %f }", capfactor);
printf(",\n\"gendata\": [\n");
dumpgenjson(map, 0, year);