#include "util.h"
#include "param.h"

typedef struct {
  BITS str;		//string value
  double fitness;	//fitness of that string
} Element;

typedef struct {
  Element* strings;	//this is the array of strings
  BITS numStr;		//number of strings
} Population;

double avgFitness(Population* pop);
void printPop(Population* pop, BITS flag, FILE* output);
void reproduction(Population* population);
void crossover(Population* population, double rate, Population* prior);
void mutate(Population* population, double rate, BITS flag);
void election(Population* old, Population* next);
BITS isConverged(Population* pop, double percent);
BITS gaRound(BITS mutRates, BITS num);
double fitness(BITS str);
void applyFitness(Population* pop, BITS flag);
void initFitArray(int seed);

