This repository has been archived on 2026-03-28. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
eodev/eo/tutorial/Templates/quadCrossover.tmpl
evomarc 7ec7a856e5 Modified the tempaltes to take into account
- the last modifications of the eopopulator class
- the include files (were totally missing in the old templates)
- JJ's demand for one class - one file :-)
2001-04-03 17:14:08 +00:00

45 lines
948 B
Cheetah

/*
Template for simple quadratic crossover operators
=================================================
Quadratic crossover operators modify the both parents
*/
#ifndef eoMyDerivedQuadOp_H
#define eoMyDerivedQuadOp_H
#include <eoOp.h>
template<class Indi>
class eoMyDerivedQuadOp: public eoQuadOp<Indi>
{
public:
/**
* (Default) Constructor.
*/
eoMyDerivedQuadOp(paramType _anyParameter) :
anyParameter(_anyParameter) {}
/// The class name. Used to display statistics
string className() const { return "eoMyDerivedQuadOp"; }
/**
* eoQuad crossover - modifies both parents
* @param Indi1 The first parent
* @param Indi2 The second parent
*/
bool operator()(Indi& Indi1, Indi& Indi2)
{
// do whatever needs to be done
// if at least one individual has been modified - no way to distinguish
return true;
// otherwise
// return false;
}
protected:
paramType anyParameter
};
#endif