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!!!).
This commit is contained in:
parent
ddc6650ce5
commit
f0813c55ca
10 changed files with 163 additions and 30 deletions
|
|
@ -1,3 +1,8 @@
|
|||
/** -*- 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
|
||||
==============================================
|
||||
|
|
@ -11,6 +16,10 @@ based on the second
|
|||
|
||||
#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>
|
||||
{
|
||||
|
|
@ -38,7 +47,7 @@ public:
|
|||
// return false;
|
||||
}
|
||||
|
||||
protected:
|
||||
private:
|
||||
paramType anyParameter
|
||||
};
|
||||
|
||||
|
|
|
|||
46
eo/tutorial/Templates/continue.tmpl
Normal file
46
eo/tutorial/Templates/continue.tmpl
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/** -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
The above line is usefulin Emacs-like editors
|
||||
*/
|
||||
|
||||
/*
|
||||
Template for continuator in EO, i.e. stopping conditions for EO algorithms
|
||||
==========================================================================
|
||||
*/
|
||||
|
||||
#ifndef _eoMyContinue_h
|
||||
#define _eoMyContinue_h
|
||||
|
||||
#include <eoMyContinue.h>
|
||||
|
||||
/**
|
||||
Always write a comment in this format before class definition
|
||||
if you want the class to be documented by Doxygen
|
||||
*/
|
||||
template< class EOT>
|
||||
class eoMyContinue: public eoContinue<EOT> {
|
||||
public:
|
||||
/// Ctor
|
||||
eoMyContinue( paramType _anyParameter) :
|
||||
anyParameter(_anyParameter) {}
|
||||
|
||||
|
||||
/** Returns false when you want to stop
|
||||
*/
|
||||
virtual bool operator() ( const eoPop<EOT>& _pop )
|
||||
{
|
||||
bool stopCondition = ... ; // compute the stopping condition
|
||||
if (stopCondition) // the algo will stop upon return FALSE
|
||||
{
|
||||
cout << "STOP in eoMyContinue: blablabla \n";
|
||||
return false;
|
||||
}
|
||||
return true; // == do not stop
|
||||
}
|
||||
|
||||
private:
|
||||
paramType anyParameter
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -1,3 +1,8 @@
|
|||
/** -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
The above line is usefulin Emacs-like editors
|
||||
*/
|
||||
|
||||
/*
|
||||
Template for general operators
|
||||
===============================
|
||||
|
|
@ -13,6 +18,10 @@ Second version, get parents using an external eoSelectOne
|
|||
|
||||
#include <eoGenOp.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 eoLessOffspringExternalSelectorGenOp: public eoGenOp<Indi>
|
||||
{
|
||||
|
|
@ -61,7 +70,7 @@ public:
|
|||
}
|
||||
|
||||
|
||||
protected:
|
||||
private:
|
||||
eoSelectOne<EOT> & sel;
|
||||
paramType anyParameter
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/** -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
The above line is usefulin Emacs-like editors
|
||||
*/
|
||||
|
||||
/*
|
||||
Template for general operators
|
||||
===============================
|
||||
|
|
@ -13,6 +18,10 @@ First version, get parents from populator using the ibbedded select() method
|
|||
|
||||
#include <eoGenOp.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 eoLessOffspringSameSelectorGenOp: public eoGenOp<Indi>
|
||||
{
|
||||
|
|
@ -57,7 +66,7 @@ public:
|
|||
parentN.invalidate();
|
||||
}
|
||||
|
||||
protected:
|
||||
private:
|
||||
paramType anyParameter
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/** -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
The above line is usefulin Emacs-like editors
|
||||
*/
|
||||
|
||||
/*
|
||||
Template for general operators
|
||||
===============================
|
||||
|
|
@ -12,6 +17,10 @@ than there are parents
|
|||
|
||||
#include <eoGenOp.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 eoMoreOffspringGenOp: public eoGenOp<Indi>
|
||||
{
|
||||
|
|
@ -58,7 +67,7 @@ public:
|
|||
}
|
||||
|
||||
|
||||
protected:
|
||||
private:
|
||||
paramType anyParameter
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/** -*- 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 mutation operators
|
||||
======================================
|
||||
|
|
@ -9,6 +14,10 @@ Template for simple mutation operators
|
|||
|
||||
#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 eoMyDerivedMonOp: public eoMonOp<Indi>
|
||||
{
|
||||
|
|
@ -35,7 +44,7 @@ public:
|
|||
// return false;
|
||||
}
|
||||
|
||||
protected:
|
||||
private:
|
||||
paramType anyParameter
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/** -*- 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
|
||||
=================================================
|
||||
|
|
@ -10,6 +15,10 @@ Quadratic crossover operators modify the both parents
|
|||
|
||||
#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>
|
||||
{
|
||||
|
|
@ -38,7 +47,7 @@ public:
|
|||
// return false;
|
||||
}
|
||||
|
||||
protected:
|
||||
private:
|
||||
paramType anyParameter
|
||||
};
|
||||
|
||||
|
|
|
|||
Reference in a new issue