* indentations + whitespace cleanup
This commit is contained in:
parent
8457e39efe
commit
56c6edab04
285 changed files with 6068 additions and 6223 deletions
|
|
@ -11,13 +11,14 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
|||
SET(EO_LIB_OUTPUT_PATH ${EO_BINARY_DIR}/lib)
|
||||
SET(LIBRARY_OUTPUT_PATH ${EO_LIB_OUTPUT_PATH})
|
||||
|
||||
SET (EO_SOURCES eoFunctorStore.cpp
|
||||
SET(EO_SOURCES
|
||||
eoFunctorStore.cpp
|
||||
eoPersistent.cpp
|
||||
eoPrintable.cpp
|
||||
eoCtrlCContinue.cpp
|
||||
eoScalarFitnessAssembled.cpp
|
||||
eoSIGContinue.cpp)
|
||||
|
||||
eoSIGContinue.cpp
|
||||
)
|
||||
|
||||
ADD_LIBRARY(eo STATIC ${EO_SOURCES})
|
||||
INSTALL(TARGETS eo ARCHIVE DESTINATION lib COMPONENT libraries)
|
||||
|
|
@ -42,6 +43,6 @@ ADD_SUBDIRECTORY(ga)
|
|||
ADD_SUBDIRECTORY(gp)
|
||||
ADD_SUBDIRECTORY(other)
|
||||
ADD_SUBDIRECTORY(utils)
|
||||
ADD_SUBDIRECTORY(pyeo)
|
||||
|
||||
######################################################################################
|
||||
|
||||
|
|
|
|||
|
|
@ -171,4 +171,3 @@ private:
|
|||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
|
|
|
|||
|
|
@ -570,4 +570,3 @@ eoCheckPoint<EOT>& do_make_checkpoint(eoParser& _parser, eoState& _state, eoValu
|
|||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -80,4 +80,3 @@ virtual bool operator()(EOT& , EOT& ) {return false;}
|
|||
|
||||
#endif
|
||||
/** @} */
|
||||
|
||||
|
|
|
|||
|
|
@ -90,4 +90,3 @@ private:
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -90,4 +90,3 @@ std::vector<double> rates;
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -207,4 +207,3 @@ protected:
|
|||
};
|
||||
|
||||
#endif /*EOCONSTRICTEDVARIABLEWEIGHTVELOCITY_H*/
|
||||
|
||||
|
|
|
|||
|
|
@ -197,4 +197,3 @@ protected:
|
|||
|
||||
|
||||
#endif /*EOCONSTRICTEDVELOCITY_H */
|
||||
|
||||
|
|
|
|||
|
|
@ -68,4 +68,3 @@ public:
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -84,4 +84,3 @@ public:
|
|||
|
||||
#endif
|
||||
/** @} */
|
||||
|
||||
|
|
|
|||
|
|
@ -71,4 +71,3 @@ template <class EOT> class eoDetTournamentSelect: public eoSelectOne<EOT>
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -314,4 +314,3 @@ protected:
|
|||
|
||||
/** @} */
|
||||
#endif // _eoDualFitness_h_
|
||||
|
||||
|
|
|
|||
|
|
@ -44,4 +44,3 @@ template<class EOT> class eoEDA: public eoUF<eoDistribution<EOT>&, void>
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -303,4 +303,3 @@ Example of a test program building an EA algorithm.
|
|||
*/
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -84,4 +84,3 @@ private :
|
|||
};
|
||||
|
||||
#endif // __eoEvalCounterThrowException_h__
|
||||
|
||||
|
|
|
|||
|
|
@ -65,4 +65,3 @@ struct eoEvalFuncPtr: public eoEvalFunc<EOT> {
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -211,4 +211,3 @@ protected:
|
|||
* Example of a test program using this class:
|
||||
*/
|
||||
#endif /*eoExtendedVelocity_H */
|
||||
|
||||
|
|
|
|||
|
|
@ -53,4 +53,3 @@ private :
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -189,4 +189,3 @@ protected:
|
|||
|
||||
|
||||
#endif /*EOFIXEDINERTIAWEIGHTEDVELOCITY_H */
|
||||
|
||||
|
|
|
|||
|
|
@ -112,4 +112,3 @@ private:
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -105,4 +105,3 @@ class eoGeneralBreeder: public eoBreed<EOT>
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -145,4 +145,3 @@ class eoDummy : public eoUF<POT&, void>
|
|||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
|
|
|
|||
|
|
@ -193,4 +193,3 @@ protected:
|
|||
|
||||
|
||||
#endif /*EOINTEGERVELOCITY_H */
|
||||
|
||||
|
|
|
|||
|
|
@ -215,11 +215,3 @@ protected:
|
|||
};
|
||||
|
||||
#endif /*EOLINEARTOPOLOGY_H_ */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -55,14 +55,3 @@ public:
|
|||
|
||||
|
||||
#endif /* EONEIGHBORHOOD_H_ */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -73,4 +73,3 @@ class eoObject
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -119,4 +119,3 @@ class eoOneToOneBreeder: public eoBreed<EOT>
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -166,4 +166,3 @@ public:
|
|||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -80,4 +80,3 @@ public:
|
|||
#endif /*_EOPARTICLEBESTINIT_H */
|
||||
|
||||
/** @} */
|
||||
|
||||
|
|
|
|||
|
|
@ -153,4 +153,3 @@ template <class POT> class eoParticleInitializer : public eoInitializerBase <POT
|
|||
#endif /*_eoParticleFullInitializer_H*/
|
||||
|
||||
/** @} */
|
||||
|
||||
|
|
|
|||
|
|
@ -53,4 +53,3 @@ private:
|
|||
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -337,4 +337,3 @@ public:
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -105,4 +105,3 @@ private:
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -209,4 +209,3 @@ private:
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -19,4 +19,3 @@ std::ostream & operator << ( std::ostream& _os, const eoPrintable& _o ) {
|
|||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -60,4 +60,3 @@ class eoPrintable
|
|||
std::ostream & operator << ( std::ostream& _os, const eoPrintable& _o );
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -91,4 +91,3 @@ private:
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -121,4 +121,3 @@ class eoSTLBF : public std::binary_function<A1, A2, R>
|
|||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,3 @@
|
|||
|
||||
// need to allocate the static variables of class eoScalarFitnessAssembledTraits
|
||||
std::vector<std::string> eoScalarFitnessAssembledTraits::TermDescriptions;
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -282,4 +282,3 @@ std::istream& operator>>(std::istream& is, eoScalarFitnessAssembled<F, Cmp, Fitn
|
|||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -74,4 +74,3 @@ public:
|
|||
*/
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -229,4 +229,3 @@ private:
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -89,4 +89,3 @@ template<class EOT> class eoShiftMutation: public eoMonOp<EOT>
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -104,4 +104,3 @@ template<class EOT> class eoSimpleEDA: public eoEDA<EOT>
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -123,4 +123,3 @@ protected:
|
|||
|
||||
|
||||
#endif /* EOSOCIALNEIGHBORHOOD_H_ */
|
||||
|
||||
|
|
|
|||
|
|
@ -193,4 +193,3 @@ protected:
|
|||
|
||||
|
||||
#endif /*EOSTANDARDVELOCITY_H */
|
||||
|
||||
|
|
|
|||
|
|
@ -139,11 +139,3 @@ protected:
|
|||
};
|
||||
|
||||
#endif /*EOSTARTOPOLOGY_H_ */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -117,4 +117,3 @@ private:
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -65,4 +65,3 @@ private:
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -195,4 +195,3 @@ private :
|
|||
/** @} */
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -80,4 +80,3 @@ template<class Chrom> class eoSwapMutation: public eoMonOp<Chrom>
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -84,11 +84,3 @@ public:
|
|||
|
||||
|
||||
#endif /*EOTOPOLOGY_H_ */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -196,4 +196,3 @@ protected:
|
|||
};
|
||||
|
||||
#endif /*EOVARIABLEINERTIAWEIGHTEDVELOCITY_H*/
|
||||
|
||||
|
|
|
|||
|
|
@ -350,4 +350,3 @@ private:
|
|||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -158,4 +158,3 @@ private:
|
|||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -78,4 +78,3 @@ public:
|
|||
};
|
||||
|
||||
#endif /*EOVELOCITY_H_H */
|
||||
|
||||
|
|
|
|||
|
|
@ -144,4 +144,3 @@ private:
|
|||
#endif /*EOVELOCITYINIT_H */
|
||||
|
||||
/** @} */
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
/*
|
||||
* C++ification of Nikolaus Hansen's original C-source code for the
|
||||
* CMA-ES
|
||||
|
|
|
|||
|
|
@ -49,4 +49,3 @@ class CMAParams {
|
|||
} // namespace eo
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -362,4 +362,3 @@ bool CMAState::updateEigenSystem(unsigned max_tries, unsigned max_iters) { retur
|
|||
|
||||
|
||||
} // namespace eo
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
/*
|
||||
* C++ification of Nikolaus Hansen's original C-source code for the
|
||||
* CMA-ES.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
/*
|
||||
* C++ification of Nikolaus Hansen's original C-source code for the
|
||||
* CMA-ES. These are the eigenvector calculations
|
||||
|
|
|
|||
|
|
@ -279,4 +279,3 @@ private:
|
|||
//-----------------------------------------------------------------------------
|
||||
//@}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -68,4 +68,3 @@ class eoRealInitBounded : public eoInit<EOT>
|
|||
//-----------------------------------------------------------------------------
|
||||
//@}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -133,5 +133,3 @@ protected:
|
|||
double eta;
|
||||
double range; // == 1
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -82,4 +82,3 @@ eoAlgo<eoEsFull<eoMinimizingFitness> >& make_algo_scalar(eoParser& _parser, eoS
|
|||
{
|
||||
return do_make_algo_scalar(_parser, _state, _eval, _continue, _op);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,4 +58,3 @@ eoAlgo<eoReal<eoMinimizingFitness> >& make_algo_scalar(eoParser& _parser, eoSta
|
|||
{
|
||||
return do_make_algo_scalar(_parser, _state, _eval, _continue, _op, _dist);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -79,5 +79,3 @@ eoCheckPoint<eoEsFull<eoMinimizingFitness> >& make_checkpoint(eoParser& _parser,
|
|||
{
|
||||
return do_make_checkpoint(_parser, _state, _eval, _continue);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -57,5 +57,3 @@ eoCheckPoint<eoReal<eoMinimizingFitness> >& make_checkpoint(eoParser& _parser, e
|
|||
{
|
||||
return do_make_checkpoint(_parser, _state, _eval, _continue);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -79,5 +79,3 @@ eoContinue<eoEsFull<eoMinimizingFitness> >& make_continue(eoParser& _parser, eoS
|
|||
{
|
||||
return do_make_continue(_parser, _state, _eval);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -57,5 +57,3 @@ eoContinue<eoReal<eoMinimizingFitness> >& make_continue(eoParser& _parser, eoSta
|
|||
{
|
||||
return do_make_continue(_parser, _state, _eval);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -77,4 +77,3 @@ eoGenOp<eoEsFull<eoMinimizingFitness> >& make_op(eoParser& _parser, eoState& _s
|
|||
{
|
||||
return do_make_op(_parser, _state, _init);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,5 +82,3 @@ eoPop<eoEsFull<eoMinimizingFitness> >& make_pop(eoParser& _parser, eoState& _st
|
|||
{
|
||||
return do_make_pop(_parser, _state, _init);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -58,5 +58,3 @@ eoPop<eoReal<eoMinimizingFitness> >& make_pop(eoParser& _parser, eoState& _stat
|
|||
{
|
||||
return do_make_pop(_parser, _state, _init);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -84,4 +84,3 @@ void run_ea(eoAlgo<eoEsFull<eoMinimizingFitness> >& _ga, eoPop<eoEsFull<eoMinimi
|
|||
{
|
||||
do_run(_ga, _pop);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,4 +60,3 @@ void run_ea(eoAlgo<eoReal<eoMinimizingFitness> >& _ga, eoPop<eoReal<eoMinimizing
|
|||
{
|
||||
do_run(_ga, _pop);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,4 +43,3 @@ class square_matrix {
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -18,4 +18,3 @@ that constructs the EOType initializer (make_genotype.h) and the one
|
|||
that buils up the operators (make_op.h).
|
||||
|
||||
MS, April 23, 2001CVS
|
||||
|
||||
|
|
|
|||
|
|
@ -442,4 +442,3 @@ template<class Chrom> class eoBitGxOver: public eoQuadOp<Chrom>
|
|||
//-----------------------------------------------------------------------------
|
||||
//@}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -170,4 +170,3 @@ public:
|
|||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -61,4 +61,3 @@ eoAlgo<eoBit<eoMinimizingFitness> >& make_algo_scalar(eoParser& _parser, eoStat
|
|||
{
|
||||
return do_make_algo_scalar(_parser, _state, _eval, _continue, _op, _dist);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,5 +60,3 @@ eoCheckPoint<eoBit<eoMinimizingFitness> >& make_checkpoint(eoParser& _parser, eo
|
|||
{
|
||||
return do_make_checkpoint(_parser, _state, _eval, _continue);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -60,5 +60,3 @@ eoContinue<eoBit<eoMinimizingFitness> >& make_continue(eoParser& _parser, eoStat
|
|||
{
|
||||
return do_make_continue(_parser, _state, _eval);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -59,4 +59,3 @@ eoGenOp<eoBit<eoMinimizingFitness> >& make_op(eoParser& _parser, eoState& _stat
|
|||
{
|
||||
return do_make_op(_parser, _state, _init);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,5 +59,3 @@ eoPop<eoBit<eoMinimizingFitness> >& make_pop(eoParser& _parser, eoState& _state
|
|||
{
|
||||
return do_make_pop(_parser, _state, _init);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -63,4 +63,3 @@ void run_ea(eoAlgo<eoBit<eoMinimizingFitness> >& _ga, eoPop<eoBit<eoMinimizingFi
|
|||
{
|
||||
do_run(_ga, _pop);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,4 +82,3 @@ public:
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -33,5 +33,3 @@ eoFunctorStore.o: ../eoFunctorStore.h ../eoFunctorStore.cpp
|
|||
|
||||
%.o:%.cpp PyEO.h def_abstract_functor.h
|
||||
$(COMPILE) $< $(INC)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -27,5 +27,3 @@ eoFunctorStore.o: ../eoFunctorStore.h ../eoFunctorStore.cpp
|
|||
|
||||
%.o:%.cpp PyEO.h def_abstract_functor.h
|
||||
$(COMPILE) $< $(INC)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -21,14 +21,15 @@
|
|||
#ifndef PYEO_H
|
||||
#define PYEO_H
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <exception>
|
||||
#include <boost/python.hpp>
|
||||
|
||||
#include <EO.h>
|
||||
struct index_error : public std::exception {
|
||||
|
||||
struct index_error : public std::exception
|
||||
{
|
||||
index_error(std::string w) : what(w) {};
|
||||
virtual ~index_error() throw() {}
|
||||
std::string what;
|
||||
|
|
@ -140,13 +141,12 @@ struct PyEO_pickle_suite : boost::python::pickle_suite
|
|||
{
|
||||
typedef PyEO::Fitness Fitness;
|
||||
|
||||
static
|
||||
boost::python::tuple getstate(const PyEO& _eo)
|
||||
static boost::python::tuple getstate(const PyEO& _eo)
|
||||
{
|
||||
return boost::python::make_tuple(_eo.getFitness(), _eo.genome);
|
||||
}
|
||||
static
|
||||
void setstate(PyEO& _eo, boost::python::tuple pickled)
|
||||
|
||||
static void setstate(PyEO& _eo, boost::python::tuple pickled)
|
||||
{
|
||||
_eo.setFitness( Fitness(pickled[0]) );
|
||||
_eo.genome = pickled[1];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
from PyEO import *
|
||||
|
||||
try:
|
||||
|
|
@ -15,7 +14,6 @@ else:
|
|||
self.g = Gnuplot.Gnuplot()
|
||||
self.g.reset();
|
||||
|
||||
|
||||
def handleParam(self, i, param):
|
||||
param = float(param)
|
||||
|
||||
|
|
@ -25,7 +23,6 @@ else:
|
|||
self.values[i].append(param)
|
||||
|
||||
def __call__(self):
|
||||
|
||||
l = len(self)
|
||||
|
||||
if l > 3 or l == 0:
|
||||
|
|
@ -82,6 +79,5 @@ class eoAverageStat(eoStat):
|
|||
self.object = sum
|
||||
|
||||
class eoBestFitnessStat(eoSortedStat):
|
||||
|
||||
def __call__(self, pop):
|
||||
self.object = pop[0].fitness
|
||||
|
|
|
|||
|
|
@ -37,9 +37,15 @@ void abstract1()
|
|||
|
||||
def_abstract_functor<eoTransform<PyEO> >("eoTransform");
|
||||
|
||||
class_<eoSGATransform<PyEO>, bases<eoTransform<PyEO> > >("eoSGATransform",
|
||||
init< eoQuadOp<PyEO>&, double,
|
||||
eoMonOp<PyEO>&, double>())
|
||||
class_<eoSGATransform<PyEO>, bases<eoTransform<PyEO> > >
|
||||
("eoSGATransform",
|
||||
init<
|
||||
eoQuadOp<PyEO>&,
|
||||
double,
|
||||
eoMonOp<PyEO>&,
|
||||
double
|
||||
>()
|
||||
)
|
||||
.def("__call__", &eoSGATransform<PyEO>::operator());
|
||||
|
||||
def_abstract_functor<eoPopEvalFunc<PyEO> >("eoPopEvalFunc");
|
||||
|
|
|
|||
|
|
@ -33,12 +33,17 @@ void algos()
|
|||
def_abstract_functor<eoAlgo<PyEO> >("eoAlgo");
|
||||
|
||||
/* Algorithms */
|
||||
class_<eoSGA<PyEO>, bases<eoAlgo<PyEO> >, boost::noncopyable>("eoSGA",
|
||||
init<eoSelectOne<PyEO>&,
|
||||
eoQuadOp<PyEO>&, float,
|
||||
eoMonOp<PyEO>&, float,
|
||||
class_<eoSGA<PyEO>, bases<eoAlgo<PyEO> >, boost::noncopyable>
|
||||
("eoSGA",
|
||||
init<
|
||||
eoSelectOne<PyEO>&,
|
||||
eoQuadOp<PyEO>&,
|
||||
float,
|
||||
eoMonOp<PyEO>&,
|
||||
float,
|
||||
eoEvalFunc<PyEO>&,
|
||||
eoContinue<PyEO>&>()
|
||||
eoContinue<PyEO>&
|
||||
>()
|
||||
[
|
||||
with_custodian_and_ward<1,2,
|
||||
with_custodian_and_ward<1,3,
|
||||
|
|
@ -49,40 +54,55 @@ void algos()
|
|||
>
|
||||
>
|
||||
>()
|
||||
])
|
||||
]
|
||||
)
|
||||
.def("__call__", &eoSGA<PyEO>::operator())
|
||||
;
|
||||
|
||||
class_<eoEasyEA<PyEO>, bases<eoAlgo<PyEO> > >("eoEasyEA",
|
||||
class_<eoEasyEA<PyEO>, bases<eoAlgo<PyEO> > >
|
||||
("eoEasyEA",
|
||||
init<
|
||||
eoContinue<PyEO>&,
|
||||
eoEvalFunc<PyEO>&,
|
||||
eoBreed<PyEO>&,
|
||||
eoReplacement<PyEO>& >() )
|
||||
eoReplacement<PyEO>&
|
||||
>()
|
||||
)
|
||||
.def( init<
|
||||
eoContinue<PyEO>&,
|
||||
eoEvalFunc<PyEO>&,
|
||||
eoBreed<PyEO>&,
|
||||
eoReplacement<PyEO>&,
|
||||
unsigned
|
||||
>() )
|
||||
.def( init<
|
||||
eoContinue<PyEO>&,
|
||||
eoPopEvalFunc<PyEO>&,
|
||||
eoBreed<PyEO>&,
|
||||
eoReplacement<PyEO>&>() )
|
||||
eoReplacement<PyEO>&
|
||||
>() )
|
||||
.def( init<
|
||||
eoContinue<PyEO>&,
|
||||
eoEvalFunc<PyEO>&,
|
||||
eoBreed<PyEO>&,
|
||||
eoMerge<PyEO>&,
|
||||
eoReduce<PyEO>& >() )
|
||||
eoReduce<PyEO>&
|
||||
>() )
|
||||
.def( init<
|
||||
eoContinue<PyEO>&,
|
||||
eoEvalFunc<PyEO>&,
|
||||
eoSelect<PyEO>&,
|
||||
eoTransform<PyEO>&,
|
||||
eoReplacement<PyEO>&>())
|
||||
eoReplacement<PyEO>&
|
||||
>() )
|
||||
.def( init<
|
||||
eoContinue<PyEO>&,
|
||||
eoEvalFunc<PyEO>&,
|
||||
eoSelect<PyEO>&,
|
||||
eoTransform<PyEO>&,
|
||||
eoMerge<PyEO>&,
|
||||
eoReduce<PyEO>&>())
|
||||
eoReduce<PyEO>&
|
||||
>() )
|
||||
.def("__call__", &eoEasyEA<PyEO>::operator())
|
||||
;
|
||||
|
||||
|
|
|
|||
|
|
@ -27,8 +27,18 @@
|
|||
|
||||
using namespace boost::python;
|
||||
|
||||
#define DEF3(x, i1, i2) class_<x<PyEO>, bases<eoBreed<PyEO > > >(#x, \
|
||||
init<i1, i2 >()[with_custodian_and_ward<1,2,with_custodian_and_ward<1,3> >()])\
|
||||
#define DEF3(x, i1, i2) \
|
||||
class_<x<PyEO>, bases<eoBreed<PyEO > > > \
|
||||
(#x, \
|
||||
init<i1, i2 >() \
|
||||
[ \
|
||||
with_custodian_and_ward<1,2, \
|
||||
with_custodian_and_ward<1,3 \
|
||||
> \
|
||||
> \
|
||||
() \
|
||||
] \
|
||||
) \
|
||||
.def("__call__", &eoBreed<PyEO>::operator())
|
||||
|
||||
void breeders()
|
||||
|
|
@ -46,6 +56,4 @@ void breeders()
|
|||
DEF3(eoOneToOneBreeder, eoGenOp<PyEO>&, eoEvalFunc<PyEO>&)
|
||||
.def( init<eoGenOp<PyEO>&, eoEvalFunc<PyEO>&, double>()[WC2] )
|
||||
.def( init<eoGenOp<PyEO>&, eoEvalFunc<PyEO>&, double, eoHowMany>()[WC2] );
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,25 +41,31 @@ void continuators()
|
|||
{
|
||||
/* Counters, wrappers etc */
|
||||
|
||||
class_<eoEvalFuncCounter<PyEO>, bases<eoEvalFunc<PyEO> > >("eoEvalFuncCounter",
|
||||
init< eoEvalFunc<PyEO>&, std::string>())
|
||||
class_<eoEvalFuncCounter<PyEO>, bases<eoEvalFunc<PyEO> > >
|
||||
("eoEvalFuncCounter",
|
||||
init< eoEvalFunc<PyEO>&, std::string>()
|
||||
)
|
||||
.def("__call__", &eoEvalFuncCounter<PyEO>::operator())
|
||||
;
|
||||
/* Continuators */
|
||||
def_abstract_functor<eoContinue<PyEO> >("eoContinue");
|
||||
|
||||
class_<eoGenContinue<PyEO>, bases<eoContinue<PyEO> >, boost::noncopyable >("eoGenContinue", init<unsigned long>() )
|
||||
class_<eoGenContinue<PyEO>, bases<eoContinue<PyEO> >, boost::noncopyable >
|
||||
("eoGenContinue", init<unsigned long>() )
|
||||
.def("__call__", &eoGenContinue<PyEO>::operator())
|
||||
;
|
||||
|
||||
class_<eoCombinedContinue<PyEO>, bases<eoContinue<PyEO> > >("eoCombinedContinue", init<eoContinue<PyEO>&>()[WC1])
|
||||
class_<eoCombinedContinue<PyEO>, bases<eoContinue<PyEO> > >
|
||||
("eoCombinedContinue", init<eoContinue<PyEO>&>()[WC1])
|
||||
.def( init<eoContinue<PyEO>&, eoContinue<PyEO>& >()[WC2] )
|
||||
.def("add", &eoCombinedContinue<PyEO>::add, WC1)
|
||||
.def("__call__", &eoCombinedContinue<PyEO>::operator())
|
||||
;
|
||||
|
||||
class_<eoEvalContinue<PyEO>, bases<eoContinue<PyEO> > >("eoEvalContinue",
|
||||
init<eoEvalFuncCounter<PyEO>&, unsigned long>()[WC1])
|
||||
class_<eoEvalContinue<PyEO>, bases<eoContinue<PyEO> > >
|
||||
("eoEvalContinue",
|
||||
init<eoEvalFuncCounter<PyEO>&, unsigned long>()[WC1]
|
||||
)
|
||||
.def("__call__", &eoEvalContinue<PyEO>::operator())
|
||||
;
|
||||
|
||||
|
|
@ -77,8 +83,8 @@ void addSortedStat(eoCheckPoint<PyEO>& c, eoSortedStatBase<PyEO>& s) { c.add(s);
|
|||
|
||||
void add_checkpoint()
|
||||
{
|
||||
class_<eoCheckPoint<PyEO>, bases< eoContinue<PyEO> > >("eoCheckPoint",
|
||||
|
||||
class_<eoCheckPoint<PyEO>, bases< eoContinue<PyEO> > >
|
||||
("eoCheckPoint",
|
||||
init<eoContinue<PyEO>&> ()[with_custodian_and_ward<1,2>()]
|
||||
)
|
||||
.def("add", addContinue, with_custodian_and_ward<1,2>() )
|
||||
|
|
|
|||
|
|
@ -38,4 +38,3 @@ void mergers()
|
|||
DEF(eoPlus);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,4 +69,3 @@ void monitors()
|
|||
.def("__len__", &MonitorWrapper::size)
|
||||
;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <eoNDSorting.h>
|
||||
|
||||
#include "PyEO.h"
|
||||
|
|
@ -32,7 +33,6 @@ struct Perf2WorthWrapper : public eoPerf2Worth<PyEO,double>
|
|||
{
|
||||
call_method<void>(self, "__call__", boost::ref(pop));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
numeric::array get_worths(eoPerf2Worth<PyEO, double>& p)
|
||||
|
|
@ -61,8 +61,7 @@ void perf2worth()
|
|||
{
|
||||
//numeric::array::set_module_and_type("Numeric", "ArrayType");
|
||||
|
||||
class_<
|
||||
eoPerf2Worth<PyEO, double>,
|
||||
class_<eoPerf2Worth<PyEO, double>,
|
||||
Perf2WorthWrapper,
|
||||
bases< eoValueParam<std::vector<double> > >,
|
||||
boost::noncopyable>("eoPerf2Worth", init<>())
|
||||
|
|
@ -72,8 +71,11 @@ void perf2worth()
|
|||
//.def("value", get_worths)
|
||||
;
|
||||
|
||||
class_<eoPerf2WorthCached<PyEO, double>, CachedPerf2WorthWrapper, bases<eoPerf2Worth<PyEO, double> >, boost::noncopyable>
|
||||
("eoPerf2WorthCached", init<>())
|
||||
class_<eoPerf2WorthCached<PyEO, double>,
|
||||
CachedPerf2WorthWrapper,
|
||||
bases<eoPerf2Worth<PyEO, double> >,
|
||||
boost::noncopyable>("eoPerf2WorthCached", init<>())
|
||||
|
||||
.def("__call__", &eoPerf2WorthCached<PyEO, double>::operator())
|
||||
.def("calculate_worths", &CachedPerf2WorthWrapper::calculate_worths)
|
||||
;
|
||||
|
|
@ -81,8 +83,7 @@ void perf2worth()
|
|||
//class_<eoNoPerf2Worth<PyEO>, bases<eoPerf2Worth<PyEO, double> > >("eoNoPerf2Worth")
|
||||
// .def("__call__", &eoNoPerf2Worth<PyEO>::operator());
|
||||
|
||||
class_<eoNDSorting_II<PyEO>, bases<eoPerf2WorthCached<PyEO, double> > >("eoNDSorting_II")
|
||||
class_<eoNDSorting_II<PyEO>,
|
||||
bases<eoPerf2WorthCached<PyEO, double> > >("eoNDSorting_II")
|
||||
.def("calculate_worths", &eoNDSorting_II<PyEO>::calculate_worths);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@
|
|||
#include <sstream>
|
||||
/** Implements pickle support for eoPersistent derivatives */
|
||||
|
||||
|
||||
template <class T>
|
||||
struct T_pickle_suite : boost::python::pickle_suite
|
||||
{
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ class eoReduceWrapper : public eoReduce<PyEO>
|
|||
|
||||
void reduce()
|
||||
{
|
||||
|
||||
// ref trick in def_abstract_functor does not work for unsigned int :-(
|
||||
class_<eoReduce<PyEO>, eoReduceWrapper, boost::noncopyable>("eoReduce", init<>())
|
||||
.def("__call__", &eoReduceWrapper::operator());
|
||||
|
|
@ -62,4 +61,3 @@ void reduce()
|
|||
.def("__call__", &eoReduce<PyEO>::operator())
|
||||
;
|
||||
}
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue