#include "genetic/phenotypebinary.h" #include "genetic/operatorbasic.h" #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( 45 ), 0.1 ); 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 ); pPb3 = op.mate( lParents ); sio << pPb3->toString() << sio.nl; delete pPb1; delete pPb2; delete pPb3; return 0; }