Added the genop.tmpl, template for general op, 3 cases, growing pop, shrinking pop through erase, thrinking pop through extra selector
36 lines
766 B
Cheetah
36 lines
766 B
Cheetah
Template for simple operators
|
|
=============================
|
|
|
|
===========================================================================
|
|
eoMon : mutation operators
|
|
======
|
|
|
|
template<class Indi> class eoMyDerivedMonOp: public eoMonOp<Indi>
|
|
{
|
|
public:
|
|
/**
|
|
* (Default) Constructor.
|
|
*/
|
|
eoMyDerivedMonOp(paramType _anyParameter) :
|
|
anyParameter(_anyParameter) {}
|
|
|
|
/// The class name. Used to display statistics
|
|
string className() const { return "eoMyDerivedMonOp"; }
|
|
|
|
/**
|
|
* eoMon crossover - modifies the parent
|
|
* @param Indi The parent
|
|
*/
|
|
bool operator()(Indi& Indi)
|
|
{
|
|
// do whatever needs to be done
|
|
// if Indi has been modified
|
|
return true;
|
|
// otherwise
|
|
// return false;
|
|
}
|
|
|
|
protected:
|
|
paramType anyParameter
|
|
};
|
|
|