#include "genetic/phenotypebinary.h" #include "genetic/operatorbasic.h" #include #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( 45 ), 0.000125 ); Genetic::Phenotype *pPb1 = op.random(); Bu::MemBuf mb; pPb1->write( mb ); sio << "Size: " << mb.getSize() << sio.nl; mb.setPos( 0 ); Genetic::PhenotypeBinary b( 1 ); b.read( mb ); sio << pPb1->toString() << sio.nl; sio << b.toString() << sio.nl; delete pPb1; return 0; }