/*
 *  natselsqrt-private.hpp
 *
 * Predeclarations for local class and functions used in natselsqrt.cpp.
 * See natselsqrt.cpp for details.  (This file only exists because C++
 * compilers require functions to be declared before they are used,
 * human beings don't have this requirement and can scroll backwards and
 * forwards in the source as necessary.)
 *
 * This original contents of this file were generated automatically using
 * a short Perl script [laziness demands that I not duplicate work, and
 * writing the same information twice is work duplication]).  To avoid making
 * the build process too complicated, the Perl script that created this file
 * has not been supplied with this assignment, so changes must be made by
 * hand.  You might want to think about how you'd go about writing and using 
 * your own script.
 */

class NatSelEnv;

int main(
    int argc,
    char* argv[]);

int processOptions(
    int argc,
    char* argv[],
    bool& debug,
    int& colonySize,
    int& numSurvivors,
    double& mutationProbability,
    int& maxRandomSurvivors,
    int& maxGenerations);

void usage(
    char* programName);

void runEvolution(
    NatSelEnv& environment,
    bool debug,
    int colonySize,
    int numSurvivors,
    double mutationProbability,
    int maxRandomSurvivors,
    int maxGenerations);

void naturalSelection(
    NatSelEnv& environment,
    Colony& colony,
    int numSurvivors,
    int maxRandomSurvivors);

Organism& findBest(
    NatSelEnv& environment,
    Colony& colony);

void mutate(
    Organism& target,
    int position,
    int newGene);

Organism newOrganism();

Organism crossover(
    const Organism& parent1,
    const Organism& parent2,
    int position);

double organismValue(
    const Organism& org);

ostream& operator<<(
    ostream& out,
    const Organism& org);

void setRandomSeed();

int randomInt(
    int maximum);

