#ifndef GENETIC_PHENOTYPE_H #define GENETIC_PHENOTYPE_H #include namespace Genetic { class Phenotype { public: Phenotype(); virtual ~Phenotype(); virtual int getSize()=0; virtual Phenotype &randomize()=0; /** * Modify the given location by the given magnitude. The magnitude * should be between -1.0 and 1.0 inclusive. A 0.0 indicates no * change. */ virtual void mutate( int iLocation, float fMagnitude )=0; virtual Phenotype ©From( const Phenotype &rSrc, int iStart, int iSize, int iDest=-1 )=0; /** * Produces a Phenotype class that can be used to contain the data for * an offspring. The produced phenotype will be compatible, but empty. */ virtual Phenotype *makeEmptyOffspring( int iNewSize=-1 )=0; virtual Bu::String toString()=0; private: }; }; #endif