(though eoCheckPoint.html is still a long way to complete). Added some comments in all template files - and replaced the protected by private (don't remember why these were protected!!!).
54 lines
1.2 KiB
C++
54 lines
1.2 KiB
C++
/** -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
|
|
|
The above line is usefulin Emacs-like editors
|
|
*/
|
|
|
|
/*
|
|
Template for simple quadratic crossover operators
|
|
=================================================
|
|
|
|
Quadratic crossover operators modify the both parents
|
|
*/
|
|
|
|
#ifndef eoMyDerivedQuadOp_H
|
|
#define eoMyDerivedQuadOp_H
|
|
|
|
#include <eoOp.h>
|
|
|
|
/**
|
|
Always write a comment in this format before class definition
|
|
if you want the class to be documented by Doxygen
|
|
*/
|
|
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;
|
|
}
|
|
|
|
private:
|
|
paramType anyParameter
|
|
};
|
|
|
|
#endif
|