00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <eoBreed.h>
00022 #include <eoGeneralBreeder.h>
00023 #include <eoOneToOneBreeder.h>
00024
00025 #include "PyEO.h"
00026 #include "def_abstract_functor.h"
00027
00028 using namespace boost::python;
00029
00030 #define DEF3(x, i1, i2) class_<x<PyEO>, bases<eoBreed<PyEO > > >(#x, \
00031 init<i1, i2 >()[with_custodian_and_ward<1,2,with_custodian_and_ward<1,3> >()])\
00032 .def("__call__", &eoBreed<PyEO>::operator())
00033
00034 void breeders()
00035 {
00036 def_abstract_functor<eoBreed<PyEO> >("eoBreed");
00037
00038 DEF3(eoSelectTransform, eoSelect<PyEO>&, eoTransform<PyEO>&);
00039
00040 DEF3(eoGeneralBreeder, eoSelectOne<PyEO>&, eoGenOp<PyEO>&)
00041 .def( init<eoSelectOne<PyEO>&, eoGenOp<PyEO>&, double>()[WC2])
00042 .def( init<eoSelectOne<PyEO>&, eoGenOp<PyEO>&, double, bool>()[WC2] )
00043 .def( init<eoSelectOne<PyEO>&, eoGenOp<PyEO>&, eoHowMany>() );
00044
00045
00046 DEF3(eoOneToOneBreeder, eoGenOp<PyEO>&, eoEvalFunc<PyEO>&)
00047 .def( init<eoGenOp<PyEO>&, eoEvalFunc<PyEO>&, double>()[WC2] )
00048 .def( init<eoGenOp<PyEO>&, eoEvalFunc<PyEO>&, double, eoHowMany>()[WC2] );
00049
00050 }
00051