#ifndef GENETIC_OPERATOR_BASIC_H #define GENETIC_OPERATOR_BASIC_H #include "genetic/operator.h" namespace Genetic { /** * Very simple genetic operator that covers all the basics. It will do * single cut Phenotype splicing between two parents, and random mutation * on the child. All work is based on a progenitor Phenotype, which is the * template for creating new, random Phenotypes. OperatorBasic takes * ownership of the progenitor and will delete it when OperatorBasic is * destroyed. */ class OperatorBasic : public Operator { public: OperatorBasic( Phenotype *pProgenitor, float fMutationRate ); virtual ~OperatorBasic(); virtual Phenotype *random(); virtual int parentCount() { return 2; } virtual Phenotype *mate( const PhenotypeList &lParents ); private: Phenotype *pProgenitor; float fMutationRate; }; }; #endif