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/binCrossover.tmpl
evomarc f0813c55ca Added the continue.tmpl template - and modified the html pages accordingly
(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!!!).
2001-04-05 16:47:54 +00:00

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 binary crossover operators
==============================================
Binary crossover operators modify the first parent only,
based on the second
*/
#ifndef eoMyDerivedBinOp_H
#define eoMyDerivedBinOp_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 eoMyDerivedBinOp: public eoBinOp<Indi>
{
public:
/**
* (Default) Constructor.
*/
eoMyDerivedBinOp(paramType _anyParameter) :
anyParameter(_anyParameter) {}
/// The class name. Used to display statistics
string className() const { return "eoMyDerivedBinOp"; }
/**
* eoBin crossover - modifies first parent only
* @param Indi1 The first parent
* @param Indi2 The second parent - const
*/
bool operator()(Indi& Indi1, const Indi& Indi2)
{
// do whatever needs to be done
// if Indi1 has been modified
return true;
// otherwise
// return false;
}
private:
paramType anyParameter
};
#endif