#include #ifndef LOCI #define LOCI 1 #endif struct climate { char code[8]; char name[32]; int basecap; int cap; /* for this model */ unsigned char rgb[3]; }; struct climaterange { int hex; char code[8]; char era[16]; int variance; int start; int end; }; extern struct climaterange altclimates[]; struct afrhex; struct climate *climateyear(struct afrhex *hex, int year); struct maphex { int64_t hex; char climate[8]; int nadj; int64_t adjacent[18]; /* though we can calculate adjacents */ struct afrhex *adjhex[18]; /* direct pointers */ struct maphex *next; }; extern struct maphex maphexes[]; struct afrhex { int64_t hex; unsigned int freq[2]; /* allele frequency count */ struct climate *climate; /* migrants allele */ unsigned int outmigrate[2]; unsigned int inmigrate[2]; /* migration topology */ struct maphex *map; /* some computed data */ int pop, migrants; /* total pop, number of emmigrants, dest attr */ int attract; /* how attractive is this as a destination */ struct afrhex *next; }; struct climate *find_climate(char *code); struct climate *climateyear(struct afrhex *hex, int year); void nextgen(struct afrhex *hexlist, int year, unsigned int climate); void climate_init(double width, double capfactor); struct afrhex *map_init(struct maphex *maphexes, double width, double divisor); uint64_t total_pop(struct afrhex *map); struct afrhex *find_hex(struct afrhex *map, int64_t hex); struct afrhex *search_hex(struct afrhex *map, int64_t hex);