# algos.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 <eoSGA.h>
    00022 #include <eoEasyEA.h>
    00023 #include <eoDetSelect.h>
    00024 #include <eoCellularEasyEA.h>
    00025
    00026 #include "PyEO.h"
    00027 #include "def_abstract_functor.h"
    00028
    00029 using namespace boost::python;
    00030
    00031 void algos()
    00032 {
    00033     def_abstract_functor<eoAlgo<PyEO> >("eoAlgo");
    00034
    00035     /* Algorithms */
    00036     class_<eoSGA<PyEO>, bases<eoAlgo<PyEO> >, boost::noncopyable>("eoSGA",
    00037             init<eoSelectOne<PyEO>&,
    00038             eoQuadOp<PyEO>&, float,
    00039             eoMonOp<PyEO>&, float,
    00040             eoEvalFunc<PyEO>&,
    00041             eoContinue<PyEO>&>()
    00042             [
    00043             with_custodian_and_ward<1,2,
    00044                 with_custodian_and_ward<1,3,
    00045                     with_custodian_and_ward<1,5,
    00046                         with_custodian_and_ward<1,7,
    00047                             with_custodian_and_ward<1,8>
    00048                         >
    00049                     >
    00050                 >
    00051             >()
    00052             ])
    00053         .def("__call__", &eoSGA<PyEO>::operator())
    00054         ;
    00055
    00056     class_<eoEasyEA<PyEO>, bases<eoAlgo<PyEO> > >("eoEasyEA",
    00057               init<
    00058                 eoContinue<PyEO>&,
    00059                 eoEvalFunc<PyEO>&,
    00060                 eoBreed<PyEO>&,
    00061                 eoReplacement<PyEO>& >() )
    00062         .def( init<
    00063                 eoContinue<PyEO>&,
    00064                 eoPopEvalFunc<PyEO>&,
    00065                 eoBreed<PyEO>&,
    00066                 eoReplacement<PyEO>&>() )
    00067         .def( init<
    00068                 eoContinue<PyEO>&,
    00069                 eoEvalFunc<PyEO>&,
    00070                 eoBreed<PyEO>&,
    00071                 eoMerge<PyEO>&,
    00072                 eoReduce<PyEO>& >() )
    00073         .def( init<
    00074                 eoContinue<PyEO>&,
    00075                 eoEvalFunc<PyEO>&,
    00076                 eoSelect<PyEO>&,
    00077                 eoTransform<PyEO>&,
    00078                 eoReplacement<PyEO>&>())
    00079         .def( init<
    00080                 eoContinue<PyEO>&,
    00081                 eoEvalFunc<PyEO>&,
    00082                 eoSelect<PyEO>&,
    00083                 eoTransform<PyEO>&,
    00084                 eoMerge<PyEO>&,
    00085                 eoReduce<PyEO>&>())
    00086         .def("__call__", &eoEasyEA<PyEO>::operator())
    00087         ;
    00088
    00089     /*
    00090     class_<eoCellularEasyEA<PyEO>, bases< eoAlgo<PyEO> > >("eoCellularEasyEA",
    00091             init<   eoContinue<PyEO>&,
    00092                     eoEvalFunc<PyEO>&,
    00093                     eoSelectOne<PyEO>&,
    00094                     eoBinOp<PyEO>&,
    00095                     eoMonOp<PyEO>&,
    00096                     eoSelectOne<PyEO>&>())
    00097         .def(
    00098             init<   eoContinue<PyEO>&,
    00099                     eoEvalFunc<PyEO>&,
    00100                     eoSelectOne<PyEO>&,
    00101                     eoQuadOp<PyEO>&,
    00102                     eoMonOp<PyEO>&,
    00103                     eoSelectOne<PyEO>&>())
    00104         ;
    00105     */
    00106 }