#define NUMBER_ORGANISMS 100 #define NUMBER_GENES 20 #define FALSE 0 #define TRUE 1 #define ALLELES 4 #define MAXIMUM_FITNESS NUMBER_GENES #define MUTATION_RATE 0.001 char **currentGeneration; char **nextGeneration; char *modelOrganism; int *organismsFitnesses; int totalOfFitnesses; int finalGeneration; int SelectOneOrganism(void) { int organism; int runningTotal; int randomSelectPoint; runningTotal = 0; randomSelectPoint = random(totalOfFitnesses+1); for(organism=0; organism= randomSelectPoint) return organism; } } void ProduceNextGeneration(void) { int organism; int gene; int parentOne; int parentTwo; int crossoverPoint; int mutateThisGene; //fill the nextGeneration data structur with the //children for(organism=0; organism