Modifs in es (crossover added in make_op_es).
Added a dummy selector in eoReandomSelect that does work even with invalid EOs
This commit is contained in:
parent
8b177dd6cd
commit
91342e7080
2 changed files with 27 additions and 4 deletions
|
|
@ -112,5 +112,31 @@ private:
|
|||
vector<const EOT*> eoPters;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** eoNoSelect: returns all individual in order WITHOUT USING FITNESS!!!
|
||||
* looping back to the beginning when exhasuted
|
||||
*
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
template <class EOT> class eoNoSelect: public eoSelectOne<EOT>
|
||||
{
|
||||
public:
|
||||
/** Ctor
|
||||
*/
|
||||
eoNoSelect(): current(0) {}
|
||||
|
||||
virtual const EOT& operator()(const eoPop<EOT>& _pop)
|
||||
{
|
||||
if (current >= _pop.size())
|
||||
current=0;
|
||||
|
||||
current++;
|
||||
return _pop[current-1] ;
|
||||
}
|
||||
private:
|
||||
unsigned current;
|
||||
};
|
||||
|
||||
#endif eoRandomSelect_h
|
||||
|
||||
|
|
|
|||
|
|
@ -49,15 +49,12 @@
|
|||
#include <es/eoNormalMutation.h>
|
||||
#include <es/eoRealAtomXover.h> // for generic operators
|
||||
#include <es/eoEsGlobalXover.h> // Global ES Xover
|
||||
#include <es/eoEsLocalXover.h> // Local ES Xover
|
||||
#include <es/eoEsStandardXover.h> // 2-parents ES Xover
|
||||
|
||||
// the ES-mutations
|
||||
#include <es/eoEsMutationInit.h>
|
||||
#include <es/eoEsMutate.h>
|
||||
|
||||
// the crossover - to be continued
|
||||
#include <es/eoEsStdevXOver.h>
|
||||
|
||||
#endif _es_h
|
||||
|
||||
// Local Variables:
|
||||
|
|
|
|||
Reference in a new issue