#if 0
printf("hex %lld (%s) pop = [%u, %u] (%d/%d ind)\n", hex->hex, hex->climate->code, hex->freq[0], hex->freq[1], hex->pop, hex->climate->cap);
#endif
- /* TODO if too small, say under 25, either move everyone or die */
+ /* poisson distribution on births ? */
if (pop > hex->climate->cap) {
pop *= 0.6; /* should probably round down */
} else {
hex->freq[0] = new[0] ; hex->freq[1] = new[1];
hex->pop = POP(new);
+ /* TODO if too small, say under 25, either move everyone or die */
hex->migrants = hex->pop - hex->climate->cap;
+ if (hex->pop < 25) {
+ hex->migrants = hex->pop;
+ }
if (hex->migrants > 0) {
- var_rhyperv(hex->migrants * 2, new, hex->outmigrate);
+ var_rhyperv(hex->migrants * 2, hex->freq, hex->outmigrate);
/* TODO could just set it to a quarter of the cap or something */
}
#if 0
}
#endif
}
-
}