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
|
||||
|
||||
|
|
|
|||
Reference in a new issue