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/mutation.tmpl
kuepper 8acc9dcbce * mutation.tmpl, quadCrossover.tmpl, stat.tmpl: Initialize formerly
uninitialized variables.

* README.tmpl: Hint to regular Templates/README for details.

* README: Add documentation for adding new source-files.

* Makefile.am.src-tmpl (noinst_HEADERS): Add
(MyStruct_SOURCES): Move header files from here to the new
noinst_HEADERS variable.
2007-02-22 08:27:32 +00:00

68 lines
1.7 KiB
C++

/** -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
The above line is useful in Emacs-like editors
*/
/*
Template for simple mutation operators
======================================
*/
#ifndef eoMyStructMutation_H
#define eoMyStructMutation_H
#include <eoOp.h>
/**
* Always write a comment in this format before class definition
* if you want the class to be documented by Doxygen
*
* THere is NO ASSUMPTION on the class GenoypeT.
* In particular, it does not need to derive from EO
*/
template<class GenotypeT>
class eoMyStructMutation: public eoMonOp<GenotypeT>
{
public:
/**
* Ctor - no requirement
*/
// START eventually add or modify the anyVariable argument
eoMyStructMutation()
// eoMyStructMutation( varType _anyVariable) : anyVariable(_anyVariable)
// END eventually add or modify the anyVariable argument
{
// START Code of Ctor of an eoMyStructEvalFunc object
// END Code of Ctor of an eoMyStructEvalFunc object
}
/// The class name. Used to display statistics
string className() const { return "eoMyStructMutation"; }
/**
* modifies the parent
* @param _genotype The parent genotype (will be modified)
*/
bool operator()(GenotypeT & _genotype)
{
bool isModified(true);
// START code for mutation of the _genotype object
/** Requirement
* if (_genotype has been modified)
* isModified = true;
* else
* isModified = false;
*/
return isModified;
// END code for mutation of the _genotype object
}
private:
// START Private data of an eoMyStructMutation object
// varType anyVariable; // for example ...
// END Private data of an eoMyStructMutation object
};
#endif