The Study of Microevolution Using Agent-Based Modeling Abstract The Matrix of Oganisms Meiosis Code void Organism::meiosis(Nucleotide *gamete) { int x, genect, chromct, crossover; Nucleotide * chromo = new Nucleotide[GENES * GENE_LENGTH], *chromo2 = new Nucleotide[GENES * GENE_LENGTH]; Nucleotide * gene = new Nucleotide[GENE_LENGTH], *gene2 = new Nucleotide[GENE_LENGTH]; for(chromct = 0; chromct < CHROMOSOMES; chromct++) { for(genect = 0; genect < GENES; genect++) { crossover = rand() % RATE_MAX; (crossover < CROSSOVER_RATE) ? crossover = 1 : crossover = 0; for(x = 0; x < GENE_LENGTH; x++) { if(crossover) { gene[x] = dad[chromct*GENES*GENE_LENGTH + genect*GENE_LENGTH + x]; gene2[x] = mom[chromct*GENES*GENE_LENGTH + genect*GENE_LENGTH + x]; } else { gene[x] = mom[chromct*GENES*GENE_LENGTH + genect * GENE_LENGTH + x]; gene2[x] = dad[chromct*GENES*GENE_LENGTH + genect*GENE_LENGTH + x]; } chromo[genect * GENE_LENGTH + x] = gene[x]; chromo2[genect * GENE_LENGTH + x] = gene2[x]; } } crossover = rand() % 2; for(x = 0; x < GENES * GENE_LENGTH; x++) { if(crossover) gamete[(chromct-1)*GENES*GENE_LENGTH+genect*GENE_LENGTH+x]=chromo[x]; else gamete[(chromct - 1)*GENES*GENE_LENGTH+genect*GENE_LENGTH+x]=chromo2[x]; } } delete chromo; delete chromo2; delete gene; delete gene2; } Agent Class class Organism { public: Organism(); O rganism(int ident, int row2, int col2); Organism(Nucleotide* mDNA,Nucleotide* dDNA, int ident, bool malefemale, int row2, int col2); ~Organism(); void printGenome(); void meiosis(Nucleotide* gamete); Organism* reproduce(Organism* mate, int ident, int r, int c); int Interact(Organism* neighbors, int nlen); void ChangePos(int row2, int col2); int GeneValue(bool parent, int chromnum, int gennum); int Row(); int Col(); int PIN(); bool Gender(); private: void randSpawn(Nucleotide* DNA, int size); Nucleotide *mom, *dad; int ID, row, col; bool male; }; Graphs of Attributes Over Time, Yet to Be Collected