# breeders.cpp

    00001 /*
    00002     PyEO
    00003
    00004     Copyright (C) 2003 Maarten Keijzer
    00005
    00006     This program is free software; you can redistribute it and/or modify
    00007     it under the terms of the GNU General Public License as published by
    00008     the Free Software Foundation; either version 2 of the License, or
    00009     (at your option) any later version.
    00010
    00011     This program is distributed in the hope that it will be useful,
    00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00014     GNU General Public License for more details.
    00015
    00016     You should have received a copy of the GNU General Public License
    00017     along with this program; if not, write to the Free Software
    00018     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    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