diff --git a/eo/src/eoInit.h b/eo/src/eoInit.h index 0df3de35..c329ecbd 100644 --- a/eo/src/eoInit.h +++ b/eo/src/eoInit.h @@ -32,6 +32,7 @@ #include #include #include +#include // for shuffle method /** Base (name) class for Initialization of chromosomes, used in a population @@ -146,6 +147,36 @@ private : eoInit & init; }; + +/** + Initializer for permutation (integer-based) representations. +*/ +template +class eoInitPermutation: public eoInit +{ + public: + + typedef typename EOT::AtomType AtomType; + + eoInitPermutation(unsigned _chromSize) + : chromSize(_chromSize){} + + virtual void operator()(EOT& chrom) + { + chrom.resize(chromSize); + for(unsigned idx=0;idx gen; +}; + + /** eoInitAdaptor changes the place in the hierarchy from eoInit to eoMonOp. This is mainly a type conversion,