#include "genetic/phenotypebinary.h" #include "genetic/operatorbasic.h" #include #include #include #include #include using namespace Bu; int main( int argc, char *argv[] ) { Bu::Random::setGenerator(); Bu::Random::seed( time( NULL ) ); Genetic::OperatorBasic op( new Genetic::PhenotypeBinary( 3453120 ), 0.000125 ); Genetic::Phenotype *pPb1 = op.random(); Genetic::Phenotype *pPb2 = op.random(); Genetic::Phenotype *pPb3; // sio << pPb1->toString() << sio.nl; // sio << pPb2->toString() << sio.nl; Genetic::PhenotypeList lParents; lParents.append( pPb1 ); lParents.append( pPb2 ); for( int j = 0; j < 1000; j++ ) { delete op.mate( lParents ); } // pPb3 = pPb1->makeEmptyOffspring(); // pPb3->copyFrom( *pPb1, 4, 88 ); // sio << pPb3->toString() << sio.nl; delete pPb1; delete pPb2; // delete pPb3; return 0; }