EvolvingObjects
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>
00037         ("eoSGA",
00038          init<
00039          eoSelectOne<PyEO>&,
00040          eoQuadOp<PyEO>&,
00041          float,
00042          eoMonOp<PyEO>&,
00043          float,
00044          eoEvalFunc<PyEO>&,
00045          eoContinue<PyEO>&
00046          >()
00047          [
00048           with_custodian_and_ward<1,2,
00049           with_custodian_and_ward<1,3,
00050           with_custodian_and_ward<1,5,
00051           with_custodian_and_ward<1,7,
00052           with_custodian_and_ward<1,8>
00053           >
00054          >
00055           >
00056          >()
00057           ]
00058          )
00059         .def("__call__", &eoSGA<PyEO>::operator())
00060         ;
00061 
00062     class_<eoEasyEA<PyEO>, bases<eoAlgo<PyEO> > >
00063         ("eoEasyEA",
00064          init<
00065          eoContinue<PyEO>&,
00066          eoEvalFunc<PyEO>&,
00067          eoBreed<PyEO>&,
00068          eoReplacement<PyEO>&
00069          >()
00070          )
00071         .def( init<
00072               eoContinue<PyEO>&,
00073               eoEvalFunc<PyEO>&,
00074               eoBreed<PyEO>&,
00075               eoReplacement<PyEO>&,
00076               unsigned
00077               >() )
00078         .def( init<
00079               eoContinue<PyEO>&,
00080               eoPopEvalFunc<PyEO>&,
00081               eoBreed<PyEO>&,
00082               eoReplacement<PyEO>&
00083               >() )
00084         .def( init<
00085               eoContinue<PyEO>&,
00086               eoEvalFunc<PyEO>&,
00087               eoBreed<PyEO>&,
00088               eoMerge<PyEO>&,
00089               eoReduce<PyEO>&
00090               >() )
00091         .def( init<
00092               eoContinue<PyEO>&,
00093               eoEvalFunc<PyEO>&,
00094               eoSelect<PyEO>&,
00095               eoTransform<PyEO>&,
00096               eoReplacement<PyEO>&
00097               >() )
00098         .def( init<
00099               eoContinue<PyEO>&,
00100               eoEvalFunc<PyEO>&,
00101               eoSelect<PyEO>&,
00102               eoTransform<PyEO>&,
00103               eoMerge<PyEO>&,
00104               eoReduce<PyEO>&
00105               >() )
00106         .def("__call__", &eoEasyEA<PyEO>::operator())
00107         ;
00108 
00109     /*
00110       class_<eoCellularEasyEA<PyEO>, bases< eoAlgo<PyEO> > >("eoCellularEasyEA",
00111       init<   eoContinue<PyEO>&,
00112       eoEvalFunc<PyEO>&,
00113       eoSelectOne<PyEO>&,
00114       eoBinOp<PyEO>&,
00115       eoMonOp<PyEO>&,
00116       eoSelectOne<PyEO>&>())
00117       .def(
00118       init<   eoContinue<PyEO>&,
00119       eoEvalFunc<PyEO>&,
00120       eoSelectOne<PyEO>&,
00121       eoQuadOp<PyEO>&,
00122       eoMonOp<PyEO>&,
00123       eoSelectOne<PyEO>&>())
00124       ;
00125     */
00126 }
 All Classes Namespaces Files Functions Variables Typedefs Friends