summaryrefslogtreecommitdiff
path: root/src/tests/binary.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/binary.cpp')
-rw-r--r--src/tests/binary.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/tests/binary.cpp b/src/tests/binary.cpp
index 717c171..727feec 100644
--- a/src/tests/binary.cpp
+++ b/src/tests/binary.cpp
@@ -13,24 +13,30 @@ int main( int argc, char *argv[] )
13 Bu::Random::setGenerator<Bu::RandomCmwc>(); 13 Bu::Random::setGenerator<Bu::RandomCmwc>();
14 Bu::Random::seed( time( NULL ) ); 14 Bu::Random::seed( time( NULL ) );
15 15
16 Genetic::OperatorBasic op( new Genetic::PhenotypeBinary( 45 ), 0.1 ); 16 Genetic::OperatorBasic op( new Genetic::PhenotypeBinary( 422*1024 ), 0.0 );
17 Genetic::Phenotype *pPb1 = op.random(); 17 Genetic::Phenotype *pPb1 = op.random();
18 Genetic::Phenotype *pPb2 = op.random(); 18 Genetic::Phenotype *pPb2 = op.random();
19 Genetic::Phenotype *pPb3; 19 Genetic::Phenotype *pPb3;
20 20
21 sio << pPb1->toString() << sio.nl; 21// sio << pPb1->toString() << sio.nl;
22 sio << pPb2->toString() << sio.nl; 22// sio << pPb2->toString() << sio.nl;
23 23
24 Genetic::PhenotypeList lParents; 24 Genetic::PhenotypeList lParents;
25 lParents.append( pPb1 ); 25 lParents.append( pPb1 );
26 lParents.append( pPb2 ); 26 lParents.append( pPb2 );
27 pPb3 = op.mate( lParents );
28 27
29 sio << pPb3->toString() << sio.nl; 28 for( int j = 0; j < 1000; j++ )
29 {
30 delete op.mate( lParents );
31 }
32
33// pPb3 = pPb1->makeEmptyOffspring();
34// pPb3->copyFrom( *pPb1, 4, 88 );
35// sio << pPb3->toString() << sio.nl;
30 36
31 delete pPb1; 37 delete pPb1;
32 delete pPb2; 38 delete pPb2;
33 delete pPb3; 39// delete pPb3;
34 40
35 return 0; 41 return 0;
36} 42}