paradiseo/deprecated/eo/tutorial/html/eoCheckPoint.html

150 lines
7.6 KiB
HTML

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.73 [en] (X11; I; Linux 2.2.15-4mdk i686) [Netscape]">
<title>Variation Operators</title>
</head>
<body text="#000000" link="#0000EF" vlink="#51188E" alink="#FF0000" background="beige009.jpg">
<b><font color="#FF0000">General</font></b>: <a href="eoTopDown.html">Algorithm-Based</a>
- <a href="eoBottomUp.html">Component-Based</a> - <a href="eoProgramming.html">Programming
hints</a> - <b><font face="Arial,Helvetica"><font size=+1><a href="../../doc/html/index.html">EO
documentation</a></font></font></b>
<br>
<hr WIDTH="100%">
<br><b><font color="#FF0000">Local</font></b>: <a href="#introduction">Introduction</a>
- <a href="#continuator">Continuators</a> - <a href="#combined_continue">Combined
continuators</a> - <a href="#checkpoint">Checkpoints</a> - <a href="#statistic">Statistics</a>
- <a href="#monitor">Monitors</a> - <a href="#updater">Updaters</a>
<br>
<hr WIDTH="100%">
<center>
<h1>
<b><font color="#CC0000">CheckPointing</font></b></h1></center>
<a NAME="introduction"></a><b><font color="#000099"><font size=+2>What
is Checkpointing about?</font></font></b>
<br>Evolutionary Algorithms are almost all timely ticked, the basic time
unit being what is called a generation. EO checkpointing mechanism allow
you to program things that you want to be done at the end of every generation.
This includes deciding to stop, outputing some statistics on the current
state of the algorithm,&nbsp; updating some dynamical variables of your
algorithm, saving the population to disk, ...
<p><b><font color="#FF0000">EO classes described in this page</font></b>:
<ul>
<li>
<b><font color="#FF0000">Base classes</font></b>: eoCheckPoint, <a href="#continuator">eoContinue</a>,
eoStat, eoSortedStat, eoMonitor, eoUpdater</li>
<li>
<b><font color="#FF0000">Derived classes</font></b>: eoCombinedContinue,</li>
<li>
<b><font color="#FF0000">Related classes</font></b>: eoGnuPlot1DMonitor,
eoGnuPlot1DSnapshotMonitor,</li>
</ul>
<br>&nbsp;
<p>
<hr WIDTH="100%"><a NAME="continuator"></a><b><font color="#000099"><font size=+1>Continuators:</font></font></b>
<p>Continuators are functors that compute stopping critera. They receive
a population and return a boolean value which is set to false only when
some stopping vriterion is met. All algorithms in EO have a loop that goes
<b><font color="#993300">do{...}while(continuator(pop)</font></b>which
means that the algorithm stops only when the continuator returns <b><font color="#993300">false</font></b>.
<p><b><font color="#FF0000">Interface</font></b>:&nbsp; The abstract class
for computing stopping conditions is <b><font color="#3366FF">eoContinue</font></b>,
and the interface for its operator() is
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b><tt><font color="#993300"><font size=+1>bool operator()(const eoPop&lt;EOT>&amp;
)</font></font></tt></b>
<p>which you could have guessed from the <a href="../../doc/html/classeo_continue.html">inheritance
diagram</a> for class <b><font color="#3366FF">eoContinue</font></b>, as
you see there that <b><font color="#3366FF">eoContinue</font></b> derives
from class <b><tt><font color="#993300"><font size=+1>eoUF&lt;const eoPop&lt;EOT>&amp;,
bool></font></font></tt></b>.
<p><b><font color="#FF0000">Using a continuator</font></b>:
<br>You can find an first example of using a continuator in the code for
<a href="FirstBitGA.html#stop">FirstBitEA</a>
ior more sophisticated continue conditions in&nbsp; <a href="eoLesson2.html#combinedContinue">Lesson2</a>.
<br>If you want to find out how it is used inside an algorithm, go and
see for instance in eoSGA, the simplest EA within EO.
<p><a NAME="writing_continuator"></a><b><font color="#FF0000">Writing a
continuator:</font></b>
<br>There are only two things to modify in the <a href="../Templates/continue.tmpl">template
class definitions</a> provided (apart from the name of the class you are
creating!)
<ul>
<li>
The <font color="#FF6600">constructor</font>, where you pass to the object
any useful parameter (see the private data at end of class definition).</li>
<li>
The <font color="#FF6600">operator()</font> method, which performs the
computation of the actual test using the population plus any other parameter
passed at construct time. Don't forget to <b><font color="#FF6600">returnfalse</font></b>
when the stopping criterion <b><font color="#FF6600">is met!</font></b></li>
</ul>
<a NAME="existingContinue"></a><b><font color="#FF0000">Existing continuators:
</font></b>Of
course you can find out all existing (non-virtual!) subclasses of eoContinue
by looking at its&nbsp; <a href="../../doc/html/classeo_continue.html">inheritance
diagram</a>. But you might find it more convenient to have them listed
here:
<ul>
<li>
</li>
</ul>
<p><br>
<hr WIDTH="100%"><a NAME="combined_continue"></a><b><font color="#000099"><font size=+1>Combining
continuators:</font></font></b>
<p>
<hr WIDTH="100%"><a NAME="checkpoint"></a><b><font color="#000099"><font size=+1>CheckPoints:</font></font></b>
<p><b><font color="#FF0000">Interface</font></b>:
<p><b><font color="#FF0000">Using a checkpoint</font></b>: An eoCheckPoint
being an eoContinue, its usage is exactly the same. However, an eoCheckPoint
will actually do many more things than an eoContinue before returning its
boolean result as an eoContinue.
<p><a NAME="writing_checkpoint"></a><b><font color="#FF0000">Writing a
checkpoint:</font></b>
<br>This is something you should never have to do. However, should you
feel you have to do it, please do - and send us both the reasons that lead
you to that (what is it you couldn't do with existing eoCheckPoint), and
the resulting code, of course.
<br>
<hr WIDTH="100%"><a NAME="statistic"></a><b><font color="#000099"><font size=+1>Statistics:</font></font></b>
<p><b><font color="#FF0000">Interface</font></b>:
<p><b><font color="#FF0000">Using statistics</font></b>:
<p><a NAME="writing_statistic"></a><b><font color="#FF0000">Writing a statitic</font></b>:
<br>
<hr WIDTH="100%"><a NAME="monitor"></a><b><font color="#000099"><font size=+1>Monitors:</font></font></b>
<p><b><font color="#FF0000">Interface</font></b>:
<p><b><font color="#FF0000">Using monitors</font></b>:
<p><a NAME="writing_monitor"></a><b><font color="#FF0000">Writing a monitor</font></b>:
<p>
<hr WIDTH="100%"><a NAME="updater"></a><b><font color="#000099"><font size=+1>Updater:</font></font></b>
<p><b><font color="#FF0000">Interface</font></b>:
<p><b><font color="#FF0000">Using updaters</font></b>:
<p><a NAME="writing_updater"></a><b><font color="#FF0000">Writing an updater</font></b>:
<br>&nbsp;
<p>
<hr WIDTH="100%"><b><font color="#FF0000">Local</font></b>: <a href="#introduction">Introduction</a>
- <a href="#continuator">Continuators</a> - <a href="#combined_continue">Combined
continuators</a> - <a href="#checkpoint">Checkpoints</a> - <a href="#statistic">Statistics</a>
- <a href="#monitor">Monitors</a> - <a href="#updater">Updaters</a>
<br>
<hr WIDTH="100%"><b><font color="#FF0000">General</font></b>: <a href="eoTopDown.html">Algorithm-Based</a>
- <a href="eoBottomUp.html">Component-Based</a> - <a href="eoProgramming.html">Programming
hints</a> -<b><font face="Arial,Helvetica"><font size=+1><a href="../../doc/html/index.html">EO
documentation</a></font></font></b>
<br>
<hr>
<address>
<a href="mailto:Marc.Schoenauer@inria.fr">Marc Schoenauer</a></address>
<br><!-- Created: Mon Oct 30 07:27:13 CET 2000 --><!-- hhmts start -->Last
modified: Fri Dec. 8 2000&nbsp;<!-- hhmts end -->
<br>&nbsp;
</body>
</html>