<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://airwiki.deib.polimi.it/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=DavideCucci</id>
		<title>AIRWiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://airwiki.deib.polimi.it/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=DavideCucci"/>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php/Special:Contributions/DavideCucci"/>
		<updated>2026-04-19T21:54:18Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.25.6</generator>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14894</id>
		<title>Evoptool: Evolutionary Optimization Tool</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14894"/>
				<updated>2012-04-14T17:02:26Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: /* PPSN 2012 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
Evolutionary Optimization Tool (Evoptool) is an open source optimization tool writte in C++, distributed under GNU General Public License. Evoptool implements meta-heuristics based on the Evolutionary Computation paradigm and aims to provide a common platform for the development and test of new algorithms, in order to facilitate the performance comparison activity. Evoptool offers a wide set of benchmark problems, from classical toy samples to more complex tasks, and a collection of algorithm implementations from Genetic Algorithms and Estimation of Distribution Algorithms paradigms. Evoptool is flexible, easy to extend, also with algorithms based on other approaches other from EAs.&lt;br /&gt;
&lt;br /&gt;
== The Evoptool Team ==&lt;br /&gt;
&lt;br /&gt;
*[[User:MatteoMatteucci| Matteo Matteucci]] - matteucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
*[http://www.dei.polimi.it/personale/dettaglio.php?id_persona=829&amp;amp;id_sezione=&amp;amp;lettera=M&amp;amp;idlang=ita| Luigi Malagò] - malago [AT] elet.polimi.it &lt;br /&gt;
&lt;br /&gt;
*[http://iridia.ulb.ac.be/~gvalentini/ Gabriele Valentini] - gvalentini [AT] iridia.ulb.ac.be&lt;br /&gt;
&lt;br /&gt;
*[[User:DavideCucci| Davide Cucci]] - cucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
'''Formerly involved'''&lt;br /&gt;
*Emanuele Corsano&lt;br /&gt;
&lt;br /&gt;
== PPSN 2012 ==&lt;br /&gt;
&lt;br /&gt;
In this section we report the details of the experiments presented in the paper &amp;quot;Variable Transformations in Estimation of Distribution Algorithms&amp;quot;, submitted to PPSN 2012.&lt;br /&gt;
&lt;br /&gt;
The experiments were run using the unstable version of evoptool, which is available trought SVN at &lt;br /&gt;
&lt;br /&gt;
https://svn.ws.dei.polimi.it/evoptool/branches/unstable&lt;br /&gt;
&lt;br /&gt;
For each problem, Alternated Bits, Trap3, Trap3 Overlapping and Trep5, a python script is used to generate the Evoptool configuration files. For a given problm size ''n'', we chose a population size, run 24 instances of the test algorithm and check the success ratio. If it below 95%, we increase the population, otherwise we compute from these runs the average number of fitness function evaluations performed before the global optimum appears in the population. We increase the population exponentially with ''n'', so that ''N=n^k'' and each time the success ratio is below the chosen we set k=k+0.1.&lt;br /&gt;
&lt;br /&gt;
Each time an experiment is performed using Evoptool, a .tar file is produced which contain statistics and plots for each instance of the algorithms run and also aggregated averages. The python scripts we used name this tar files with the following convention:&lt;br /&gt;
&lt;br /&gt;
algorithm-n-N-selection_rate-maps_number.tar&lt;br /&gt;
&lt;br /&gt;
All the .tar files used to compute the result presented in the paper, along with the python scripts and everything else needed to reproduce the experiments are available trought SVN at&lt;br /&gt;
&lt;br /&gt;
https://svn.ws.dei.polimi.it/evoptool/branches/papers/PPSN-2012-FCA/experiments/&lt;br /&gt;
&lt;br /&gt;
== Mailing List ==&lt;br /&gt;
http://groups.google.com/group/evoptool&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
====Algorithms implemented====&lt;br /&gt;
* Genetic Algorithms&lt;br /&gt;
** SGA&lt;br /&gt;
*Estimation of Distribution Algorithms&lt;br /&gt;
**PBIL, UMDA, cGA, COMIT, BOA, FCA&lt;br /&gt;
* DEUM framework&lt;br /&gt;
**DEUMd, IsingDEUM, DEUM-Chain, DEUM-LDA, DEUM-CE, DEUM-X2, DEUM-JEMP, DEUM-l1, sDEUM&lt;br /&gt;
* Stochastic Gradient Descent&lt;br /&gt;
**SGD, SNGD&lt;br /&gt;
* Other Meta-heuristics&lt;br /&gt;
**Simulated Annealing&lt;br /&gt;
&lt;br /&gt;
References to original papers will be added soon.&lt;br /&gt;
&lt;br /&gt;
====Benchmark functions implemented====&lt;br /&gt;
* OneMax&lt;br /&gt;
* AltBit&lt;br /&gt;
* Trap3&lt;br /&gt;
* Trap5&lt;br /&gt;
* IsingSpinGlass2D (*)&lt;br /&gt;
* IsingSpinGlass3D (*)&lt;br /&gt;
* Max Cut&lt;br /&gt;
&lt;br /&gt;
(*) instances generated and solved with Spin Glass Server. This service is provided by COPhy and M. Jünger's group.&lt;br /&gt;
http://www.informatik.uni-koeln.de/spinglass/&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Developers may also access unstable branch. Contact the evoptool team for more details.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
Follow these steps in order to compile evoptool&lt;br /&gt;
&lt;br /&gt;
1. Download source code from svn&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Refer to trunk for the lastest (stable?) version of evoptool&lt;br /&gt;
&lt;br /&gt;
2. First you need to manually compile the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; package, http://www.stanford.edu/~boyd/l1_logreg/&lt;br /&gt;
whose source are already included in the evoptool repository. In order to do that follow the instrunctions in &lt;br /&gt;
&amp;lt;code&amp;gt;README.evoptool&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
Next, compile &amp;lt;code&amp;gt;&amp;lt;id_dist/code&amp;gt; following the instructions in &amp;lt;code&amp;gt;README.evoptool&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;&amp;lt;id_dist&amp;lt;/code&amp;gt; folder&lt;br /&gt;
&lt;br /&gt;
3. Then you need to compile a module at a time. Each module is included in a different folder. &lt;br /&gt;
To compile a module, from go to the module source folder and do make lib. For instance, for the module named &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  cd common/src&lt;br /&gt;
  make lib&lt;br /&gt;
  cd ..&lt;br /&gt;
&lt;br /&gt;
Compile modules in the following orderm due to dependencies&lt;br /&gt;
&lt;br /&gt;
  common&lt;br /&gt;
  functions&lt;br /&gt;
  ga&lt;br /&gt;
  stochastic&lt;br /&gt;
  eda&lt;br /&gt;
&lt;br /&gt;
To clean a module, do &lt;br /&gt;
&lt;br /&gt;
  make clean&lt;br /&gt;
&lt;br /&gt;
from the module source directory&lt;br /&gt;
&lt;br /&gt;
4. Go to &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;  module and type&lt;br /&gt;
&lt;br /&gt;
  make exe&lt;br /&gt;
&lt;br /&gt;
Binary files will be copied in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root as well as the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory of the &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt; module&lt;br /&gt;
&lt;br /&gt;
'''Required packages'''&lt;br /&gt;
* Libraries&lt;br /&gt;
** ''gtkmm-2.4''&lt;br /&gt;
** ''glademm-2.4''&lt;br /&gt;
** ''gthread-2.0''&lt;br /&gt;
** ''sigc++-2.0''&lt;br /&gt;
** ''opencv'' (see for instance http://www.samontab.com/web/2011/06/installing-opencv-2-2-in-ubuntu-11-04/)&lt;br /&gt;
** ''gsl''&lt;br /&gt;
** ''gslcblas''&lt;br /&gt;
** ''libxml++-2.6''&lt;br /&gt;
** ''f2c''&lt;br /&gt;
&lt;br /&gt;
* Software&lt;br /&gt;
** ''gnuplot''&lt;br /&gt;
**  ''R (lars package)''&lt;br /&gt;
&lt;br /&gt;
== Running  ==&lt;br /&gt;
&lt;br /&gt;
Right now &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; only runs as a script. GUI is not maintained in the latest version.&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; binary file is supposed to be run in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root, this is because right now the script looks for some configuration files, for the instances of the problems, and temp directories. If you want to run the script from other directories, you just need to copy in that directory the &amp;lt;code&amp;gt;evoptool-file&amp;lt;/code&amp;gt; directory that you find in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory. Link such directory instead of copying it is not safe if you run multiple scripts at the same time, since output files will be shared. &lt;br /&gt;
&lt;br /&gt;
To run the algorithm you need to enter as input an xml file. For instance you can run&lt;br /&gt;
&lt;br /&gt;
  ./evoptool evoptool-file/examples/unitTestOneMax.xml&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool-file/example&amp;lt;/code&amp;gt; directory contains a set of xml files for different benchmarks and different algorithms.&lt;br /&gt;
Take a loot at the &amp;lt;code&amp;gt;example.xml&amp;lt;/code&amp;gt; file for the documentation on hoe to set the parameters for an each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; produces a set of files as output. You can find all files in &amp;lt;code&amp;gt;evoptool-file/temp&amp;lt;/code&amp;gt; directory. Plus a tar.gz file containing such files can be produced at the end of the execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. See the xml file for details.&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/data&lt;br /&gt;
contains the raw data of the statistics according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/gnuplot&lt;br /&gt;
contains the gnuplot files to produce images of the statistics&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/image&lt;br /&gt;
contains images of the statistics produced according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/support&lt;br /&gt;
contains logs&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
==== Implement a new benchmark function====&lt;br /&gt;
&lt;br /&gt;
Benchmarks are defined in the &amp;lt;code&amp;gt;function&amp;lt;/code&amp;gt; module. A benchmark is the maximization problem of a real valued function defined over a vector of n binary variables. Functions are maximized in &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. In order to implement a new benchmark function you have to create a new &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt; that inherits from &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt; module. Take a look at the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; benchmark function.&lt;br /&gt;
&lt;br /&gt;
Among the arguments of the constructor of the &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; class there must be the size of the benchmark, which may or may not be a parameter of the new benchmark.&lt;br /&gt;
&lt;br /&gt;
  OneMax::OneMax(int size) : ObjectiveFunction(size)&lt;br /&gt;
&lt;br /&gt;
In the constructor you have whether the maximum of the function is known or not&lt;br /&gt;
&lt;br /&gt;
   _knownSolution = true;&lt;br /&gt;
&lt;br /&gt;
And in case this is known, set the minimum value and maximum value for the function&lt;br /&gt;
&lt;br /&gt;
 _minFitness = 0; &lt;br /&gt;
 _maxFitness = size; //the maximum value of the OneMax function is defined as the sum of the bits of x set to one.&lt;br /&gt;
&lt;br /&gt;
Besides, such values are used in the normalization of the functions in the plots of the statistics.&lt;br /&gt;
&lt;br /&gt;
Each benchmark must implement the &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; method, which takes the &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x and return f(x). For instance, for &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; you have&lt;br /&gt;
&lt;br /&gt;
  double OneMax::f(BinaryString *bi) {&lt;br /&gt;
  &amp;amp;nbsp;if (bi != NULL) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;if(!(bi-&amp;gt;validCache())) { &lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;/* Fitness cache value not valid */&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;int sum = 0;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;for (int j = 0; j &amp;lt; _size; j++) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;sum = sum + bi-&amp;gt;get(j);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;bi-&amp;gt;setFitnessCache(sum);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return sum;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return bi-&amp;gt;getFitnessCache();&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;cerr &amp;lt;&amp;lt; &amp;quot;[OneMax::f] binary instance cannot be null&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;return 0;&lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In order to avoid multiple evaluations of the same &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x, a caching mechanism has been implemented.&lt;br /&gt;
&lt;br /&gt;
Moreover, you are asked to implement the &amp;lt;code&amp;gt;exportInteration&amp;lt;/code&amp;gt; function, which return an &amp;lt;code&amp;gt;HyperGraph&amp;lt;/code&amp;gt; which represents the interactions present in the function. In order to determine such hypergraph, start from the polinomial representation of the function, and for each monomial introduce a new hyperedge in the hypergraph.&lt;br /&gt;
&lt;br /&gt;
For the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; function, such representation corresponds to the independence graph, since such function is linear. &lt;br /&gt;
&lt;br /&gt;
  HyperGraph* OneMax::exportInteractions() {&lt;br /&gt;
  &amp;amp;nbsp;HyperGraph *interactions = new HyperGraph();&lt;br /&gt;
  &amp;amp;nbsp;interactions-&amp;gt;createIndependenceGraph(_size);&lt;br /&gt;
  &amp;amp;nbsp;return interactions;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;Evoptool.h&amp;lt;/code&amp;gt; add an entry in the &amp;lt;code&amp;gt;Tasks&amp;lt;/code&amp;gt; enum.&lt;br /&gt;
&lt;br /&gt;
  /* This enumeration defines an identifier for each task function. */&lt;br /&gt;
  typedef enum {&lt;br /&gt;
  &amp;amp;nbsp;ONE_MAX = 7,&lt;br /&gt;
  } Tasks;&lt;br /&gt;
&lt;br /&gt;
This value will identify uniquely the benchmark in the xml file. In the &amp;lt;code&amp;gt;XMLParser.cpp&amp;lt;/code&amp;gt; file, add an entry for the new function.&lt;br /&gt;
&lt;br /&gt;
  bool XMLParser::parseTask(xmlpp::TextReader &amp;amp;reader, Evoptool::TestParameters *params) {&lt;br /&gt;
  &amp;amp;nbsp;.. &lt;br /&gt;
  &amp;amp;nbsp;switch (task) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;case Evoptool::ONE_MAX: params-&amp;gt;task = new OneMax(size);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;break;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;..&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;default: return false; &lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;..&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Additional parameters can be obtained using the xml TextReader object, as for the &amp;lt;code&amp;gt;ForPeaks&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
  case Evoptool::FOUR_PEAKS: &lt;br /&gt;
  &amp;amp;nbsp;value = readNodeContent(reader, &amp;quot;peaks&amp;quot;, &amp;amp;errorFlag);&lt;br /&gt;
  &amp;amp;nbsp;if (errorFlag) return false;&lt;br /&gt;
  &amp;amp;nbsp;int peaks = toInt(value);&lt;br /&gt;
  &amp;amp;nbsp;params-&amp;gt;task = new FourPeaks(size, peaks);&lt;br /&gt;
  &amp;amp;nbsp;break; &lt;br /&gt;
&lt;br /&gt;
Finally in the xml file, a function can set with the &amp;lt;code&amp;gt;task&amp;lt;/code&amp;gt; tag, together with all parameters.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;task&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;name&amp;gt;7&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;size&amp;gt;64&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;/task&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== To create a new algorithm ====&lt;br /&gt;
&lt;br /&gt;
1. Implement a new algorithm&lt;br /&gt;
&lt;br /&gt;
All algorithms must inherit from the Algorithm class. First override the Algorithm::initAlgorithm as follows:&lt;br /&gt;
&lt;br /&gt;
  void DEUM::initAlgorithm(ObjectiveFunction* of) {&lt;br /&gt;
    Algorithm::initAlgorithm(of);&lt;br /&gt;
  &lt;br /&gt;
    /* Initialization tasks */&lt;br /&gt;
    ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Then implement a run() method which performs al the required task for '''one''' iteration of your algorithm.&lt;br /&gt;
&lt;br /&gt;
There are some classes which contain useful methods such as samplers and estimators from which your algorithm can inherit. The most useful are:&lt;br /&gt;
&lt;br /&gt;
  PopulationBasedAlgorithm&lt;br /&gt;
  ModelBasedAlgorithm&lt;br /&gt;
  ExponentialFamilyAlgorithm&lt;br /&gt;
  BayesianNetworkBasedAlgorithm&lt;br /&gt;
&lt;br /&gt;
2. Append entry in the &amp;lt;tt&amp;gt;Algorithms&amp;lt;/tt&amp;gt; enum in Evoptool.h.&lt;br /&gt;
&lt;br /&gt;
  typedef enum {&lt;br /&gt;
    ...&lt;br /&gt;
    DEUM    // 5&lt;br /&gt;
  } Algorithms;&lt;br /&gt;
&lt;br /&gt;
In the xml configuration file, your algorithm will be characterized by the int value associated with the position in this enum declaration.&lt;br /&gt;
&lt;br /&gt;
3. modify the file&lt;br /&gt;
core/src/XMLParser.cpp. Search for the method &amp;lt;tt&amp;gt;bool XMLParser::parseAlgorithms&amp;lt;/tt&amp;gt; and insert an new entry for your algorithm in the &amp;lt;tt&amp;gt;algorithmParameters&amp;lt;/tt&amp;gt; array, for example&lt;br /&gt;
&lt;br /&gt;
  AlgorithmParameters algorithmParameters[] = {&lt;br /&gt;
    ...&lt;br /&gt;
    { Evoptool::DEUM, 5, (char*) &amp;quot;IDDDI&amp;quot; }, // Pop, percElitism, percSelec, CoolRate, GibbsIterations&lt;br /&gt;
    ...&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
In each entry, the first field is the name of the entry in the &amp;lt;tt&amp;gt;Algorithms&amp;lt;/tt&amp;gt; enum just modified in &amp;lt;tt&amp;gt;Evoptool.h&amp;lt;/tt&amp;gt;, the second is the number of parameters to be parsed in the xml configuration file and the third is a string specifying their type: &amp;lt;tt&amp;gt;I&amp;lt;/tt&amp;gt; for integer and &amp;lt;tt&amp;gt;D&amp;lt;/tt&amp;gt; for double.&lt;br /&gt;
&lt;br /&gt;
4. add a case in the switch that follows in &amp;lt;tt&amp;gt;bool XMLParser::parseAlgorithms&amp;lt;/tt&amp;gt;, for instance:&lt;br /&gt;
&lt;br /&gt;
  case Evoptool::DEUM: &lt;br /&gt;
    algos[i] = new extendedFCA(intVal[0], doubleVal[0], doubleVal[1], intVal[1], intVal[2], params-&amp;gt;rng);&lt;br /&gt;
    algos[i]-&amp;gt;initAlgorithm(params-&amp;gt;task);&lt;br /&gt;
    break;&lt;br /&gt;
&lt;br /&gt;
Note that your algorithm can employ the random number generator provided by the Evoptool core, &amp;lt;tt&amp;gt;params-&amp;gt;rng&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
5. Include your headers in core/src/Algorithms.h&lt;br /&gt;
&lt;br /&gt;
6. Document how your algorithm is instantiated in the comments appearing in evoptool-file/exec-scripts/example.xml&lt;br /&gt;
&lt;br /&gt;
   Algorithm  Id    Types    Parameters&lt;br /&gt;
  =====================================================================================================&lt;br /&gt;
    ...&lt;br /&gt;
    FCA       26    &amp;quot;IDDII&amp;quot;  (Pop, PercSelection, LearningRate, MaxCompositionLenght, MaxMonomialOrder)&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
7. Add an instantiation example for your algorithm in evoptool-file/exec-scripts/example.xml&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;algo id=&amp;quot;26&amp;quot; instanceName=&amp;quot;FCA&amp;quot;&amp;gt;  &lt;br /&gt;
    &amp;lt;int&amp;gt;1000&amp;lt;/int&amp;gt;&lt;br /&gt;
    &amp;lt;double&amp;gt;0.5&amp;lt;/double&amp;gt;&lt;br /&gt;
    &amp;lt;double&amp;gt;1&amp;lt;/double&amp;gt;&lt;br /&gt;
    &amp;lt;int&amp;gt;64&amp;lt;/int&amp;gt;&lt;br /&gt;
    &amp;lt;int&amp;gt;2&amp;lt;/int&amp;gt;&lt;br /&gt;
  &amp;lt;/algo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Run an algorithm in a C++ program ====&lt;br /&gt;
&lt;br /&gt;
The simplest way to do this is to create a new submodule in &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;, i.e., a new source directory within the source directory of a module&lt;br /&gt;
For instance, the steps to create a new submodule named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; are&lt;br /&gt;
&lt;br /&gt;
1. copy the example submodule &amp;lt;code&amp;gt;exampleRunAlgorithm&amp;lt;/code&amp;gt; in a new folder named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; in&lt;br /&gt;
&lt;br /&gt;
  evoptool/core/src&lt;br /&gt;
&lt;br /&gt;
2. modify the &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; directory, see comments in the makefile for more details.&lt;br /&gt;
&lt;br /&gt;
3. edit the &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; function in the source file, if you need you can create other C++ and .h files in the same folder.&lt;br /&gt;
&lt;br /&gt;
4. from &amp;lt;code&amp;gt;evoptool/core/src/myexample&amp;lt;/code&amp;gt; run&lt;br /&gt;
&lt;br /&gt;
  make bin&lt;br /&gt;
&lt;br /&gt;
The bin file is create in &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; and copied in &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTICE that &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; may be deleted after a &amp;lt;code&amp;gt;make cleanall&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. from &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt; run &lt;br /&gt;
&lt;br /&gt;
  ./myexample&lt;br /&gt;
&lt;br /&gt;
==== Available statistics  ====&lt;br /&gt;
&lt;br /&gt;
In the configuration xml file you can enable the evaluation of three set of statistics:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;statisticsConfiguration&amp;gt;&lt;br /&gt;
    &amp;lt;evalPopulationStatistics&amp;gt;yes&amp;lt;/evalPopulationStatistics&amp;gt;&lt;br /&gt;
    &amp;lt;evalModelStatistics&amp;gt;yes&amp;lt;/evalModelStatistics&amp;gt;&lt;br /&gt;
    &amp;lt;evalExecutionStatistics&amp;gt;No&amp;lt;/evalExecutionStatistics&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/statisticsConfiguration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the headers file in evoptool/common/src for details.&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14893</id>
		<title>Evoptool: Evolutionary Optimization Tool</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14893"/>
				<updated>2012-04-14T16:47:04Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: /* PPSN 2012 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
Evolutionary Optimization Tool (Evoptool) is an open source optimization tool writte in C++, distributed under GNU General Public License. Evoptool implements meta-heuristics based on the Evolutionary Computation paradigm and aims to provide a common platform for the development and test of new algorithms, in order to facilitate the performance comparison activity. Evoptool offers a wide set of benchmark problems, from classical toy samples to more complex tasks, and a collection of algorithm implementations from Genetic Algorithms and Estimation of Distribution Algorithms paradigms. Evoptool is flexible, easy to extend, also with algorithms based on other approaches other from EAs.&lt;br /&gt;
&lt;br /&gt;
== The Evoptool Team ==&lt;br /&gt;
&lt;br /&gt;
*[[User:MatteoMatteucci| Matteo Matteucci]] - matteucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
*[http://www.dei.polimi.it/personale/dettaglio.php?id_persona=829&amp;amp;id_sezione=&amp;amp;lettera=M&amp;amp;idlang=ita| Luigi Malagò] - malago [AT] elet.polimi.it &lt;br /&gt;
&lt;br /&gt;
*[http://iridia.ulb.ac.be/~gvalentini/ Gabriele Valentini] - gvalentini [AT] iridia.ulb.ac.be&lt;br /&gt;
&lt;br /&gt;
*[[User:DavideCucci| Davide Cucci]] - cucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
'''Formerly involved'''&lt;br /&gt;
*Emanuele Corsano&lt;br /&gt;
&lt;br /&gt;
== PPSN 2012 ==&lt;br /&gt;
&lt;br /&gt;
In this section we report the details of the experiments presented in the paper &amp;quot;Variable Transformations in Estimation of Distribution Algorithms&amp;quot;, submitted to PPSN 2012.&lt;br /&gt;
&lt;br /&gt;
The experiments were run using the unstable version of evoptool, which is available trought SVN at &lt;br /&gt;
&lt;br /&gt;
https://svn.ws.dei.polimi.it/evoptool/branches/unstable&lt;br /&gt;
&lt;br /&gt;
For each problem, Alternated Bits, Trap3, Trap3 Overlapping and Trep5, a python script is used to generate the Evoptool configuration files. For a given problm size ''n'', we chose a population size, run 24 instances of the test algorithm and check the success ratio. If it below 95%, we increase the population, otherwise we compute from these runs the average number of fitness function evaluations performed before the global optimum appears in the population. We increase the population exponentially with ''n'', so that ''N=n^k'' and each time the success ratio is below the chosen we set k=k+0.1.&lt;br /&gt;
&lt;br /&gt;
The python scripts and everything else needed to reproduce the experiments is available trought SVN at&lt;br /&gt;
&lt;br /&gt;
https://svn.ws.dei.polimi.it/evoptool/branches/papers/PPSN-2012-FCA/experiments/&lt;br /&gt;
&lt;br /&gt;
== Mailing List ==&lt;br /&gt;
http://groups.google.com/group/evoptool&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
====Algorithms implemented====&lt;br /&gt;
* Genetic Algorithms&lt;br /&gt;
** SGA&lt;br /&gt;
*Estimation of Distribution Algorithms&lt;br /&gt;
**PBIL, UMDA, cGA, COMIT, BOA, FCA&lt;br /&gt;
* DEUM framework&lt;br /&gt;
**DEUMd, IsingDEUM, DEUM-Chain, DEUM-LDA, DEUM-CE, DEUM-X2, DEUM-JEMP, DEUM-l1, sDEUM&lt;br /&gt;
* Stochastic Gradient Descent&lt;br /&gt;
**SGD, SNGD&lt;br /&gt;
* Other Meta-heuristics&lt;br /&gt;
**Simulated Annealing&lt;br /&gt;
&lt;br /&gt;
References to original papers will be added soon.&lt;br /&gt;
&lt;br /&gt;
====Benchmark functions implemented====&lt;br /&gt;
* OneMax&lt;br /&gt;
* AltBit&lt;br /&gt;
* Trap3&lt;br /&gt;
* Trap5&lt;br /&gt;
* IsingSpinGlass2D (*)&lt;br /&gt;
* IsingSpinGlass3D (*)&lt;br /&gt;
* Max Cut&lt;br /&gt;
&lt;br /&gt;
(*) instances generated and solved with Spin Glass Server. This service is provided by COPhy and M. Jünger's group.&lt;br /&gt;
http://www.informatik.uni-koeln.de/spinglass/&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Developers may also access unstable branch. Contact the evoptool team for more details.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
Follow these steps in order to compile evoptool&lt;br /&gt;
&lt;br /&gt;
1. Download source code from svn&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Refer to trunk for the lastest (stable?) version of evoptool&lt;br /&gt;
&lt;br /&gt;
2. First you need to manually compile the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; package, http://www.stanford.edu/~boyd/l1_logreg/&lt;br /&gt;
whose source are already included in the evoptool repository. In order to do that follow the instrunctions in &lt;br /&gt;
&amp;lt;code&amp;gt;README.evoptool&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
Next, compile &amp;lt;code&amp;gt;&amp;lt;id_dist/code&amp;gt; following the instructions in &amp;lt;code&amp;gt;README.evoptool&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;&amp;lt;id_dist&amp;lt;/code&amp;gt; folder&lt;br /&gt;
&lt;br /&gt;
3. Then you need to compile a module at a time. Each module is included in a different folder. &lt;br /&gt;
To compile a module, from go to the module source folder and do make lib. For instance, for the module named &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  cd common/src&lt;br /&gt;
  make lib&lt;br /&gt;
  cd ..&lt;br /&gt;
&lt;br /&gt;
Compile modules in the following orderm due to dependencies&lt;br /&gt;
&lt;br /&gt;
  common&lt;br /&gt;
  functions&lt;br /&gt;
  ga&lt;br /&gt;
  stochastic&lt;br /&gt;
  eda&lt;br /&gt;
&lt;br /&gt;
To clean a module, do &lt;br /&gt;
&lt;br /&gt;
  make clean&lt;br /&gt;
&lt;br /&gt;
from the module source directory&lt;br /&gt;
&lt;br /&gt;
4. Go to &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;  module and type&lt;br /&gt;
&lt;br /&gt;
  make exe&lt;br /&gt;
&lt;br /&gt;
Binary files will be copied in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root as well as the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory of the &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt; module&lt;br /&gt;
&lt;br /&gt;
'''Required packages'''&lt;br /&gt;
* Libraries&lt;br /&gt;
** ''gtkmm-2.4''&lt;br /&gt;
** ''glademm-2.4''&lt;br /&gt;
** ''gthread-2.0''&lt;br /&gt;
** ''sigc++-2.0''&lt;br /&gt;
** ''opencv'' (see for instance http://www.samontab.com/web/2011/06/installing-opencv-2-2-in-ubuntu-11-04/)&lt;br /&gt;
** ''gsl''&lt;br /&gt;
** ''gslcblas''&lt;br /&gt;
** ''libxml++-2.6''&lt;br /&gt;
** ''f2c''&lt;br /&gt;
&lt;br /&gt;
* Software&lt;br /&gt;
** ''gnuplot''&lt;br /&gt;
**  ''R (lars package)''&lt;br /&gt;
&lt;br /&gt;
== Running  ==&lt;br /&gt;
&lt;br /&gt;
Right now &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; only runs as a script. GUI is not maintained in the latest version.&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; binary file is supposed to be run in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root, this is because right now the script looks for some configuration files, for the instances of the problems, and temp directories. If you want to run the script from other directories, you just need to copy in that directory the &amp;lt;code&amp;gt;evoptool-file&amp;lt;/code&amp;gt; directory that you find in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory. Link such directory instead of copying it is not safe if you run multiple scripts at the same time, since output files will be shared. &lt;br /&gt;
&lt;br /&gt;
To run the algorithm you need to enter as input an xml file. For instance you can run&lt;br /&gt;
&lt;br /&gt;
  ./evoptool evoptool-file/examples/unitTestOneMax.xml&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool-file/example&amp;lt;/code&amp;gt; directory contains a set of xml files for different benchmarks and different algorithms.&lt;br /&gt;
Take a loot at the &amp;lt;code&amp;gt;example.xml&amp;lt;/code&amp;gt; file for the documentation on hoe to set the parameters for an each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; produces a set of files as output. You can find all files in &amp;lt;code&amp;gt;evoptool-file/temp&amp;lt;/code&amp;gt; directory. Plus a tar.gz file containing such files can be produced at the end of the execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. See the xml file for details.&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/data&lt;br /&gt;
contains the raw data of the statistics according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/gnuplot&lt;br /&gt;
contains the gnuplot files to produce images of the statistics&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/image&lt;br /&gt;
contains images of the statistics produced according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/support&lt;br /&gt;
contains logs&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
==== Implement a new benchmark function====&lt;br /&gt;
&lt;br /&gt;
Benchmarks are defined in the &amp;lt;code&amp;gt;function&amp;lt;/code&amp;gt; module. A benchmark is the maximization problem of a real valued function defined over a vector of n binary variables. Functions are maximized in &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. In order to implement a new benchmark function you have to create a new &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt; that inherits from &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt; module. Take a look at the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; benchmark function.&lt;br /&gt;
&lt;br /&gt;
Among the arguments of the constructor of the &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; class there must be the size of the benchmark, which may or may not be a parameter of the new benchmark.&lt;br /&gt;
&lt;br /&gt;
  OneMax::OneMax(int size) : ObjectiveFunction(size)&lt;br /&gt;
&lt;br /&gt;
In the constructor you have whether the maximum of the function is known or not&lt;br /&gt;
&lt;br /&gt;
   _knownSolution = true;&lt;br /&gt;
&lt;br /&gt;
And in case this is known, set the minimum value and maximum value for the function&lt;br /&gt;
&lt;br /&gt;
 _minFitness = 0; &lt;br /&gt;
 _maxFitness = size; //the maximum value of the OneMax function is defined as the sum of the bits of x set to one.&lt;br /&gt;
&lt;br /&gt;
Besides, such values are used in the normalization of the functions in the plots of the statistics.&lt;br /&gt;
&lt;br /&gt;
Each benchmark must implement the &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; method, which takes the &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x and return f(x). For instance, for &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; you have&lt;br /&gt;
&lt;br /&gt;
  double OneMax::f(BinaryString *bi) {&lt;br /&gt;
  &amp;amp;nbsp;if (bi != NULL) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;if(!(bi-&amp;gt;validCache())) { &lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;/* Fitness cache value not valid */&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;int sum = 0;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;for (int j = 0; j &amp;lt; _size; j++) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;sum = sum + bi-&amp;gt;get(j);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;bi-&amp;gt;setFitnessCache(sum);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return sum;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return bi-&amp;gt;getFitnessCache();&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;cerr &amp;lt;&amp;lt; &amp;quot;[OneMax::f] binary instance cannot be null&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;return 0;&lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In order to avoid multiple evaluations of the same &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x, a caching mechanism has been implemented.&lt;br /&gt;
&lt;br /&gt;
Moreover, you are asked to implement the &amp;lt;code&amp;gt;exportInteration&amp;lt;/code&amp;gt; function, which return an &amp;lt;code&amp;gt;HyperGraph&amp;lt;/code&amp;gt; which represents the interactions present in the function. In order to determine such hypergraph, start from the polinomial representation of the function, and for each monomial introduce a new hyperedge in the hypergraph.&lt;br /&gt;
&lt;br /&gt;
For the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; function, such representation corresponds to the independence graph, since such function is linear. &lt;br /&gt;
&lt;br /&gt;
  HyperGraph* OneMax::exportInteractions() {&lt;br /&gt;
  &amp;amp;nbsp;HyperGraph *interactions = new HyperGraph();&lt;br /&gt;
  &amp;amp;nbsp;interactions-&amp;gt;createIndependenceGraph(_size);&lt;br /&gt;
  &amp;amp;nbsp;return interactions;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;Evoptool.h&amp;lt;/code&amp;gt; add an entry in the &amp;lt;code&amp;gt;Tasks&amp;lt;/code&amp;gt; enum.&lt;br /&gt;
&lt;br /&gt;
  /* This enumeration defines an identifier for each task function. */&lt;br /&gt;
  typedef enum {&lt;br /&gt;
  &amp;amp;nbsp;ONE_MAX = 7,&lt;br /&gt;
  } Tasks;&lt;br /&gt;
&lt;br /&gt;
This value will identify uniquely the benchmark in the xml file. In the &amp;lt;code&amp;gt;XMLParser.cpp&amp;lt;/code&amp;gt; file, add an entry for the new function.&lt;br /&gt;
&lt;br /&gt;
  bool XMLParser::parseTask(xmlpp::TextReader &amp;amp;reader, Evoptool::TestParameters *params) {&lt;br /&gt;
  &amp;amp;nbsp;.. &lt;br /&gt;
  &amp;amp;nbsp;switch (task) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;case Evoptool::ONE_MAX: params-&amp;gt;task = new OneMax(size);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;break;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;..&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;default: return false; &lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;..&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Additional parameters can be obtained using the xml TextReader object, as for the &amp;lt;code&amp;gt;ForPeaks&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
  case Evoptool::FOUR_PEAKS: &lt;br /&gt;
  &amp;amp;nbsp;value = readNodeContent(reader, &amp;quot;peaks&amp;quot;, &amp;amp;errorFlag);&lt;br /&gt;
  &amp;amp;nbsp;if (errorFlag) return false;&lt;br /&gt;
  &amp;amp;nbsp;int peaks = toInt(value);&lt;br /&gt;
  &amp;amp;nbsp;params-&amp;gt;task = new FourPeaks(size, peaks);&lt;br /&gt;
  &amp;amp;nbsp;break; &lt;br /&gt;
&lt;br /&gt;
Finally in the xml file, a function can set with the &amp;lt;code&amp;gt;task&amp;lt;/code&amp;gt; tag, together with all parameters.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;task&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;name&amp;gt;7&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;size&amp;gt;64&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;/task&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== To create a new algorithm ====&lt;br /&gt;
&lt;br /&gt;
1. Implement a new algorithm&lt;br /&gt;
&lt;br /&gt;
All algorithms must inherit from the Algorithm class. First override the Algorithm::initAlgorithm as follows:&lt;br /&gt;
&lt;br /&gt;
  void DEUM::initAlgorithm(ObjectiveFunction* of) {&lt;br /&gt;
    Algorithm::initAlgorithm(of);&lt;br /&gt;
  &lt;br /&gt;
    /* Initialization tasks */&lt;br /&gt;
    ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Then implement a run() method which performs al the required task for '''one''' iteration of your algorithm.&lt;br /&gt;
&lt;br /&gt;
There are some classes which contain useful methods such as samplers and estimators from which your algorithm can inherit. The most useful are:&lt;br /&gt;
&lt;br /&gt;
  PopulationBasedAlgorithm&lt;br /&gt;
  ModelBasedAlgorithm&lt;br /&gt;
  ExponentialFamilyAlgorithm&lt;br /&gt;
  BayesianNetworkBasedAlgorithm&lt;br /&gt;
&lt;br /&gt;
2. Append entry in the &amp;lt;tt&amp;gt;Algorithms&amp;lt;/tt&amp;gt; enum in Evoptool.h.&lt;br /&gt;
&lt;br /&gt;
  typedef enum {&lt;br /&gt;
    ...&lt;br /&gt;
    DEUM    // 5&lt;br /&gt;
  } Algorithms;&lt;br /&gt;
&lt;br /&gt;
In the xml configuration file, your algorithm will be characterized by the int value associated with the position in this enum declaration.&lt;br /&gt;
&lt;br /&gt;
3. modify the file&lt;br /&gt;
core/src/XMLParser.cpp. Search for the method &amp;lt;tt&amp;gt;bool XMLParser::parseAlgorithms&amp;lt;/tt&amp;gt; and insert an new entry for your algorithm in the &amp;lt;tt&amp;gt;algorithmParameters&amp;lt;/tt&amp;gt; array, for example&lt;br /&gt;
&lt;br /&gt;
  AlgorithmParameters algorithmParameters[] = {&lt;br /&gt;
    ...&lt;br /&gt;
    { Evoptool::DEUM, 5, (char*) &amp;quot;IDDDI&amp;quot; }, // Pop, percElitism, percSelec, CoolRate, GibbsIterations&lt;br /&gt;
    ...&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
In each entry, the first field is the name of the entry in the &amp;lt;tt&amp;gt;Algorithms&amp;lt;/tt&amp;gt; enum just modified in &amp;lt;tt&amp;gt;Evoptool.h&amp;lt;/tt&amp;gt;, the second is the number of parameters to be parsed in the xml configuration file and the third is a string specifying their type: &amp;lt;tt&amp;gt;I&amp;lt;/tt&amp;gt; for integer and &amp;lt;tt&amp;gt;D&amp;lt;/tt&amp;gt; for double.&lt;br /&gt;
&lt;br /&gt;
4. add a case in the switch that follows in &amp;lt;tt&amp;gt;bool XMLParser::parseAlgorithms&amp;lt;/tt&amp;gt;, for instance:&lt;br /&gt;
&lt;br /&gt;
  case Evoptool::DEUM: &lt;br /&gt;
    algos[i] = new extendedFCA(intVal[0], doubleVal[0], doubleVal[1], intVal[1], intVal[2], params-&amp;gt;rng);&lt;br /&gt;
    algos[i]-&amp;gt;initAlgorithm(params-&amp;gt;task);&lt;br /&gt;
    break;&lt;br /&gt;
&lt;br /&gt;
Note that your algorithm can employ the random number generator provided by the Evoptool core, &amp;lt;tt&amp;gt;params-&amp;gt;rng&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
5. Include your headers in core/src/Algorithms.h&lt;br /&gt;
&lt;br /&gt;
6. Document how your algorithm is instantiated in the comments appearing in evoptool-file/exec-scripts/example.xml&lt;br /&gt;
&lt;br /&gt;
   Algorithm  Id    Types    Parameters&lt;br /&gt;
  =====================================================================================================&lt;br /&gt;
    ...&lt;br /&gt;
    FCA       26    &amp;quot;IDDII&amp;quot;  (Pop, PercSelection, LearningRate, MaxCompositionLenght, MaxMonomialOrder)&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
7. Add an instantiation example for your algorithm in evoptool-file/exec-scripts/example.xml&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;algo id=&amp;quot;26&amp;quot; instanceName=&amp;quot;FCA&amp;quot;&amp;gt;  &lt;br /&gt;
    &amp;lt;int&amp;gt;1000&amp;lt;/int&amp;gt;&lt;br /&gt;
    &amp;lt;double&amp;gt;0.5&amp;lt;/double&amp;gt;&lt;br /&gt;
    &amp;lt;double&amp;gt;1&amp;lt;/double&amp;gt;&lt;br /&gt;
    &amp;lt;int&amp;gt;64&amp;lt;/int&amp;gt;&lt;br /&gt;
    &amp;lt;int&amp;gt;2&amp;lt;/int&amp;gt;&lt;br /&gt;
  &amp;lt;/algo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Run an algorithm in a C++ program ====&lt;br /&gt;
&lt;br /&gt;
The simplest way to do this is to create a new submodule in &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;, i.e., a new source directory within the source directory of a module&lt;br /&gt;
For instance, the steps to create a new submodule named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; are&lt;br /&gt;
&lt;br /&gt;
1. copy the example submodule &amp;lt;code&amp;gt;exampleRunAlgorithm&amp;lt;/code&amp;gt; in a new folder named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; in&lt;br /&gt;
&lt;br /&gt;
  evoptool/core/src&lt;br /&gt;
&lt;br /&gt;
2. modify the &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; directory, see comments in the makefile for more details.&lt;br /&gt;
&lt;br /&gt;
3. edit the &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; function in the source file, if you need you can create other C++ and .h files in the same folder.&lt;br /&gt;
&lt;br /&gt;
4. from &amp;lt;code&amp;gt;evoptool/core/src/myexample&amp;lt;/code&amp;gt; run&lt;br /&gt;
&lt;br /&gt;
  make bin&lt;br /&gt;
&lt;br /&gt;
The bin file is create in &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; and copied in &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTICE that &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; may be deleted after a &amp;lt;code&amp;gt;make cleanall&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. from &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt; run &lt;br /&gt;
&lt;br /&gt;
  ./myexample&lt;br /&gt;
&lt;br /&gt;
==== Available statistics  ====&lt;br /&gt;
&lt;br /&gt;
In the configuration xml file you can enable the evaluation of three set of statistics:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;statisticsConfiguration&amp;gt;&lt;br /&gt;
    &amp;lt;evalPopulationStatistics&amp;gt;yes&amp;lt;/evalPopulationStatistics&amp;gt;&lt;br /&gt;
    &amp;lt;evalModelStatistics&amp;gt;yes&amp;lt;/evalModelStatistics&amp;gt;&lt;br /&gt;
    &amp;lt;evalExecutionStatistics&amp;gt;No&amp;lt;/evalExecutionStatistics&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/statisticsConfiguration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the headers file in evoptool/common/src for details.&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14892</id>
		<title>Evoptool: Evolutionary Optimization Tool</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14892"/>
				<updated>2012-04-14T16:40:26Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: /* PPSN2012 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
Evolutionary Optimization Tool (Evoptool) is an open source optimization tool writte in C++, distributed under GNU General Public License. Evoptool implements meta-heuristics based on the Evolutionary Computation paradigm and aims to provide a common platform for the development and test of new algorithms, in order to facilitate the performance comparison activity. Evoptool offers a wide set of benchmark problems, from classical toy samples to more complex tasks, and a collection of algorithm implementations from Genetic Algorithms and Estimation of Distribution Algorithms paradigms. Evoptool is flexible, easy to extend, also with algorithms based on other approaches other from EAs.&lt;br /&gt;
&lt;br /&gt;
== The Evoptool Team ==&lt;br /&gt;
&lt;br /&gt;
*[[User:MatteoMatteucci| Matteo Matteucci]] - matteucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
*[http://www.dei.polimi.it/personale/dettaglio.php?id_persona=829&amp;amp;id_sezione=&amp;amp;lettera=M&amp;amp;idlang=ita| Luigi Malagò] - malago [AT] elet.polimi.it &lt;br /&gt;
&lt;br /&gt;
*[http://iridia.ulb.ac.be/~gvalentini/ Gabriele Valentini] - gvalentini [AT] iridia.ulb.ac.be&lt;br /&gt;
&lt;br /&gt;
*[[User:DavideCucci| Davide Cucci]] - cucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
'''Formerly involved'''&lt;br /&gt;
*Emanuele Corsano&lt;br /&gt;
&lt;br /&gt;
== PPSN 2012 ==&lt;br /&gt;
&lt;br /&gt;
In this section we report the details of the experiments presented in the paper &amp;quot;Variable Transformations in Estimation of Distribution Algorithms&amp;quot;, submitted to PPSN 2012.&lt;br /&gt;
&lt;br /&gt;
The experiments were run using the unstable version of evoptool, which is available trought SVN at &lt;br /&gt;
&lt;br /&gt;
https://svn.ws.dei.polimi.it/evoptool/branches/unstable&lt;br /&gt;
&lt;br /&gt;
The experiments are run in the following way: for each problem, Alternated Bits, Trap3, Trap3 Overlapping and Trep5, a python script is used to generate the Evoptool configuration files. For a given problm size ''n'', we chose a population size, run 24 instances of the test algorithm and check the success ratio. If it below 95%, we increase the population, otherwise we compute from these runs the average number of fitness function evaluations performed before the global optimum appears in the population.&lt;br /&gt;
&lt;br /&gt;
== Mailing List ==&lt;br /&gt;
http://groups.google.com/group/evoptool&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
====Algorithms implemented====&lt;br /&gt;
* Genetic Algorithms&lt;br /&gt;
** SGA&lt;br /&gt;
*Estimation of Distribution Algorithms&lt;br /&gt;
**PBIL, UMDA, cGA, COMIT, BOA, FCA&lt;br /&gt;
* DEUM framework&lt;br /&gt;
**DEUMd, IsingDEUM, DEUM-Chain, DEUM-LDA, DEUM-CE, DEUM-X2, DEUM-JEMP, DEUM-l1, sDEUM&lt;br /&gt;
* Stochastic Gradient Descent&lt;br /&gt;
**SGD, SNGD&lt;br /&gt;
* Other Meta-heuristics&lt;br /&gt;
**Simulated Annealing&lt;br /&gt;
&lt;br /&gt;
References to original papers will be added soon.&lt;br /&gt;
&lt;br /&gt;
====Benchmark functions implemented====&lt;br /&gt;
* OneMax&lt;br /&gt;
* AltBit&lt;br /&gt;
* Trap3&lt;br /&gt;
* Trap5&lt;br /&gt;
* IsingSpinGlass2D (*)&lt;br /&gt;
* IsingSpinGlass3D (*)&lt;br /&gt;
* Max Cut&lt;br /&gt;
&lt;br /&gt;
(*) instances generated and solved with Spin Glass Server. This service is provided by COPhy and M. Jünger's group.&lt;br /&gt;
http://www.informatik.uni-koeln.de/spinglass/&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Developers may also access unstable branch. Contact the evoptool team for more details.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
Follow these steps in order to compile evoptool&lt;br /&gt;
&lt;br /&gt;
1. Download source code from svn&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Refer to trunk for the lastest (stable?) version of evoptool&lt;br /&gt;
&lt;br /&gt;
2. First you need to manually compile the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; package, http://www.stanford.edu/~boyd/l1_logreg/&lt;br /&gt;
whose source are already included in the evoptool repository. In order to do that follow the instrunctions in &lt;br /&gt;
&amp;lt;code&amp;gt;README.evoptool&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
Next, compile &amp;lt;code&amp;gt;&amp;lt;id_dist/code&amp;gt; following the instructions in &amp;lt;code&amp;gt;README.evoptool&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;&amp;lt;id_dist&amp;lt;/code&amp;gt; folder&lt;br /&gt;
&lt;br /&gt;
3. Then you need to compile a module at a time. Each module is included in a different folder. &lt;br /&gt;
To compile a module, from go to the module source folder and do make lib. For instance, for the module named &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  cd common/src&lt;br /&gt;
  make lib&lt;br /&gt;
  cd ..&lt;br /&gt;
&lt;br /&gt;
Compile modules in the following orderm due to dependencies&lt;br /&gt;
&lt;br /&gt;
  common&lt;br /&gt;
  functions&lt;br /&gt;
  ga&lt;br /&gt;
  stochastic&lt;br /&gt;
  eda&lt;br /&gt;
&lt;br /&gt;
To clean a module, do &lt;br /&gt;
&lt;br /&gt;
  make clean&lt;br /&gt;
&lt;br /&gt;
from the module source directory&lt;br /&gt;
&lt;br /&gt;
4. Go to &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;  module and type&lt;br /&gt;
&lt;br /&gt;
  make exe&lt;br /&gt;
&lt;br /&gt;
Binary files will be copied in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root as well as the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory of the &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt; module&lt;br /&gt;
&lt;br /&gt;
'''Required packages'''&lt;br /&gt;
* Libraries&lt;br /&gt;
** ''gtkmm-2.4''&lt;br /&gt;
** ''glademm-2.4''&lt;br /&gt;
** ''gthread-2.0''&lt;br /&gt;
** ''sigc++-2.0''&lt;br /&gt;
** ''opencv'' (see for instance http://www.samontab.com/web/2011/06/installing-opencv-2-2-in-ubuntu-11-04/)&lt;br /&gt;
** ''gsl''&lt;br /&gt;
** ''gslcblas''&lt;br /&gt;
** ''libxml++-2.6''&lt;br /&gt;
** ''f2c''&lt;br /&gt;
&lt;br /&gt;
* Software&lt;br /&gt;
** ''gnuplot''&lt;br /&gt;
**  ''R (lars package)''&lt;br /&gt;
&lt;br /&gt;
== Running  ==&lt;br /&gt;
&lt;br /&gt;
Right now &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; only runs as a script. GUI is not maintained in the latest version.&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; binary file is supposed to be run in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root, this is because right now the script looks for some configuration files, for the instances of the problems, and temp directories. If you want to run the script from other directories, you just need to copy in that directory the &amp;lt;code&amp;gt;evoptool-file&amp;lt;/code&amp;gt; directory that you find in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory. Link such directory instead of copying it is not safe if you run multiple scripts at the same time, since output files will be shared. &lt;br /&gt;
&lt;br /&gt;
To run the algorithm you need to enter as input an xml file. For instance you can run&lt;br /&gt;
&lt;br /&gt;
  ./evoptool evoptool-file/examples/unitTestOneMax.xml&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool-file/example&amp;lt;/code&amp;gt; directory contains a set of xml files for different benchmarks and different algorithms.&lt;br /&gt;
Take a loot at the &amp;lt;code&amp;gt;example.xml&amp;lt;/code&amp;gt; file for the documentation on hoe to set the parameters for an each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; produces a set of files as output. You can find all files in &amp;lt;code&amp;gt;evoptool-file/temp&amp;lt;/code&amp;gt; directory. Plus a tar.gz file containing such files can be produced at the end of the execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. See the xml file for details.&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/data&lt;br /&gt;
contains the raw data of the statistics according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/gnuplot&lt;br /&gt;
contains the gnuplot files to produce images of the statistics&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/image&lt;br /&gt;
contains images of the statistics produced according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/support&lt;br /&gt;
contains logs&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
==== Implement a new benchmark function====&lt;br /&gt;
&lt;br /&gt;
Benchmarks are defined in the &amp;lt;code&amp;gt;function&amp;lt;/code&amp;gt; module. A benchmark is the maximization problem of a real valued function defined over a vector of n binary variables. Functions are maximized in &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. In order to implement a new benchmark function you have to create a new &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt; that inherits from &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt; module. Take a look at the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; benchmark function.&lt;br /&gt;
&lt;br /&gt;
Among the arguments of the constructor of the &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; class there must be the size of the benchmark, which may or may not be a parameter of the new benchmark.&lt;br /&gt;
&lt;br /&gt;
  OneMax::OneMax(int size) : ObjectiveFunction(size)&lt;br /&gt;
&lt;br /&gt;
In the constructor you have whether the maximum of the function is known or not&lt;br /&gt;
&lt;br /&gt;
   _knownSolution = true;&lt;br /&gt;
&lt;br /&gt;
And in case this is known, set the minimum value and maximum value for the function&lt;br /&gt;
&lt;br /&gt;
 _minFitness = 0; &lt;br /&gt;
 _maxFitness = size; //the maximum value of the OneMax function is defined as the sum of the bits of x set to one.&lt;br /&gt;
&lt;br /&gt;
Besides, such values are used in the normalization of the functions in the plots of the statistics.&lt;br /&gt;
&lt;br /&gt;
Each benchmark must implement the &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; method, which takes the &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x and return f(x). For instance, for &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; you have&lt;br /&gt;
&lt;br /&gt;
  double OneMax::f(BinaryString *bi) {&lt;br /&gt;
  &amp;amp;nbsp;if (bi != NULL) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;if(!(bi-&amp;gt;validCache())) { &lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;/* Fitness cache value not valid */&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;int sum = 0;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;for (int j = 0; j &amp;lt; _size; j++) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;sum = sum + bi-&amp;gt;get(j);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;bi-&amp;gt;setFitnessCache(sum);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return sum;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return bi-&amp;gt;getFitnessCache();&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;cerr &amp;lt;&amp;lt; &amp;quot;[OneMax::f] binary instance cannot be null&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;return 0;&lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In order to avoid multiple evaluations of the same &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x, a caching mechanism has been implemented.&lt;br /&gt;
&lt;br /&gt;
Moreover, you are asked to implement the &amp;lt;code&amp;gt;exportInteration&amp;lt;/code&amp;gt; function, which return an &amp;lt;code&amp;gt;HyperGraph&amp;lt;/code&amp;gt; which represents the interactions present in the function. In order to determine such hypergraph, start from the polinomial representation of the function, and for each monomial introduce a new hyperedge in the hypergraph.&lt;br /&gt;
&lt;br /&gt;
For the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; function, such representation corresponds to the independence graph, since such function is linear. &lt;br /&gt;
&lt;br /&gt;
  HyperGraph* OneMax::exportInteractions() {&lt;br /&gt;
  &amp;amp;nbsp;HyperGraph *interactions = new HyperGraph();&lt;br /&gt;
  &amp;amp;nbsp;interactions-&amp;gt;createIndependenceGraph(_size);&lt;br /&gt;
  &amp;amp;nbsp;return interactions;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;Evoptool.h&amp;lt;/code&amp;gt; add an entry in the &amp;lt;code&amp;gt;Tasks&amp;lt;/code&amp;gt; enum.&lt;br /&gt;
&lt;br /&gt;
  /* This enumeration defines an identifier for each task function. */&lt;br /&gt;
  typedef enum {&lt;br /&gt;
  &amp;amp;nbsp;ONE_MAX = 7,&lt;br /&gt;
  } Tasks;&lt;br /&gt;
&lt;br /&gt;
This value will identify uniquely the benchmark in the xml file. In the &amp;lt;code&amp;gt;XMLParser.cpp&amp;lt;/code&amp;gt; file, add an entry for the new function.&lt;br /&gt;
&lt;br /&gt;
  bool XMLParser::parseTask(xmlpp::TextReader &amp;amp;reader, Evoptool::TestParameters *params) {&lt;br /&gt;
  &amp;amp;nbsp;.. &lt;br /&gt;
  &amp;amp;nbsp;switch (task) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;case Evoptool::ONE_MAX: params-&amp;gt;task = new OneMax(size);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;break;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;..&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;default: return false; &lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;..&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Additional parameters can be obtained using the xml TextReader object, as for the &amp;lt;code&amp;gt;ForPeaks&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
  case Evoptool::FOUR_PEAKS: &lt;br /&gt;
  &amp;amp;nbsp;value = readNodeContent(reader, &amp;quot;peaks&amp;quot;, &amp;amp;errorFlag);&lt;br /&gt;
  &amp;amp;nbsp;if (errorFlag) return false;&lt;br /&gt;
  &amp;amp;nbsp;int peaks = toInt(value);&lt;br /&gt;
  &amp;amp;nbsp;params-&amp;gt;task = new FourPeaks(size, peaks);&lt;br /&gt;
  &amp;amp;nbsp;break; &lt;br /&gt;
&lt;br /&gt;
Finally in the xml file, a function can set with the &amp;lt;code&amp;gt;task&amp;lt;/code&amp;gt; tag, together with all parameters.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;task&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;name&amp;gt;7&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;size&amp;gt;64&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;/task&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== To create a new algorithm ====&lt;br /&gt;
&lt;br /&gt;
1. Implement a new algorithm&lt;br /&gt;
&lt;br /&gt;
All algorithms must inherit from the Algorithm class. First override the Algorithm::initAlgorithm as follows:&lt;br /&gt;
&lt;br /&gt;
  void DEUM::initAlgorithm(ObjectiveFunction* of) {&lt;br /&gt;
    Algorithm::initAlgorithm(of);&lt;br /&gt;
  &lt;br /&gt;
    /* Initialization tasks */&lt;br /&gt;
    ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Then implement a run() method which performs al the required task for '''one''' iteration of your algorithm.&lt;br /&gt;
&lt;br /&gt;
There are some classes which contain useful methods such as samplers and estimators from which your algorithm can inherit. The most useful are:&lt;br /&gt;
&lt;br /&gt;
  PopulationBasedAlgorithm&lt;br /&gt;
  ModelBasedAlgorithm&lt;br /&gt;
  ExponentialFamilyAlgorithm&lt;br /&gt;
  BayesianNetworkBasedAlgorithm&lt;br /&gt;
&lt;br /&gt;
2. Append entry in the &amp;lt;tt&amp;gt;Algorithms&amp;lt;/tt&amp;gt; enum in Evoptool.h.&lt;br /&gt;
&lt;br /&gt;
  typedef enum {&lt;br /&gt;
    ...&lt;br /&gt;
    DEUM    // 5&lt;br /&gt;
  } Algorithms;&lt;br /&gt;
&lt;br /&gt;
In the xml configuration file, your algorithm will be characterized by the int value associated with the position in this enum declaration.&lt;br /&gt;
&lt;br /&gt;
3. modify the file&lt;br /&gt;
core/src/XMLParser.cpp. Search for the method &amp;lt;tt&amp;gt;bool XMLParser::parseAlgorithms&amp;lt;/tt&amp;gt; and insert an new entry for your algorithm in the &amp;lt;tt&amp;gt;algorithmParameters&amp;lt;/tt&amp;gt; array, for example&lt;br /&gt;
&lt;br /&gt;
  AlgorithmParameters algorithmParameters[] = {&lt;br /&gt;
    ...&lt;br /&gt;
    { Evoptool::DEUM, 5, (char*) &amp;quot;IDDDI&amp;quot; }, // Pop, percElitism, percSelec, CoolRate, GibbsIterations&lt;br /&gt;
    ...&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
In each entry, the first field is the name of the entry in the &amp;lt;tt&amp;gt;Algorithms&amp;lt;/tt&amp;gt; enum just modified in &amp;lt;tt&amp;gt;Evoptool.h&amp;lt;/tt&amp;gt;, the second is the number of parameters to be parsed in the xml configuration file and the third is a string specifying their type: &amp;lt;tt&amp;gt;I&amp;lt;/tt&amp;gt; for integer and &amp;lt;tt&amp;gt;D&amp;lt;/tt&amp;gt; for double.&lt;br /&gt;
&lt;br /&gt;
4. add a case in the switch that follows in &amp;lt;tt&amp;gt;bool XMLParser::parseAlgorithms&amp;lt;/tt&amp;gt;, for instance:&lt;br /&gt;
&lt;br /&gt;
  case Evoptool::DEUM: &lt;br /&gt;
    algos[i] = new extendedFCA(intVal[0], doubleVal[0], doubleVal[1], intVal[1], intVal[2], params-&amp;gt;rng);&lt;br /&gt;
    algos[i]-&amp;gt;initAlgorithm(params-&amp;gt;task);&lt;br /&gt;
    break;&lt;br /&gt;
&lt;br /&gt;
Note that your algorithm can employ the random number generator provided by the Evoptool core, &amp;lt;tt&amp;gt;params-&amp;gt;rng&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
5. Include your headers in core/src/Algorithms.h&lt;br /&gt;
&lt;br /&gt;
6. Document how your algorithm is instantiated in the comments appearing in evoptool-file/exec-scripts/example.xml&lt;br /&gt;
&lt;br /&gt;
   Algorithm  Id    Types    Parameters&lt;br /&gt;
  =====================================================================================================&lt;br /&gt;
    ...&lt;br /&gt;
    FCA       26    &amp;quot;IDDII&amp;quot;  (Pop, PercSelection, LearningRate, MaxCompositionLenght, MaxMonomialOrder)&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
7. Add an instantiation example for your algorithm in evoptool-file/exec-scripts/example.xml&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;algo id=&amp;quot;26&amp;quot; instanceName=&amp;quot;FCA&amp;quot;&amp;gt;  &lt;br /&gt;
    &amp;lt;int&amp;gt;1000&amp;lt;/int&amp;gt;&lt;br /&gt;
    &amp;lt;double&amp;gt;0.5&amp;lt;/double&amp;gt;&lt;br /&gt;
    &amp;lt;double&amp;gt;1&amp;lt;/double&amp;gt;&lt;br /&gt;
    &amp;lt;int&amp;gt;64&amp;lt;/int&amp;gt;&lt;br /&gt;
    &amp;lt;int&amp;gt;2&amp;lt;/int&amp;gt;&lt;br /&gt;
  &amp;lt;/algo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Run an algorithm in a C++ program ====&lt;br /&gt;
&lt;br /&gt;
The simplest way to do this is to create a new submodule in &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;, i.e., a new source directory within the source directory of a module&lt;br /&gt;
For instance, the steps to create a new submodule named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; are&lt;br /&gt;
&lt;br /&gt;
1. copy the example submodule &amp;lt;code&amp;gt;exampleRunAlgorithm&amp;lt;/code&amp;gt; in a new folder named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; in&lt;br /&gt;
&lt;br /&gt;
  evoptool/core/src&lt;br /&gt;
&lt;br /&gt;
2. modify the &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; directory, see comments in the makefile for more details.&lt;br /&gt;
&lt;br /&gt;
3. edit the &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; function in the source file, if you need you can create other C++ and .h files in the same folder.&lt;br /&gt;
&lt;br /&gt;
4. from &amp;lt;code&amp;gt;evoptool/core/src/myexample&amp;lt;/code&amp;gt; run&lt;br /&gt;
&lt;br /&gt;
  make bin&lt;br /&gt;
&lt;br /&gt;
The bin file is create in &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; and copied in &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTICE that &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; may be deleted after a &amp;lt;code&amp;gt;make cleanall&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. from &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt; run &lt;br /&gt;
&lt;br /&gt;
  ./myexample&lt;br /&gt;
&lt;br /&gt;
==== Available statistics  ====&lt;br /&gt;
&lt;br /&gt;
In the configuration xml file you can enable the evaluation of three set of statistics:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;statisticsConfiguration&amp;gt;&lt;br /&gt;
    &amp;lt;evalPopulationStatistics&amp;gt;yes&amp;lt;/evalPopulationStatistics&amp;gt;&lt;br /&gt;
    &amp;lt;evalModelStatistics&amp;gt;yes&amp;lt;/evalModelStatistics&amp;gt;&lt;br /&gt;
    &amp;lt;evalExecutionStatistics&amp;gt;No&amp;lt;/evalExecutionStatistics&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/statisticsConfiguration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the headers file in evoptool/common/src for details.&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=14891</id>
		<title>User:DavideCucci</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=14891"/>
				<updated>2012-04-14T16:26:44Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Student&lt;br /&gt;
|category=Student&lt;br /&gt;
|firstname=Davide&lt;br /&gt;
|lastname=Cucci&lt;br /&gt;
|photo=3.jpg&lt;br /&gt;
|email=cucci@elet.polimi.it&lt;br /&gt;
|advisor=MatteoMatteucci;&lt;br /&gt;
}}&lt;br /&gt;
== Brief CV ==&lt;br /&gt;
&lt;br /&gt;
Davide Cucci is currently a Ph.D. student in Computer Science and Engineering at Politecnico di Milano.&lt;br /&gt;
His interests range from robotics to machine learning and evolutionary computation.&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=14890</id>
		<title>User:DavideCucci</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=14890"/>
				<updated>2012-04-14T16:26:18Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Student&lt;br /&gt;
|category=Student&lt;br /&gt;
|firstname=Davide&lt;br /&gt;
|lastname=Cucci&lt;br /&gt;
|photo=3.jpg&lt;br /&gt;
|email=cucci@elet.polimi.it&lt;br /&gt;
|advisor=MatteoMatteucci;&lt;br /&gt;
|status=active&lt;br /&gt;
}}&lt;br /&gt;
== Brief CV ==&lt;br /&gt;
&lt;br /&gt;
Davide Cucci is currently a Ph.D. student in Computer Science and Engineering at Politecnico di Milano.&lt;br /&gt;
His interests range from robotics to machine learning and evolutionary computation.&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=14889</id>
		<title>User:DavideCucci</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=14889"/>
				<updated>2012-04-14T16:25:22Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: /* Brief CV */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Student&lt;br /&gt;
|category=Student&lt;br /&gt;
|firstname=Davide&lt;br /&gt;
|lastname=Cucci&lt;br /&gt;
|photo=3.jpg&lt;br /&gt;
|email=davide.cucci@mail.polimi.it&lt;br /&gt;
|advisor=MatteoMatteucci;&lt;br /&gt;
|status=inactive&lt;br /&gt;
}}&lt;br /&gt;
== Brief CV ==&lt;br /&gt;
&lt;br /&gt;
Davide Cucci is currently a Ph.D. student in Computer Science and Engineering at Politecnico di Milano.&lt;br /&gt;
His interests range from robotics to machine learning and evolutionary computation.&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=14888</id>
		<title>User:DavideCucci</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=14888"/>
				<updated>2012-04-14T16:25:08Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: /* Brief CV */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Student&lt;br /&gt;
|category=Student&lt;br /&gt;
|firstname=Davide&lt;br /&gt;
|lastname=Cucci&lt;br /&gt;
|photo=3.jpg&lt;br /&gt;
|email=davide.cucci@mail.polimi.it&lt;br /&gt;
|advisor=MatteoMatteucci;&lt;br /&gt;
|status=inactive&lt;br /&gt;
}}&lt;br /&gt;
== Brief CV ==&lt;br /&gt;
&lt;br /&gt;
Davide Cucci is currently a Ph.D. student in Computer Science and Engineering at Politecnico di Milano since 2011.&lt;br /&gt;
His interests range from robotics to machine learning and evolutionary computation.&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14887</id>
		<title>Evoptool: Evolutionary Optimization Tool</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14887"/>
				<updated>2012-04-14T16:16:48Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
Evolutionary Optimization Tool (Evoptool) is an open source optimization tool writte in C++, distributed under GNU General Public License. Evoptool implements meta-heuristics based on the Evolutionary Computation paradigm and aims to provide a common platform for the development and test of new algorithms, in order to facilitate the performance comparison activity. Evoptool offers a wide set of benchmark problems, from classical toy samples to more complex tasks, and a collection of algorithm implementations from Genetic Algorithms and Estimation of Distribution Algorithms paradigms. Evoptool is flexible, easy to extend, also with algorithms based on other approaches other from EAs.&lt;br /&gt;
&lt;br /&gt;
== The Evoptool Team ==&lt;br /&gt;
&lt;br /&gt;
*[[User:MatteoMatteucci| Matteo Matteucci]] - matteucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
*[http://www.dei.polimi.it/personale/dettaglio.php?id_persona=829&amp;amp;id_sezione=&amp;amp;lettera=M&amp;amp;idlang=ita| Luigi Malagò] - malago [AT] elet.polimi.it &lt;br /&gt;
&lt;br /&gt;
*[http://iridia.ulb.ac.be/~gvalentini/ Gabriele Valentini] - gvalentini [AT] iridia.ulb.ac.be&lt;br /&gt;
&lt;br /&gt;
*[[User:DavideCucci| Davide Cucci]] - cucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
'''Formerly involved'''&lt;br /&gt;
*Emanuele Corsano&lt;br /&gt;
&lt;br /&gt;
== PPSN2012 ==&lt;br /&gt;
&lt;br /&gt;
Online soon...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mailing List ==&lt;br /&gt;
http://groups.google.com/group/evoptool&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
====Algorithms implemented====&lt;br /&gt;
* Genetic Algorithms&lt;br /&gt;
** SGA&lt;br /&gt;
*Estimation of Distribution Algorithms&lt;br /&gt;
**PBIL, UMDA, cGA, COMIT, BOA, FCA&lt;br /&gt;
* DEUM framework&lt;br /&gt;
**DEUMd, IsingDEUM, DEUM-Chain, DEUM-LDA, DEUM-CE, DEUM-X2, DEUM-JEMP, DEUM-l1, sDEUM&lt;br /&gt;
* Stochastic Gradient Descent&lt;br /&gt;
**SGD, SNGD&lt;br /&gt;
* Other Meta-heuristics&lt;br /&gt;
**Simulated Annealing&lt;br /&gt;
&lt;br /&gt;
References to original papers will be added soon.&lt;br /&gt;
&lt;br /&gt;
====Benchmark functions implemented====&lt;br /&gt;
* OneMax&lt;br /&gt;
* AltBit&lt;br /&gt;
* Trap3&lt;br /&gt;
* Trap5&lt;br /&gt;
* IsingSpinGlass2D (*)&lt;br /&gt;
* IsingSpinGlass3D (*)&lt;br /&gt;
* Max Cut&lt;br /&gt;
&lt;br /&gt;
(*) instances generated and solved with Spin Glass Server. This service is provided by COPhy and M. Jünger's group.&lt;br /&gt;
http://www.informatik.uni-koeln.de/spinglass/&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Developers may also access unstable branch. Contact the evoptool team for more details.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
Follow these steps in order to compile evoptool&lt;br /&gt;
&lt;br /&gt;
1. Download source code from svn&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Refer to trunk for the lastest (stable?) version of evoptool&lt;br /&gt;
&lt;br /&gt;
2. First you need to manually compile the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; package, http://www.stanford.edu/~boyd/l1_logreg/&lt;br /&gt;
whose source are already included in the evoptool repository. In order to do that follow the instrunctions in &lt;br /&gt;
&amp;lt;code&amp;gt;README.evoptool&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
Next, compile &amp;lt;code&amp;gt;&amp;lt;id_dist/code&amp;gt; following the instructions in &amp;lt;code&amp;gt;README.evoptool&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;&amp;lt;id_dist&amp;lt;/code&amp;gt; folder&lt;br /&gt;
&lt;br /&gt;
3. Then you need to compile a module at a time. Each module is included in a different folder. &lt;br /&gt;
To compile a module, from go to the module source folder and do make lib. For instance, for the module named &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  cd common/src&lt;br /&gt;
  make lib&lt;br /&gt;
  cd ..&lt;br /&gt;
&lt;br /&gt;
Compile modules in the following orderm due to dependencies&lt;br /&gt;
&lt;br /&gt;
  common&lt;br /&gt;
  functions&lt;br /&gt;
  ga&lt;br /&gt;
  stochastic&lt;br /&gt;
  eda&lt;br /&gt;
&lt;br /&gt;
To clean a module, do &lt;br /&gt;
&lt;br /&gt;
  make clean&lt;br /&gt;
&lt;br /&gt;
from the module source directory&lt;br /&gt;
&lt;br /&gt;
4. Go to &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;  module and type&lt;br /&gt;
&lt;br /&gt;
  make exe&lt;br /&gt;
&lt;br /&gt;
Binary files will be copied in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root as well as the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory of the &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt; module&lt;br /&gt;
&lt;br /&gt;
'''Required packages'''&lt;br /&gt;
* Libraries&lt;br /&gt;
** ''gtkmm-2.4''&lt;br /&gt;
** ''glademm-2.4''&lt;br /&gt;
** ''gthread-2.0''&lt;br /&gt;
** ''sigc++-2.0''&lt;br /&gt;
** ''opencv'' (see for instance http://www.samontab.com/web/2011/06/installing-opencv-2-2-in-ubuntu-11-04/)&lt;br /&gt;
** ''gsl''&lt;br /&gt;
** ''gslcblas''&lt;br /&gt;
** ''libxml++-2.6''&lt;br /&gt;
** ''f2c''&lt;br /&gt;
&lt;br /&gt;
* Software&lt;br /&gt;
** ''gnuplot''&lt;br /&gt;
**  ''R (lars package)''&lt;br /&gt;
&lt;br /&gt;
== Running  ==&lt;br /&gt;
&lt;br /&gt;
Right now &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; only runs as a script. GUI is not maintained in the latest version.&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; binary file is supposed to be run in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root, this is because right now the script looks for some configuration files, for the instances of the problems, and temp directories. If you want to run the script from other directories, you just need to copy in that directory the &amp;lt;code&amp;gt;evoptool-file&amp;lt;/code&amp;gt; directory that you find in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory. Link such directory instead of copying it is not safe if you run multiple scripts at the same time, since output files will be shared. &lt;br /&gt;
&lt;br /&gt;
To run the algorithm you need to enter as input an xml file. For instance you can run&lt;br /&gt;
&lt;br /&gt;
  ./evoptool evoptool-file/examples/unitTestOneMax.xml&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool-file/example&amp;lt;/code&amp;gt; directory contains a set of xml files for different benchmarks and different algorithms.&lt;br /&gt;
Take a loot at the &amp;lt;code&amp;gt;example.xml&amp;lt;/code&amp;gt; file for the documentation on hoe to set the parameters for an each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; produces a set of files as output. You can find all files in &amp;lt;code&amp;gt;evoptool-file/temp&amp;lt;/code&amp;gt; directory. Plus a tar.gz file containing such files can be produced at the end of the execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. See the xml file for details.&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/data&lt;br /&gt;
contains the raw data of the statistics according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/gnuplot&lt;br /&gt;
contains the gnuplot files to produce images of the statistics&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/image&lt;br /&gt;
contains images of the statistics produced according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/support&lt;br /&gt;
contains logs&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
==== Implement a new benchmark function====&lt;br /&gt;
&lt;br /&gt;
Benchmarks are defined in the &amp;lt;code&amp;gt;function&amp;lt;/code&amp;gt; module. A benchmark is the maximization problem of a real valued function defined over a vector of n binary variables. Functions are maximized in &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. In order to implement a new benchmark function you have to create a new &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt; that inherits from &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt; module. Take a look at the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; benchmark function.&lt;br /&gt;
&lt;br /&gt;
Among the arguments of the constructor of the &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; class there must be the size of the benchmark, which may or may not be a parameter of the new benchmark.&lt;br /&gt;
&lt;br /&gt;
  OneMax::OneMax(int size) : ObjectiveFunction(size)&lt;br /&gt;
&lt;br /&gt;
In the constructor you have whether the maximum of the function is known or not&lt;br /&gt;
&lt;br /&gt;
   _knownSolution = true;&lt;br /&gt;
&lt;br /&gt;
And in case this is known, set the minimum value and maximum value for the function&lt;br /&gt;
&lt;br /&gt;
 _minFitness = 0; &lt;br /&gt;
 _maxFitness = size; //the maximum value of the OneMax function is defined as the sum of the bits of x set to one.&lt;br /&gt;
&lt;br /&gt;
Besides, such values are used in the normalization of the functions in the plots of the statistics.&lt;br /&gt;
&lt;br /&gt;
Each benchmark must implement the &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; method, which takes the &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x and return f(x). For instance, for &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; you have&lt;br /&gt;
&lt;br /&gt;
  double OneMax::f(BinaryString *bi) {&lt;br /&gt;
  &amp;amp;nbsp;if (bi != NULL) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;if(!(bi-&amp;gt;validCache())) { &lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;/* Fitness cache value not valid */&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;int sum = 0;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;for (int j = 0; j &amp;lt; _size; j++) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;sum = sum + bi-&amp;gt;get(j);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;bi-&amp;gt;setFitnessCache(sum);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return sum;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return bi-&amp;gt;getFitnessCache();&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;cerr &amp;lt;&amp;lt; &amp;quot;[OneMax::f] binary instance cannot be null&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;return 0;&lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In order to avoid multiple evaluations of the same &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x, a caching mechanism has been implemented.&lt;br /&gt;
&lt;br /&gt;
Moreover, you are asked to implement the &amp;lt;code&amp;gt;exportInteration&amp;lt;/code&amp;gt; function, which return an &amp;lt;code&amp;gt;HyperGraph&amp;lt;/code&amp;gt; which represents the interactions present in the function. In order to determine such hypergraph, start from the polinomial representation of the function, and for each monomial introduce a new hyperedge in the hypergraph.&lt;br /&gt;
&lt;br /&gt;
For the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; function, such representation corresponds to the independence graph, since such function is linear. &lt;br /&gt;
&lt;br /&gt;
  HyperGraph* OneMax::exportInteractions() {&lt;br /&gt;
  &amp;amp;nbsp;HyperGraph *interactions = new HyperGraph();&lt;br /&gt;
  &amp;amp;nbsp;interactions-&amp;gt;createIndependenceGraph(_size);&lt;br /&gt;
  &amp;amp;nbsp;return interactions;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;Evoptool.h&amp;lt;/code&amp;gt; add an entry in the &amp;lt;code&amp;gt;Tasks&amp;lt;/code&amp;gt; enum.&lt;br /&gt;
&lt;br /&gt;
  /* This enumeration defines an identifier for each task function. */&lt;br /&gt;
  typedef enum {&lt;br /&gt;
  &amp;amp;nbsp;ONE_MAX = 7,&lt;br /&gt;
  } Tasks;&lt;br /&gt;
&lt;br /&gt;
This value will identify uniquely the benchmark in the xml file. In the &amp;lt;code&amp;gt;XMLParser.cpp&amp;lt;/code&amp;gt; file, add an entry for the new function.&lt;br /&gt;
&lt;br /&gt;
  bool XMLParser::parseTask(xmlpp::TextReader &amp;amp;reader, Evoptool::TestParameters *params) {&lt;br /&gt;
  &amp;amp;nbsp;.. &lt;br /&gt;
  &amp;amp;nbsp;switch (task) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;case Evoptool::ONE_MAX: params-&amp;gt;task = new OneMax(size);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;break;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;..&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;default: return false; &lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;..&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Additional parameters can be obtained using the xml TextReader object, as for the &amp;lt;code&amp;gt;ForPeaks&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
  case Evoptool::FOUR_PEAKS: &lt;br /&gt;
  &amp;amp;nbsp;value = readNodeContent(reader, &amp;quot;peaks&amp;quot;, &amp;amp;errorFlag);&lt;br /&gt;
  &amp;amp;nbsp;if (errorFlag) return false;&lt;br /&gt;
  &amp;amp;nbsp;int peaks = toInt(value);&lt;br /&gt;
  &amp;amp;nbsp;params-&amp;gt;task = new FourPeaks(size, peaks);&lt;br /&gt;
  &amp;amp;nbsp;break; &lt;br /&gt;
&lt;br /&gt;
Finally in the xml file, a function can set with the &amp;lt;code&amp;gt;task&amp;lt;/code&amp;gt; tag, together with all parameters.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;task&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;name&amp;gt;7&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;size&amp;gt;64&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;/task&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== To create a new algorithm ====&lt;br /&gt;
&lt;br /&gt;
1. Implement a new algorithm&lt;br /&gt;
&lt;br /&gt;
All algorithms must inherit from the Algorithm class. First override the Algorithm::initAlgorithm as follows:&lt;br /&gt;
&lt;br /&gt;
  void DEUM::initAlgorithm(ObjectiveFunction* of) {&lt;br /&gt;
    Algorithm::initAlgorithm(of);&lt;br /&gt;
  &lt;br /&gt;
    /* Initialization tasks */&lt;br /&gt;
    ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Then implement a run() method which performs al the required task for '''one''' iteration of your algorithm.&lt;br /&gt;
&lt;br /&gt;
There are some classes which contain useful methods such as samplers and estimators from which your algorithm can inherit. The most useful are:&lt;br /&gt;
&lt;br /&gt;
  PopulationBasedAlgorithm&lt;br /&gt;
  ModelBasedAlgorithm&lt;br /&gt;
  ExponentialFamilyAlgorithm&lt;br /&gt;
  BayesianNetworkBasedAlgorithm&lt;br /&gt;
&lt;br /&gt;
2. Append entry in the &amp;lt;tt&amp;gt;Algorithms&amp;lt;/tt&amp;gt; enum in Evoptool.h.&lt;br /&gt;
&lt;br /&gt;
  typedef enum {&lt;br /&gt;
    ...&lt;br /&gt;
    DEUM    // 5&lt;br /&gt;
  } Algorithms;&lt;br /&gt;
&lt;br /&gt;
In the xml configuration file, your algorithm will be characterized by the int value associated with the position in this enum declaration.&lt;br /&gt;
&lt;br /&gt;
3. modify the file&lt;br /&gt;
core/src/XMLParser.cpp. Search for the method &amp;lt;tt&amp;gt;bool XMLParser::parseAlgorithms&amp;lt;/tt&amp;gt; and insert an new entry for your algorithm in the &amp;lt;tt&amp;gt;algorithmParameters&amp;lt;/tt&amp;gt; array, for example&lt;br /&gt;
&lt;br /&gt;
  AlgorithmParameters algorithmParameters[] = {&lt;br /&gt;
    ...&lt;br /&gt;
    { Evoptool::DEUM, 5, (char*) &amp;quot;IDDDI&amp;quot; }, // Pop, percElitism, percSelec, CoolRate, GibbsIterations&lt;br /&gt;
    ...&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
In each entry, the first field is the name of the entry in the &amp;lt;tt&amp;gt;Algorithms&amp;lt;/tt&amp;gt; enum just modified in &amp;lt;tt&amp;gt;Evoptool.h&amp;lt;/tt&amp;gt;, the second is the number of parameters to be parsed in the xml configuration file and the third is a string specifying their type: &amp;lt;tt&amp;gt;I&amp;lt;/tt&amp;gt; for integer and &amp;lt;tt&amp;gt;D&amp;lt;/tt&amp;gt; for double.&lt;br /&gt;
&lt;br /&gt;
4. add a case in the switch that follows in &amp;lt;tt&amp;gt;bool XMLParser::parseAlgorithms&amp;lt;/tt&amp;gt;, for instance:&lt;br /&gt;
&lt;br /&gt;
  case Evoptool::DEUM: &lt;br /&gt;
    algos[i] = new extendedFCA(intVal[0], doubleVal[0], doubleVal[1], intVal[1], intVal[2], params-&amp;gt;rng);&lt;br /&gt;
    algos[i]-&amp;gt;initAlgorithm(params-&amp;gt;task);&lt;br /&gt;
    break;&lt;br /&gt;
&lt;br /&gt;
Note that your algorithm can employ the random number generator provided by the Evoptool core, &amp;lt;tt&amp;gt;params-&amp;gt;rng&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
5. Include your headers in core/src/Algorithms.h&lt;br /&gt;
&lt;br /&gt;
6. Document how your algorithm is instantiated in the comments appearing in evoptool-file/exec-scripts/example.xml&lt;br /&gt;
&lt;br /&gt;
   Algorithm  Id    Types    Parameters&lt;br /&gt;
  =====================================================================================================&lt;br /&gt;
    ...&lt;br /&gt;
    FCA       26    &amp;quot;IDDII&amp;quot;  (Pop, PercSelection, LearningRate, MaxCompositionLenght, MaxMonomialOrder)&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
7. Add an instantiation example for your algorithm in evoptool-file/exec-scripts/example.xml&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;algo id=&amp;quot;26&amp;quot; instanceName=&amp;quot;FCA&amp;quot;&amp;gt;  &lt;br /&gt;
    &amp;lt;int&amp;gt;1000&amp;lt;/int&amp;gt;&lt;br /&gt;
    &amp;lt;double&amp;gt;0.5&amp;lt;/double&amp;gt;&lt;br /&gt;
    &amp;lt;double&amp;gt;1&amp;lt;/double&amp;gt;&lt;br /&gt;
    &amp;lt;int&amp;gt;64&amp;lt;/int&amp;gt;&lt;br /&gt;
    &amp;lt;int&amp;gt;2&amp;lt;/int&amp;gt;&lt;br /&gt;
  &amp;lt;/algo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Run an algorithm in a C++ program ====&lt;br /&gt;
&lt;br /&gt;
The simplest way to do this is to create a new submodule in &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;, i.e., a new source directory within the source directory of a module&lt;br /&gt;
For instance, the steps to create a new submodule named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; are&lt;br /&gt;
&lt;br /&gt;
1. copy the example submodule &amp;lt;code&amp;gt;exampleRunAlgorithm&amp;lt;/code&amp;gt; in a new folder named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; in&lt;br /&gt;
&lt;br /&gt;
  evoptool/core/src&lt;br /&gt;
&lt;br /&gt;
2. modify the &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; directory, see comments in the makefile for more details.&lt;br /&gt;
&lt;br /&gt;
3. edit the &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; function in the source file, if you need you can create other C++ and .h files in the same folder.&lt;br /&gt;
&lt;br /&gt;
4. from &amp;lt;code&amp;gt;evoptool/core/src/myexample&amp;lt;/code&amp;gt; run&lt;br /&gt;
&lt;br /&gt;
  make bin&lt;br /&gt;
&lt;br /&gt;
The bin file is create in &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; and copied in &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTICE that &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; may be deleted after a &amp;lt;code&amp;gt;make cleanall&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. from &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt; run &lt;br /&gt;
&lt;br /&gt;
  ./myexample&lt;br /&gt;
&lt;br /&gt;
==== Available statistics  ====&lt;br /&gt;
&lt;br /&gt;
In the configuration xml file you can enable the evaluation of three set of statistics:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;statisticsConfiguration&amp;gt;&lt;br /&gt;
    &amp;lt;evalPopulationStatistics&amp;gt;yes&amp;lt;/evalPopulationStatistics&amp;gt;&lt;br /&gt;
    &amp;lt;evalModelStatistics&amp;gt;yes&amp;lt;/evalModelStatistics&amp;gt;&lt;br /&gt;
    &amp;lt;evalExecutionStatistics&amp;gt;No&amp;lt;/evalExecutionStatistics&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/statisticsConfiguration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the headers file in evoptool/common/src for details.&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14176</id>
		<title>Evoptool: Evolutionary Optimization Tool</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14176"/>
				<updated>2011-10-24T13:25:41Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: /* Available statistics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
Evolutionary Optimization Tool (Evoptool) is an open source optimization tool writte in C++, distributed under GNU General Public License. Evoptool implements meta-heuristics based on the Evolutionary Computation paradigm and aims to provide a common platform for the development and test of new algorithms, in order to facilitate the performance comparison activity. Evoptool offers a wide set of benchmark problems, from classical toy samples to more complex tasks, and a collection of algorithm implementations from Genetic Algorithms and Estimation of Distribution Algorithms paradigms. Evoptool is flexible, easy to extend, also with algorithms based on other approaches other from EAs.&lt;br /&gt;
&lt;br /&gt;
== The Evoptool Team ==&lt;br /&gt;
&lt;br /&gt;
*[[User:MatteoMatteucci| Matteo Matteucci]] - matteucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
*[http://www.dei.polimi.it/personale/dettaglio.php?id_persona=829&amp;amp;id_sezione=&amp;amp;lettera=M&amp;amp;idlang=ita| Luigi Malagò] - malago [AT] elet.polimi.it &lt;br /&gt;
&lt;br /&gt;
*[[User:GabrieleValentini| Gabriele Valentini]] - gvalentini [AT] iridia.ulb.ac.be&lt;br /&gt;
&lt;br /&gt;
*[[User:DavideCucci| Davide Cucci]] - cucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
'''Formerly involved'''&lt;br /&gt;
*Emanuele Corsano&lt;br /&gt;
&lt;br /&gt;
== Mailing List ==&lt;br /&gt;
http://groups.google.com/group/evoptool&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
====Algorithms implemented====&lt;br /&gt;
* Genetic Algorithms&lt;br /&gt;
** SGA&lt;br /&gt;
*Estimation of Distribution Algorithms&lt;br /&gt;
**PBIL, UMDA, cGA, COMIT, BOA, FCA&lt;br /&gt;
* DEUM framework&lt;br /&gt;
**DEUMd, IsingDEUM, DEUM-Chain, DEUM-LDA, DEUM-CE, DEUM-X2, DEUM-JEMP, DEUM-l1, sDEUM&lt;br /&gt;
* Stochastic Gradient Descent&lt;br /&gt;
**SGD, SNGD&lt;br /&gt;
* Other Meta-heuristics&lt;br /&gt;
**Simulated Annealing&lt;br /&gt;
&lt;br /&gt;
References to original papers will be added soon.&lt;br /&gt;
&lt;br /&gt;
====Benchmark functions implemented====&lt;br /&gt;
* OneMax&lt;br /&gt;
* AltBit&lt;br /&gt;
* Trap3&lt;br /&gt;
* Trap5&lt;br /&gt;
* IsingSpinGlass2D&lt;br /&gt;
* IsingSpinGlass3D&lt;br /&gt;
* Max Cut&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Developers may also access unstable branch. Contact the evoptool team for more details.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
Follow these steps in order to compile evoptool&lt;br /&gt;
&lt;br /&gt;
1. Download source code from svn&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Refer to trunk for the lastest (stable?) version of evoptool&lt;br /&gt;
&lt;br /&gt;
2. First you need to manually compile the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; package, http://www.stanford.edu/~boyd/l1_logreg/&lt;br /&gt;
whose source are already included in the evoptool repository. In order to do that follow the instrunctions in &lt;br /&gt;
&amp;lt;code&amp;gt;README.evoptool&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
Next, compile &amp;lt;code&amp;gt;&amp;lt;id_dist/code&amp;gt; following the instructions in &amp;lt;code&amp;gt;README.evoptool&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;&amp;lt;id_dist&amp;lt;/code&amp;gt; folder&lt;br /&gt;
&lt;br /&gt;
3. Then you need to compile a module at a time. Each module is included in a different folder. &lt;br /&gt;
To compile a module, from go to the module source folder and do make lib. For instance, for the module named &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  cd common/src&lt;br /&gt;
  make lib&lt;br /&gt;
  cd ..&lt;br /&gt;
&lt;br /&gt;
Compile modules in the following orderm due to dependencies&lt;br /&gt;
&lt;br /&gt;
  common&lt;br /&gt;
  functions&lt;br /&gt;
  ga&lt;br /&gt;
  stochastic&lt;br /&gt;
  eda&lt;br /&gt;
&lt;br /&gt;
To clean a module, do &lt;br /&gt;
&lt;br /&gt;
  make clean&lt;br /&gt;
&lt;br /&gt;
from the module source directory&lt;br /&gt;
&lt;br /&gt;
4. Go to &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;  module and type&lt;br /&gt;
&lt;br /&gt;
  make exe&lt;br /&gt;
&lt;br /&gt;
Binary files will be copied in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root as well as the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory of the &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt; module&lt;br /&gt;
&lt;br /&gt;
'''Required packages'''&lt;br /&gt;
* Libraries&lt;br /&gt;
** ''gtkmm-2.4''&lt;br /&gt;
** ''glademm-2.4''&lt;br /&gt;
** ''gthread-2.0''&lt;br /&gt;
** ''sigc++-2.0''&lt;br /&gt;
** ''opencv'' (see for instance http://www.samontab.com/web/2011/06/installing-opencv-2-2-in-ubuntu-11-04/)&lt;br /&gt;
** ''gsl''&lt;br /&gt;
** ''gslcblas''&lt;br /&gt;
** ''libxml++-2.6''&lt;br /&gt;
** '''f2c''&lt;br /&gt;
&lt;br /&gt;
* Software&lt;br /&gt;
** ''gnuplot''&lt;br /&gt;
&lt;br /&gt;
== Running  ==&lt;br /&gt;
&lt;br /&gt;
Right now &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; only runs as a script. GUI is not maintained in the latest version.&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; binary file is supposed to be run in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root, this is because right now the script looks for some configuration files, for the instances of the problems, and temp directories. If you want to run the script from other directories, you just need to copy in that directory the &amp;lt;code&amp;gt;evoptool-file&amp;lt;/code&amp;gt; directory that you find in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory. Link such directory instead of copying it is not safe if you run multiple scripts at the same time, since output files will be shared. &lt;br /&gt;
&lt;br /&gt;
To run the algorithm you need to enter as input an xml file. For instance you can run&lt;br /&gt;
&lt;br /&gt;
  ./evoptool evoptool-file/examples/unitTestOneMax.xml&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool-file/example&amp;lt;/code&amp;gt; directory contains a set of xml files for different benchmarks and different algorithms.&lt;br /&gt;
Take a loot at the &amp;lt;code&amp;gt;example.xml&amp;lt;/code&amp;gt; file for the documentation on hoe to set the parameters for an each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; produces a set of files as output. You can find all files in &amp;lt;code&amp;gt;evoptool-file/temp&amp;lt;/code&amp;gt; directory. Plus a tar.gz file containing such files can be produced at the end of the execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. See the xml file for details.&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/data&lt;br /&gt;
contains the raw data of the statistics according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/gnuplot&lt;br /&gt;
contains the gnuplot files to produce images of the statistics&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/image&lt;br /&gt;
contains images of the statistics produced according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/support&lt;br /&gt;
contains logs&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
==== Implement a new benchmark function====&lt;br /&gt;
&lt;br /&gt;
Benchmarks are defined in the &amp;lt;code&amp;gt;function&amp;lt;/code&amp;gt; module. A benchmark is the maximization problem of a real valued function defined over a vector of n binary variables. Functions are maximized in &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. In order to implement a new benchmark function you have to create a new &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt; that inherits from &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt; module. Take a look at the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; benchmark function.&lt;br /&gt;
&lt;br /&gt;
Among the arguments of the constructor of the &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; class there must be the size of the benchmark, which may or may not be a parameter of the new benchmark.&lt;br /&gt;
&lt;br /&gt;
  OneMax::OneMax(int size) : ObjectiveFunction(size)&lt;br /&gt;
&lt;br /&gt;
In the constructor you have whether the maximum of the function is known or not&lt;br /&gt;
&lt;br /&gt;
   _knownSolution = true;&lt;br /&gt;
&lt;br /&gt;
And in case this is known, set the minimum value and maximum value for the function&lt;br /&gt;
&lt;br /&gt;
 _minFitness = 0; &lt;br /&gt;
 _maxFitness = size; //the maximum value of the OneMax function is defined as the sum of the bits of x set to one.&lt;br /&gt;
&lt;br /&gt;
Besides, such values are used in the normalization of the functions in the plots of the statistics.&lt;br /&gt;
&lt;br /&gt;
Each benchmark must implement the &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; method, which takes the &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x and return f(x). For instance, for &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; you have&lt;br /&gt;
&lt;br /&gt;
  double OneMax::f(BinaryString *bi) {&lt;br /&gt;
  &amp;amp;nbsp;if (bi != NULL) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;if(!(bi-&amp;gt;validCache())) { &lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;/* Fitness cache value not valid */&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;int sum = 0;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;for (int j = 0; j &amp;lt; _size; j++) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;sum = sum + bi-&amp;gt;get(j);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;bi-&amp;gt;setFitnessCache(sum);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return sum;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return bi-&amp;gt;getFitnessCache();&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;cerr &amp;lt;&amp;lt; &amp;quot;[OneMax::f] binary instance cannot be null&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;return 0;&lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In order to avoid multiple evaluations of the same &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x, a caching mechanism has been implemented.&lt;br /&gt;
&lt;br /&gt;
Moreover, you are asked to implement the &amp;lt;code&amp;gt;exportInteration&amp;lt;/code&amp;gt; function, which return an &amp;lt;code&amp;gt;HyperGraph&amp;lt;/code&amp;gt; which represents the interactions present in the function. In order to determine such hypergraph, start from the polinomial representation of the function, and for each monomial introduce a new hyperedge in the hypergraph.&lt;br /&gt;
&lt;br /&gt;
For the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; function, such representation corresponds to the independence graph, since such function is linear. &lt;br /&gt;
&lt;br /&gt;
  HyperGraph* OneMax::exportInteractions() {&lt;br /&gt;
  &amp;amp;nbsp;HyperGraph *interactions = new HyperGraph();&lt;br /&gt;
  &amp;amp;nbsp;interactions-&amp;gt;createIndependenceGraph(_size);&lt;br /&gt;
  &amp;amp;nbsp;return interactions;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;Evoptool.h&amp;lt;/code&amp;gt; add an entry in the &amp;lt;code&amp;gt;Tasks&amp;lt;/code&amp;gt; enum.&lt;br /&gt;
&lt;br /&gt;
  /* This enumeration defines an identifier for each task function. */&lt;br /&gt;
  typedef enum {&lt;br /&gt;
  &amp;amp;nbsp;ONE_MAX = 7,&lt;br /&gt;
  } Tasks;&lt;br /&gt;
&lt;br /&gt;
This value will identify uniquely the benchmark in the xml file. In the &amp;lt;code&amp;gt;XMLParser.cpp&amp;lt;/code&amp;gt; file, add an entry for the new function.&lt;br /&gt;
&lt;br /&gt;
  bool XMLParser::parseTask(xmlpp::TextReader &amp;amp;reader, Evoptool::TestParameters *params) {&lt;br /&gt;
  &amp;amp;nbsp;.. &lt;br /&gt;
  &amp;amp;nbsp;switch (task) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;case Evoptool::ONE_MAX: params-&amp;gt;task = new OneMax(size);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;break;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;..&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;default: return false; &lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;..&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Additional parameters can be obtained using the xml TextReader object, as for the &amp;lt;code&amp;gt;ForPeaks&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
  case Evoptool::FOUR_PEAKS: &lt;br /&gt;
  &amp;amp;nbsp;value = readNodeContent(reader, &amp;quot;peaks&amp;quot;, &amp;amp;errorFlag);&lt;br /&gt;
  &amp;amp;nbsp;if (errorFlag) return false;&lt;br /&gt;
  &amp;amp;nbsp;int peaks = toInt(value);&lt;br /&gt;
  &amp;amp;nbsp;params-&amp;gt;task = new FourPeaks(size, peaks);&lt;br /&gt;
  &amp;amp;nbsp;break; &lt;br /&gt;
&lt;br /&gt;
Finally in the xml file, a function can set with the &amp;lt;code&amp;gt;task&amp;lt;/code&amp;gt; tag, together with all parameters.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;task&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;name&amp;gt;7&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;size&amp;gt;64&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;/task&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== To create a new algorithm ====&lt;br /&gt;
&lt;br /&gt;
1. Implement a new algorithm&lt;br /&gt;
&lt;br /&gt;
All algorithms must inherit from the Algorithm class. First override the Algorithm::initAlgorithm as follows:&lt;br /&gt;
&lt;br /&gt;
  void DEUM::initAlgorithm(ObjectiveFunction* of) {&lt;br /&gt;
    Algorithm::initAlgorithm(of);&lt;br /&gt;
  &lt;br /&gt;
    /* Initialization tasks */&lt;br /&gt;
    ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Then implement a run() method which performs al the required task for '''one''' iteration of your algorithm.&lt;br /&gt;
&lt;br /&gt;
There are some classes which contain useful methods such as samplers and estimators from which your algorithm can inherit. The most useful are:&lt;br /&gt;
&lt;br /&gt;
  PopulationBasedAlgorithm&lt;br /&gt;
  ModelBasedAlgorithm&lt;br /&gt;
  ExponentialFamilyAlgorithm&lt;br /&gt;
  BayesianNetworkBasedAlgorithm&lt;br /&gt;
&lt;br /&gt;
2. Append entry in the &amp;lt;tt&amp;gt;Algorithms&amp;lt;/tt&amp;gt; enum in Evoptool.h.&lt;br /&gt;
&lt;br /&gt;
  typedef enum {&lt;br /&gt;
    ...&lt;br /&gt;
    DEUM    // 5&lt;br /&gt;
  } Algorithms;&lt;br /&gt;
&lt;br /&gt;
In the xml configuration file, your algorithm will be characterized by the int value associated with the position in this enum declaration.&lt;br /&gt;
&lt;br /&gt;
3. modify the file&lt;br /&gt;
core/src/XMLParser.cpp. Search for the method &amp;lt;tt&amp;gt;bool XMLParser::parseAlgorithms&amp;lt;/tt&amp;gt; and insert an new entry for your algorithm in the &amp;lt;tt&amp;gt;algorithmParameters&amp;lt;/tt&amp;gt; array, for example&lt;br /&gt;
&lt;br /&gt;
  AlgorithmParameters algorithmParameters[] = {&lt;br /&gt;
    ...&lt;br /&gt;
    { Evoptool::DEUM, 5, (char*) &amp;quot;IDDDI&amp;quot; }, // Pop, percElitism, percSelec, CoolRate, GibbsIterations&lt;br /&gt;
    ...&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
In each entry, the first field is the name of the entry in the &amp;lt;tt&amp;gt;Algorithms&amp;lt;/tt&amp;gt; enum just modified in &amp;lt;tt&amp;gt;Evoptool.h&amp;lt;/tt&amp;gt;, the second is the number of parameters to be parsed in the xml configuration file and the third is a string specifying their type: &amp;lt;tt&amp;gt;I&amp;lt;/tt&amp;gt; for integer and &amp;lt;tt&amp;gt;D&amp;lt;/tt&amp;gt; for double.&lt;br /&gt;
&lt;br /&gt;
4. add a case in the switch that follows in &amp;lt;tt&amp;gt;bool XMLParser::parseAlgorithms&amp;lt;/tt&amp;gt;, for instance:&lt;br /&gt;
&lt;br /&gt;
  case Evoptool::DEUM: &lt;br /&gt;
    algos[i] = new extendedFCA(intVal[0], doubleVal[0], doubleVal[1], intVal[1], intVal[2], params-&amp;gt;rng);&lt;br /&gt;
    algos[i]-&amp;gt;initAlgorithm(params-&amp;gt;task);&lt;br /&gt;
    break;&lt;br /&gt;
&lt;br /&gt;
Note that your algorithm can employ the random number generator provided by the Evoptool core, &amp;lt;tt&amp;gt;params-&amp;gt;rng&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
5. Include your headers in core/src/Algorithms.h&lt;br /&gt;
&lt;br /&gt;
6. Document how your algorithm is instantiated in the comments appearing in evoptool-file/exec-scripts/example.xml&lt;br /&gt;
&lt;br /&gt;
   Algorithm  Id    Types    Parameters&lt;br /&gt;
  =====================================================================================================&lt;br /&gt;
    ...&lt;br /&gt;
    FCA       26    &amp;quot;IDDII&amp;quot;  (Pop, PercSelection, LearningRate, MaxCompositionLenght, MaxMonomialOrder)&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
7. Add an instantiation example for your algorithm in evoptool-file/exec-scripts/example.xml&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;algo id=&amp;quot;26&amp;quot; instanceName=&amp;quot;FCA&amp;quot;&amp;gt;  &lt;br /&gt;
    &amp;lt;int&amp;gt;1000&amp;lt;/int&amp;gt;&lt;br /&gt;
    &amp;lt;double&amp;gt;0.5&amp;lt;/double&amp;gt;&lt;br /&gt;
    &amp;lt;double&amp;gt;1&amp;lt;/double&amp;gt;&lt;br /&gt;
    &amp;lt;int&amp;gt;64&amp;lt;/int&amp;gt;&lt;br /&gt;
    &amp;lt;int&amp;gt;2&amp;lt;/int&amp;gt;&lt;br /&gt;
  &amp;lt;/algo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Run an algorithm in a C++ program ====&lt;br /&gt;
&lt;br /&gt;
The simplest way to do this is to create a new submodule in &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;, i.e., a new source directory within the source directory of a module&lt;br /&gt;
For instance, the steps to create a new submodule named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; are&lt;br /&gt;
&lt;br /&gt;
1. copy the example submodule &amp;lt;code&amp;gt;exampleRunAlgorithm&amp;lt;/code&amp;gt; in a new folder named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; in&lt;br /&gt;
&lt;br /&gt;
  evoptool/core/src&lt;br /&gt;
&lt;br /&gt;
2. modify the &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; directory, see comments in the makefile for more details.&lt;br /&gt;
&lt;br /&gt;
3. edit the &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; function in the source file, if you need you can create other C++ and .h files in the same folder.&lt;br /&gt;
&lt;br /&gt;
4. from &amp;lt;code&amp;gt;evoptool/core/src/myexample&amp;lt;/code&amp;gt; run&lt;br /&gt;
&lt;br /&gt;
  make bin&lt;br /&gt;
&lt;br /&gt;
The bin file is create in &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; and copied in &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTICE that &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; may be deleted after a &amp;lt;code&amp;gt;make cleanall&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. from &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt; run &lt;br /&gt;
&lt;br /&gt;
  ./myexample&lt;br /&gt;
&lt;br /&gt;
==== Available statistics  ====&lt;br /&gt;
&lt;br /&gt;
In the configuration xml file you can enable the evaluation of three set of statistics:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;statisticsConfiguration&amp;gt;&lt;br /&gt;
    &amp;lt;evalPopulationStatistics&amp;gt;yes&amp;lt;/evalPopulationStatistics&amp;gt;&lt;br /&gt;
    &amp;lt;evalModelStatistics&amp;gt;yes&amp;lt;/evalModelStatistics&amp;gt;&lt;br /&gt;
    &amp;lt;evalExecutionStatistics&amp;gt;No&amp;lt;/evalExecutionStatistics&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/statisticsConfiguration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the headers file in evoptool/common/src for details.&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14175</id>
		<title>Evoptool: Evolutionary Optimization Tool</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14175"/>
				<updated>2011-10-24T13:25:21Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: /* Available Statistics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
Evolutionary Optimization Tool (Evoptool) is an open source optimization tool writte in C++, distributed under GNU General Public License. Evoptool implements meta-heuristics based on the Evolutionary Computation paradigm and aims to provide a common platform for the development and test of new algorithms, in order to facilitate the performance comparison activity. Evoptool offers a wide set of benchmark problems, from classical toy samples to more complex tasks, and a collection of algorithm implementations from Genetic Algorithms and Estimation of Distribution Algorithms paradigms. Evoptool is flexible, easy to extend, also with algorithms based on other approaches other from EAs.&lt;br /&gt;
&lt;br /&gt;
== The Evoptool Team ==&lt;br /&gt;
&lt;br /&gt;
*[[User:MatteoMatteucci| Matteo Matteucci]] - matteucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
*[http://www.dei.polimi.it/personale/dettaglio.php?id_persona=829&amp;amp;id_sezione=&amp;amp;lettera=M&amp;amp;idlang=ita| Luigi Malagò] - malago [AT] elet.polimi.it &lt;br /&gt;
&lt;br /&gt;
*[[User:GabrieleValentini| Gabriele Valentini]] - gvalentini [AT] iridia.ulb.ac.be&lt;br /&gt;
&lt;br /&gt;
*[[User:DavideCucci| Davide Cucci]] - cucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
'''Formerly involved'''&lt;br /&gt;
*Emanuele Corsano&lt;br /&gt;
&lt;br /&gt;
== Mailing List ==&lt;br /&gt;
http://groups.google.com/group/evoptool&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
====Algorithms implemented====&lt;br /&gt;
* Genetic Algorithms&lt;br /&gt;
** SGA&lt;br /&gt;
*Estimation of Distribution Algorithms&lt;br /&gt;
**PBIL, UMDA, cGA, COMIT, BOA, FCA&lt;br /&gt;
* DEUM framework&lt;br /&gt;
**DEUMd, IsingDEUM, DEUM-Chain, DEUM-LDA, DEUM-CE, DEUM-X2, DEUM-JEMP, DEUM-l1, sDEUM&lt;br /&gt;
* Stochastic Gradient Descent&lt;br /&gt;
**SGD, SNGD&lt;br /&gt;
* Other Meta-heuristics&lt;br /&gt;
**Simulated Annealing&lt;br /&gt;
&lt;br /&gt;
References to original papers will be added soon.&lt;br /&gt;
&lt;br /&gt;
====Benchmark functions implemented====&lt;br /&gt;
* OneMax&lt;br /&gt;
* AltBit&lt;br /&gt;
* Trap3&lt;br /&gt;
* Trap5&lt;br /&gt;
* IsingSpinGlass2D&lt;br /&gt;
* IsingSpinGlass3D&lt;br /&gt;
* Max Cut&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Developers may also access unstable branch. Contact the evoptool team for more details.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
Follow these steps in order to compile evoptool&lt;br /&gt;
&lt;br /&gt;
1. Download source code from svn&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Refer to trunk for the lastest (stable?) version of evoptool&lt;br /&gt;
&lt;br /&gt;
2. First you need to manually compile the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; package, http://www.stanford.edu/~boyd/l1_logreg/&lt;br /&gt;
whose source are already included in the evoptool repository. In order to do that follow the instrunctions in &lt;br /&gt;
&amp;lt;code&amp;gt;README.evoptool&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
Next, compile &amp;lt;code&amp;gt;&amp;lt;id_dist/code&amp;gt; following the instructions in &amp;lt;code&amp;gt;README.evoptool&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;&amp;lt;id_dist&amp;lt;/code&amp;gt; folder&lt;br /&gt;
&lt;br /&gt;
3. Then you need to compile a module at a time. Each module is included in a different folder. &lt;br /&gt;
To compile a module, from go to the module source folder and do make lib. For instance, for the module named &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  cd common/src&lt;br /&gt;
  make lib&lt;br /&gt;
  cd ..&lt;br /&gt;
&lt;br /&gt;
Compile modules in the following orderm due to dependencies&lt;br /&gt;
&lt;br /&gt;
  common&lt;br /&gt;
  functions&lt;br /&gt;
  ga&lt;br /&gt;
  stochastic&lt;br /&gt;
  eda&lt;br /&gt;
&lt;br /&gt;
To clean a module, do &lt;br /&gt;
&lt;br /&gt;
  make clean&lt;br /&gt;
&lt;br /&gt;
from the module source directory&lt;br /&gt;
&lt;br /&gt;
4. Go to &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;  module and type&lt;br /&gt;
&lt;br /&gt;
  make exe&lt;br /&gt;
&lt;br /&gt;
Binary files will be copied in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root as well as the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory of the &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt; module&lt;br /&gt;
&lt;br /&gt;
'''Required packages'''&lt;br /&gt;
* Libraries&lt;br /&gt;
** ''gtkmm-2.4''&lt;br /&gt;
** ''glademm-2.4''&lt;br /&gt;
** ''gthread-2.0''&lt;br /&gt;
** ''sigc++-2.0''&lt;br /&gt;
** ''opencv'' (see for instance http://www.samontab.com/web/2011/06/installing-opencv-2-2-in-ubuntu-11-04/)&lt;br /&gt;
** ''gsl''&lt;br /&gt;
** ''gslcblas''&lt;br /&gt;
** ''libxml++-2.6''&lt;br /&gt;
** '''f2c''&lt;br /&gt;
&lt;br /&gt;
* Software&lt;br /&gt;
** ''gnuplot''&lt;br /&gt;
&lt;br /&gt;
== Running  ==&lt;br /&gt;
&lt;br /&gt;
Right now &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; only runs as a script. GUI is not maintained in the latest version.&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; binary file is supposed to be run in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root, this is because right now the script looks for some configuration files, for the instances of the problems, and temp directories. If you want to run the script from other directories, you just need to copy in that directory the &amp;lt;code&amp;gt;evoptool-file&amp;lt;/code&amp;gt; directory that you find in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory. Link such directory instead of copying it is not safe if you run multiple scripts at the same time, since output files will be shared. &lt;br /&gt;
&lt;br /&gt;
To run the algorithm you need to enter as input an xml file. For instance you can run&lt;br /&gt;
&lt;br /&gt;
  ./evoptool evoptool-file/examples/unitTestOneMax.xml&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool-file/example&amp;lt;/code&amp;gt; directory contains a set of xml files for different benchmarks and different algorithms.&lt;br /&gt;
Take a loot at the &amp;lt;code&amp;gt;example.xml&amp;lt;/code&amp;gt; file for the documentation on hoe to set the parameters for an each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; produces a set of files as output. You can find all files in &amp;lt;code&amp;gt;evoptool-file/temp&amp;lt;/code&amp;gt; directory. Plus a tar.gz file containing such files can be produced at the end of the execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. See the xml file for details.&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/data&lt;br /&gt;
contains the raw data of the statistics according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/gnuplot&lt;br /&gt;
contains the gnuplot files to produce images of the statistics&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/image&lt;br /&gt;
contains images of the statistics produced according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/support&lt;br /&gt;
contains logs&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
==== Implement a new benchmark function====&lt;br /&gt;
&lt;br /&gt;
Benchmarks are defined in the &amp;lt;code&amp;gt;function&amp;lt;/code&amp;gt; module. A benchmark is the maximization problem of a real valued function defined over a vector of n binary variables. Functions are maximized in &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. In order to implement a new benchmark function you have to create a new &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt; that inherits from &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt; module. Take a look at the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; benchmark function.&lt;br /&gt;
&lt;br /&gt;
Among the arguments of the constructor of the &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; class there must be the size of the benchmark, which may or may not be a parameter of the new benchmark.&lt;br /&gt;
&lt;br /&gt;
  OneMax::OneMax(int size) : ObjectiveFunction(size)&lt;br /&gt;
&lt;br /&gt;
In the constructor you have whether the maximum of the function is known or not&lt;br /&gt;
&lt;br /&gt;
   _knownSolution = true;&lt;br /&gt;
&lt;br /&gt;
And in case this is known, set the minimum value and maximum value for the function&lt;br /&gt;
&lt;br /&gt;
 _minFitness = 0; &lt;br /&gt;
 _maxFitness = size; //the maximum value of the OneMax function is defined as the sum of the bits of x set to one.&lt;br /&gt;
&lt;br /&gt;
Besides, such values are used in the normalization of the functions in the plots of the statistics.&lt;br /&gt;
&lt;br /&gt;
Each benchmark must implement the &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; method, which takes the &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x and return f(x). For instance, for &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; you have&lt;br /&gt;
&lt;br /&gt;
  double OneMax::f(BinaryString *bi) {&lt;br /&gt;
  &amp;amp;nbsp;if (bi != NULL) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;if(!(bi-&amp;gt;validCache())) { &lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;/* Fitness cache value not valid */&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;int sum = 0;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;for (int j = 0; j &amp;lt; _size; j++) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;sum = sum + bi-&amp;gt;get(j);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;bi-&amp;gt;setFitnessCache(sum);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return sum;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return bi-&amp;gt;getFitnessCache();&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;cerr &amp;lt;&amp;lt; &amp;quot;[OneMax::f] binary instance cannot be null&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;return 0;&lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In order to avoid multiple evaluations of the same &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x, a caching mechanism has been implemented.&lt;br /&gt;
&lt;br /&gt;
Moreover, you are asked to implement the &amp;lt;code&amp;gt;exportInteration&amp;lt;/code&amp;gt; function, which return an &amp;lt;code&amp;gt;HyperGraph&amp;lt;/code&amp;gt; which represents the interactions present in the function. In order to determine such hypergraph, start from the polinomial representation of the function, and for each monomial introduce a new hyperedge in the hypergraph.&lt;br /&gt;
&lt;br /&gt;
For the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; function, such representation corresponds to the independence graph, since such function is linear. &lt;br /&gt;
&lt;br /&gt;
  HyperGraph* OneMax::exportInteractions() {&lt;br /&gt;
  &amp;amp;nbsp;HyperGraph *interactions = new HyperGraph();&lt;br /&gt;
  &amp;amp;nbsp;interactions-&amp;gt;createIndependenceGraph(_size);&lt;br /&gt;
  &amp;amp;nbsp;return interactions;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;Evoptool.h&amp;lt;/code&amp;gt; add an entry in the &amp;lt;code&amp;gt;Tasks&amp;lt;/code&amp;gt; enum.&lt;br /&gt;
&lt;br /&gt;
  /* This enumeration defines an identifier for each task function. */&lt;br /&gt;
  typedef enum {&lt;br /&gt;
  &amp;amp;nbsp;ONE_MAX = 7,&lt;br /&gt;
  } Tasks;&lt;br /&gt;
&lt;br /&gt;
This value will identify uniquely the benchmark in the xml file. In the &amp;lt;code&amp;gt;XMLParser.cpp&amp;lt;/code&amp;gt; file, add an entry for the new function.&lt;br /&gt;
&lt;br /&gt;
  bool XMLParser::parseTask(xmlpp::TextReader &amp;amp;reader, Evoptool::TestParameters *params) {&lt;br /&gt;
  &amp;amp;nbsp;.. &lt;br /&gt;
  &amp;amp;nbsp;switch (task) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;case Evoptool::ONE_MAX: params-&amp;gt;task = new OneMax(size);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;break;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;..&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;default: return false; &lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;..&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Additional parameters can be obtained using the xml TextReader object, as for the &amp;lt;code&amp;gt;ForPeaks&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
  case Evoptool::FOUR_PEAKS: &lt;br /&gt;
  &amp;amp;nbsp;value = readNodeContent(reader, &amp;quot;peaks&amp;quot;, &amp;amp;errorFlag);&lt;br /&gt;
  &amp;amp;nbsp;if (errorFlag) return false;&lt;br /&gt;
  &amp;amp;nbsp;int peaks = toInt(value);&lt;br /&gt;
  &amp;amp;nbsp;params-&amp;gt;task = new FourPeaks(size, peaks);&lt;br /&gt;
  &amp;amp;nbsp;break; &lt;br /&gt;
&lt;br /&gt;
Finally in the xml file, a function can set with the &amp;lt;code&amp;gt;task&amp;lt;/code&amp;gt; tag, together with all parameters.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;task&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;name&amp;gt;7&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;size&amp;gt;64&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;/task&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== To create a new algorithm ====&lt;br /&gt;
&lt;br /&gt;
1. Implement a new algorithm&lt;br /&gt;
&lt;br /&gt;
All algorithms must inherit from the Algorithm class. First override the Algorithm::initAlgorithm as follows:&lt;br /&gt;
&lt;br /&gt;
  void DEUM::initAlgorithm(ObjectiveFunction* of) {&lt;br /&gt;
    Algorithm::initAlgorithm(of);&lt;br /&gt;
  &lt;br /&gt;
    /* Initialization tasks */&lt;br /&gt;
    ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Then implement a run() method which performs al the required task for '''one''' iteration of your algorithm.&lt;br /&gt;
&lt;br /&gt;
There are some classes which contain useful methods such as samplers and estimators from which your algorithm can inherit. The most useful are:&lt;br /&gt;
&lt;br /&gt;
  PopulationBasedAlgorithm&lt;br /&gt;
  ModelBasedAlgorithm&lt;br /&gt;
  ExponentialFamilyAlgorithm&lt;br /&gt;
  BayesianNetworkBasedAlgorithm&lt;br /&gt;
&lt;br /&gt;
2. Append entry in the &amp;lt;tt&amp;gt;Algorithms&amp;lt;/tt&amp;gt; enum in Evoptool.h.&lt;br /&gt;
&lt;br /&gt;
  typedef enum {&lt;br /&gt;
    ...&lt;br /&gt;
    DEUM    // 5&lt;br /&gt;
  } Algorithms;&lt;br /&gt;
&lt;br /&gt;
In the xml configuration file, your algorithm will be characterized by the int value associated with the position in this enum declaration.&lt;br /&gt;
&lt;br /&gt;
3. modify the file&lt;br /&gt;
core/src/XMLParser.cpp. Search for the method &amp;lt;tt&amp;gt;bool XMLParser::parseAlgorithms&amp;lt;/tt&amp;gt; and insert an new entry for your algorithm in the &amp;lt;tt&amp;gt;algorithmParameters&amp;lt;/tt&amp;gt; array, for example&lt;br /&gt;
&lt;br /&gt;
  AlgorithmParameters algorithmParameters[] = {&lt;br /&gt;
    ...&lt;br /&gt;
    { Evoptool::DEUM, 5, (char*) &amp;quot;IDDDI&amp;quot; }, // Pop, percElitism, percSelec, CoolRate, GibbsIterations&lt;br /&gt;
    ...&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
In each entry, the first field is the name of the entry in the &amp;lt;tt&amp;gt;Algorithms&amp;lt;/tt&amp;gt; enum just modified in &amp;lt;tt&amp;gt;Evoptool.h&amp;lt;/tt&amp;gt;, the second is the number of parameters to be parsed in the xml configuration file and the third is a string specifying their type: &amp;lt;tt&amp;gt;I&amp;lt;/tt&amp;gt; for integer and &amp;lt;tt&amp;gt;D&amp;lt;/tt&amp;gt; for double.&lt;br /&gt;
&lt;br /&gt;
4. add a case in the switch that follows in &amp;lt;tt&amp;gt;bool XMLParser::parseAlgorithms&amp;lt;/tt&amp;gt;, for instance:&lt;br /&gt;
&lt;br /&gt;
  case Evoptool::DEUM: &lt;br /&gt;
    algos[i] = new extendedFCA(intVal[0], doubleVal[0], doubleVal[1], intVal[1], intVal[2], params-&amp;gt;rng);&lt;br /&gt;
    algos[i]-&amp;gt;initAlgorithm(params-&amp;gt;task);&lt;br /&gt;
    break;&lt;br /&gt;
&lt;br /&gt;
Note that your algorithm can employ the random number generator provided by the Evoptool core, &amp;lt;tt&amp;gt;params-&amp;gt;rng&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
5. Include your headers in core/src/Algorithms.h&lt;br /&gt;
&lt;br /&gt;
6. Document how your algorithm is instantiated in the comments appearing in evoptool-file/exec-scripts/example.xml&lt;br /&gt;
&lt;br /&gt;
   Algorithm  Id    Types    Parameters&lt;br /&gt;
  =====================================================================================================&lt;br /&gt;
    ...&lt;br /&gt;
    FCA       26    &amp;quot;IDDII&amp;quot;  (Pop, PercSelection, LearningRate, MaxCompositionLenght, MaxMonomialOrder)&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
7. Add an instantiation example for your algorithm in evoptool-file/exec-scripts/example.xml&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;algo id=&amp;quot;26&amp;quot; instanceName=&amp;quot;FCA&amp;quot;&amp;gt;  &lt;br /&gt;
    &amp;lt;int&amp;gt;1000&amp;lt;/int&amp;gt;&lt;br /&gt;
    &amp;lt;double&amp;gt;0.5&amp;lt;/double&amp;gt;&lt;br /&gt;
    &amp;lt;double&amp;gt;1&amp;lt;/double&amp;gt;&lt;br /&gt;
    &amp;lt;int&amp;gt;64&amp;lt;/int&amp;gt;&lt;br /&gt;
    &amp;lt;int&amp;gt;2&amp;lt;/int&amp;gt;&lt;br /&gt;
  &amp;lt;/algo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Run an algorithm in a C++ program ====&lt;br /&gt;
&lt;br /&gt;
The simplest way to do this is to create a new submodule in &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;, i.e., a new source directory within the source directory of a module&lt;br /&gt;
For instance, the steps to create a new submodule named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; are&lt;br /&gt;
&lt;br /&gt;
1. copy the example submodule &amp;lt;code&amp;gt;exampleRunAlgorithm&amp;lt;/code&amp;gt; in a new folder named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; in&lt;br /&gt;
&lt;br /&gt;
  evoptool/core/src&lt;br /&gt;
&lt;br /&gt;
2. modify the &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; directory, see comments in the makefile for more details.&lt;br /&gt;
&lt;br /&gt;
3. edit the &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; function in the source file, if you need you can create other C++ and .h files in the same folder.&lt;br /&gt;
&lt;br /&gt;
4. from &amp;lt;code&amp;gt;evoptool/core/src/myexample&amp;lt;/code&amp;gt; run&lt;br /&gt;
&lt;br /&gt;
  make bin&lt;br /&gt;
&lt;br /&gt;
The bin file is create in &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; and copied in &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTICE that &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; may be deleted after a &amp;lt;code&amp;gt;make cleanall&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. from &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt; run &lt;br /&gt;
&lt;br /&gt;
  ./myexample&lt;br /&gt;
&lt;br /&gt;
==== Available statistics  ====&lt;br /&gt;
&lt;br /&gt;
In the configuration xml file you can enable the evaluation of three set of statistics:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;statisticsConfiguration&amp;gt;&lt;br /&gt;
    &amp;lt;evalPopulationStatistics&amp;gt;yes&amp;lt;/evalPopulationStatistics&amp;gt;&lt;br /&gt;
    &amp;lt;evalModelStatistics&amp;gt;yes&amp;lt;/evalModelStatistics&amp;gt;&lt;br /&gt;
    &amp;lt;evalExecutionStatistics&amp;gt;No&amp;lt;/evalExecutionStatistics&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/statisticsConfiguration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the headers file in /common/src for details.&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14168</id>
		<title>Evoptool: Evolutionary Optimization Tool</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14168"/>
				<updated>2011-10-24T13:15:51Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: /* Documentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
Evolutionary Optimization Tool (Evoptool) is an open source optimization tool writte in C++, distributed under GNU General Public License. Evoptool implements meta-heuristics based on the Evolutionary Computation paradigm and aims to provide a common platform for the development and test of new algorithms, in order to facilitate the performance comparison activity. Evoptool offers a wide set of benchmark problems, from classical toy samples to more complex tasks, and a collection of algorithm implementations from Genetic Algorithms and Estimation of Distribution Algorithms paradigms. Evoptool is flexible, easy to extend, also with algorithms based on other approaches other from EAs.&lt;br /&gt;
&lt;br /&gt;
== The Evoptool Team ==&lt;br /&gt;
&lt;br /&gt;
*[[User:MatteoMatteucci| Matteo Matteucci]] - matteucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
*[http://www.dei.polimi.it/personale/dettaglio.php?id_persona=829&amp;amp;id_sezione=&amp;amp;lettera=M&amp;amp;idlang=ita| Luigi Malagò] - malago [AT] elet.polimi.it &lt;br /&gt;
&lt;br /&gt;
*[[User:GabrieleValentini| Gabriele Valentini]] - gvalentini [AT] iridia.ulb.ac.be&lt;br /&gt;
&lt;br /&gt;
*[[User:DavideCucci| Davide Cucci]] - cucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
'''Formerly involved'''&lt;br /&gt;
*Emanuele Corsano&lt;br /&gt;
&lt;br /&gt;
== Mailing List ==&lt;br /&gt;
http://groups.google.com/group/evoptool&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Developers may also access unstable branch. Contact the evoptool team for more details.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
Follow these steps in order to compile evoptool&lt;br /&gt;
&lt;br /&gt;
1. Download source code from svn&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Refer to trunk for the lastest (stable?) version of evoptool&lt;br /&gt;
&lt;br /&gt;
2. First you need to manually compile the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; package, http://www.stanford.edu/~boyd/l1_logreg/&lt;br /&gt;
whose source are already included in the evoptool repository. In order to do that follow the instrunctions in &lt;br /&gt;
&amp;lt;code&amp;gt;README.evoptool&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
Next, compile &amp;lt;code&amp;gt;&amp;lt;id_dist/code&amp;gt; following the instructions in &amp;lt;code&amp;gt;README.evoptool&amp;lt;code&amp;gt; in the &amp;lt;code&amp;gt;&amp;lt;id_dist&amp;lt;/code&amp;gt; folder&lt;br /&gt;
&lt;br /&gt;
3. Then you need to compile a module at a time. Each module is included in a different folder. &lt;br /&gt;
To compile a module, from go to the module source folder and do make lib. For instance, for the module named &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  cd common/src&lt;br /&gt;
  make lib&lt;br /&gt;
  cd ..&lt;br /&gt;
&lt;br /&gt;
Compile modules in the following orderm due to dependencies&lt;br /&gt;
&lt;br /&gt;
  common&lt;br /&gt;
  functions&lt;br /&gt;
  ga&lt;br /&gt;
  stochastic&lt;br /&gt;
  eda&lt;br /&gt;
&lt;br /&gt;
To clean a module, do &lt;br /&gt;
&lt;br /&gt;
  make clean&lt;br /&gt;
&lt;br /&gt;
from the module source directory&lt;br /&gt;
&lt;br /&gt;
4. Go to &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;  module and type&lt;br /&gt;
&lt;br /&gt;
  make exe&lt;br /&gt;
&lt;br /&gt;
Binary files will be copied in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root as well as the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory of the &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt; module&lt;br /&gt;
&lt;br /&gt;
'''Required packages'''&lt;br /&gt;
* Libraries&lt;br /&gt;
&lt;br /&gt;
** ''gtkmm-2.4''&lt;br /&gt;
** ''glademm-2.4''&lt;br /&gt;
** ''gthread-2.0''&lt;br /&gt;
** ''sigc++-2.0''&lt;br /&gt;
** ''opencv'' (see for instance http://www.samontab.com/web/2011/06/installing-opencv-2-2-in-ubuntu-11-04/)&lt;br /&gt;
** ''gsl''&lt;br /&gt;
** ''gslcblas''&lt;br /&gt;
** ''libxml++-2.6''&lt;br /&gt;
** '''f2c''&lt;br /&gt;
&lt;br /&gt;
* Software&lt;br /&gt;
** ''gnuplot''&lt;br /&gt;
&lt;br /&gt;
== Running  ==&lt;br /&gt;
&lt;br /&gt;
Right now &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; only runs as a script. GUI is not maintained in the latest version.&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; binary file is supposed to be run in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root, this is because right now the script looks for some configuration files, for the instances of the problems, and temp directories. If you want to run the script from other directories, you just need to copy in that directory the &amp;lt;code&amp;gt;evoptool-file&amp;lt;/code&amp;gt; directory that you find in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory. Link such directory instead of copying it is not safe if you run multiple scripts at the same time, since output files will be shared. &lt;br /&gt;
&lt;br /&gt;
To run the algorithm you need to enter as input an xml file. For instance you can run&lt;br /&gt;
&lt;br /&gt;
  ./evoptool evoptool-file/examples/unitTestOneMax.xml&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool-file/example&amp;lt;/code&amp;gt; directory contains a set of xml files for different benchmarks and different algorithms.&lt;br /&gt;
Take a loot at the &amp;lt;code&amp;gt;example.xml&amp;lt;/code&amp;gt; file for the documentation on hoe to set the parameters for an each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; produces a set of files as output. You can find all files in &amp;lt;code&amp;gt;evoptool-file/temp&amp;lt;/code&amp;gt; directory. Plus a tar.gz file containing such files can be produced at the end of the execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. See the xml file for details.&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/data&lt;br /&gt;
contains the raw data of the statistics according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/gnuplot&lt;br /&gt;
contains the gnuplot files to produce images of the statistics&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/image&lt;br /&gt;
contains images of the statistics produced according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/support&lt;br /&gt;
contains logs&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
==== Implement a new benchmark function====&lt;br /&gt;
&lt;br /&gt;
Benchmarks are defined in the &amp;lt;code&amp;gt;function&amp;lt;/code&amp;gt; module. A benchmark is the maximization problem of a real valued function defined over a vector of n binary variables. Functions are maximized in &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. In order to implement a new benchmark function you have to create a new &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt; that inherits from &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt; module. Take a look at the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; benchmark function.&lt;br /&gt;
&lt;br /&gt;
Among the arguments of the constructor of the &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; class there must be the size of the benchmark, which may or may not be a parameter of the new benchmark.&lt;br /&gt;
&lt;br /&gt;
  OneMax::OneMax(int size) : ObjectiveFunction(size)&lt;br /&gt;
&lt;br /&gt;
In the constructor you have whether the maximum of the function is known or not&lt;br /&gt;
&lt;br /&gt;
   _knownSolution = true;&lt;br /&gt;
&lt;br /&gt;
And in case this is known, set the minimum value and maximum value for the function&lt;br /&gt;
&lt;br /&gt;
 _minFitness = 0; &lt;br /&gt;
 _maxFitness = size; //the maximum value of the OneMax function is defined as the sum of the bits of x set to one.&lt;br /&gt;
&lt;br /&gt;
Besides, such values are used in the normalization of the functions in the plots of the statistics.&lt;br /&gt;
&lt;br /&gt;
Each benchmark must implement the &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; method, which takes the &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x and return f(x). For instance, for &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; you have&lt;br /&gt;
&lt;br /&gt;
  double OneMax::f(BinaryString *bi) {&lt;br /&gt;
  &amp;amp;nbsp;if (bi != NULL) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;if(!(bi-&amp;gt;validCache())) { &lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;/* Fitness cache value not valid */&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;int sum = 0;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;for (int j = 0; j &amp;lt; _size; j++) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;sum = sum + bi-&amp;gt;get(j);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;bi-&amp;gt;setFitnessCache(sum);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return sum;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return bi-&amp;gt;getFitnessCache();&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;cerr &amp;lt;&amp;lt; &amp;quot;[OneMax::f] binary instance cannot be null&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;return 0;&lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In order to avoid multiple evaluations of the same &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x, a caching mechanism has been implemented.&lt;br /&gt;
&lt;br /&gt;
Moreover, you are asked to implement the &amp;lt;code&amp;gt;exportInteration&amp;lt;/code&amp;gt; function, which return an &amp;lt;code&amp;gt;HyperGraph&amp;lt;/code&amp;gt; which represents the interactions present in the function. In order to determine such hypergraph, start from the polinomial representation of the function, and for each monomial introduce a new hyperedge in the hypergraph.&lt;br /&gt;
&lt;br /&gt;
For the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; function, such representation corresponds to the independence graph, since such function is linear. &lt;br /&gt;
&lt;br /&gt;
  HyperGraph* OneMax::exportInteractions() {&lt;br /&gt;
  &amp;amp;nbsp;HyperGraph *interactions = new HyperGraph();&lt;br /&gt;
  &amp;amp;nbsp;interactions-&amp;gt;createIndependenceGraph(_size);&lt;br /&gt;
  &amp;amp;nbsp;return interactions;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;Evoptool.h&amp;lt;/code&amp;gt; add an entry in the &amp;lt;code&amp;gt;Tasks&amp;lt;/code&amp;gt; enum.&lt;br /&gt;
&lt;br /&gt;
  /* This enumeration defines an identifier for each task function. */&lt;br /&gt;
  typedef enum {&lt;br /&gt;
  &amp;amp;nbsp;ONE_MAX = 7,&lt;br /&gt;
  } Tasks;&lt;br /&gt;
&lt;br /&gt;
This value will identify uniquely the benchmark in the xml file. In the &amp;lt;code&amp;gt;XMLParser.cpp&amp;lt;/code&amp;gt; file, add an entry for the new function.&lt;br /&gt;
&lt;br /&gt;
  bool XMLParser::parseTask(xmlpp::TextReader &amp;amp;reader, Evoptool::TestParameters *params) {&lt;br /&gt;
  &amp;amp;nbsp;.. &lt;br /&gt;
  &amp;amp;nbsp;switch (task) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;case Evoptool::ONE_MAX: params-&amp;gt;task = new OneMax(size);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;break;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;..&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;default: return false; &lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;..&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Additional parameters can be obtained using the xml TextReader object, as for the &amp;lt;code&amp;gt;ForPeaks&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
  case Evoptool::FOUR_PEAKS: &lt;br /&gt;
  &amp;amp;nbsp;value = readNodeContent(reader, &amp;quot;peaks&amp;quot;, &amp;amp;errorFlag);&lt;br /&gt;
  &amp;amp;nbsp;if (errorFlag) return false;&lt;br /&gt;
  &amp;amp;nbsp;int peaks = toInt(value);&lt;br /&gt;
  &amp;amp;nbsp;params-&amp;gt;task = new FourPeaks(size, peaks);&lt;br /&gt;
  &amp;amp;nbsp;break; &lt;br /&gt;
&lt;br /&gt;
Finally in the xml file, a function can set with the &amp;lt;code&amp;gt;task&amp;lt;/code&amp;gt; tag, together with all parameters.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;task&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;name&amp;gt;7&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;size&amp;gt;64&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;/task&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== To create a new algorithm ====&lt;br /&gt;
&lt;br /&gt;
1. Implement a new algorithm&lt;br /&gt;
&lt;br /&gt;
All algorithms must inherit from the Algorithm class. First override the Algorithm::initAlgorithm as follows:&lt;br /&gt;
&lt;br /&gt;
  void DEUM::initAlgorithm(ObjectiveFunction* of) {&lt;br /&gt;
    Algorithm::initAlgorithm(of);&lt;br /&gt;
  &lt;br /&gt;
    /* Initialization tasks */&lt;br /&gt;
    ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Then implement a run() method which performs al the required task for '''one''' iteration of your algorithm.&lt;br /&gt;
&lt;br /&gt;
There are some classes which contain useful methods such as samplers and estimators from which your algorithm can inherit. The most useful are:&lt;br /&gt;
&lt;br /&gt;
  PopulationBasedAlgorithm&lt;br /&gt;
  ModelBasedAlgorithm&lt;br /&gt;
  ExponentialFamilyAlgorithm&lt;br /&gt;
  BayesianNetworkBasedAlgorithm&lt;br /&gt;
&lt;br /&gt;
2. Append entry in the &amp;lt;tt&amp;gt;Algorithms&amp;lt;/tt&amp;gt; enum in Evoptool.h.&lt;br /&gt;
&lt;br /&gt;
  typedef enum {&lt;br /&gt;
    ...&lt;br /&gt;
    DEUM    // 5&lt;br /&gt;
  } Algorithms;&lt;br /&gt;
&lt;br /&gt;
In the xml configuration file, your algorithm will be characterized by the int value associated with the position in this enum declaration.&lt;br /&gt;
&lt;br /&gt;
3. modify the file&lt;br /&gt;
core/src/XMLParser.cpp. Search for the method &amp;lt;tt&amp;gt;bool XMLParser::parseAlgorithms&amp;lt;/tt&amp;gt; and insert an new entry for your algorithm in the &amp;lt;tt&amp;gt;algorithmParameters&amp;lt;/tt&amp;gt; array, for example&lt;br /&gt;
&lt;br /&gt;
  AlgorithmParameters algorithmParameters[] = {&lt;br /&gt;
    ...&lt;br /&gt;
    { Evoptool::DEUM, 5, (char*) &amp;quot;IDDDI&amp;quot; }, // Pop, percElitism, percSelec, CoolRate, GibbsIterations&lt;br /&gt;
    ...&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
In each entry, the first field is the name of the entry in the &amp;lt;tt&amp;gt;Algorithms&amp;lt;/tt&amp;gt; enum just modified in &amp;lt;tt&amp;gt;Evoptool.h&amp;lt;/tt&amp;gt;, the second is the number of parameters to be parsed in the xml configuration file and the third is a string specifying their type: &amp;lt;tt&amp;gt;I&amp;lt;/tt&amp;gt; for integer and &amp;lt;tt&amp;gt;D&amp;lt;/tt&amp;gt; for double.&lt;br /&gt;
&lt;br /&gt;
4. add a case in the switch that follows in &amp;lt;tt&amp;gt;bool XMLParser::parseAlgorithms&amp;lt;/tt&amp;gt;, for instance:&lt;br /&gt;
&lt;br /&gt;
  case Evoptool::DEUM: &lt;br /&gt;
    algos[i] = new extendedFCA(intVal[0], doubleVal[0], doubleVal[1], intVal[1], intVal[2], params-&amp;gt;rng);&lt;br /&gt;
    algos[i]-&amp;gt;initAlgorithm(params-&amp;gt;task);&lt;br /&gt;
    break;&lt;br /&gt;
&lt;br /&gt;
Note that your algorithm can employ the random number generator provided by the Evoptool core, &amp;lt;tt&amp;gt;params-&amp;gt;rng&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
5. Include your headers in core/src/Algorithms.h&lt;br /&gt;
&lt;br /&gt;
6. Document how your algorithm is instantiated in the comments appearing in evoptool-file/exec-scripts/example.xml&lt;br /&gt;
&lt;br /&gt;
   Algorithm  Id    Types    Parameters&lt;br /&gt;
  =====================================================================================================&lt;br /&gt;
    ...&lt;br /&gt;
    FCA       26    &amp;quot;IDDII&amp;quot;  (Pop, PercSelection, LearningRate, MaxCompositionLenght, MaxMonomialOrder)&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
7. Add an instantiation example for your algorithm in evoptool-file/exec-scripts/example.xml&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;algo id=&amp;quot;26&amp;quot; instanceName=&amp;quot;FCA&amp;quot;&amp;gt;  &lt;br /&gt;
    &amp;lt;int&amp;gt;1000&amp;lt;/int&amp;gt;&lt;br /&gt;
    &amp;lt;double&amp;gt;0.5&amp;lt;/double&amp;gt;&lt;br /&gt;
    &amp;lt;double&amp;gt;1&amp;lt;/double&amp;gt;&lt;br /&gt;
    &amp;lt;int&amp;gt;64&amp;lt;/int&amp;gt;&lt;br /&gt;
    &amp;lt;int&amp;gt;2&amp;lt;/int&amp;gt;&lt;br /&gt;
  &amp;lt;/algo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Run an algorithm in a C++ program ====&lt;br /&gt;
&lt;br /&gt;
The simplest way to do this is to create a new submodule in &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;, i.e., a new source directory within the source directory of a module&lt;br /&gt;
For instance, the steps to create a new submodule named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; are&lt;br /&gt;
&lt;br /&gt;
1. copy the example submodule &amp;lt;code&amp;gt;exampleRunAlgorithm&amp;lt;/code&amp;gt; in a new folder named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; in&lt;br /&gt;
&lt;br /&gt;
  evoptool/core/src&lt;br /&gt;
&lt;br /&gt;
2. modify the &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; directory, see comments in the makefile for more details.&lt;br /&gt;
&lt;br /&gt;
3. edit the &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; function in the source file, if you need you can create other C++ and .h files in the same folder.&lt;br /&gt;
&lt;br /&gt;
4. from &amp;lt;code&amp;gt;evoptool/core/src/myexample&amp;lt;/code&amp;gt; run&lt;br /&gt;
&lt;br /&gt;
  make bin&lt;br /&gt;
&lt;br /&gt;
The bin file is create in &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; and copied in &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTICE that &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; may be deleted after a &amp;lt;code&amp;gt;make cleanall&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. from &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt; run &lt;br /&gt;
&lt;br /&gt;
  ./myexample&lt;br /&gt;
&lt;br /&gt;
==== Available Statistics  ====&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14166</id>
		<title>Evoptool: Evolutionary Optimization Tool</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14166"/>
				<updated>2011-10-24T11:16:08Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: /* To create a new algorithm */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
Evolutionary Optimization Tool (Evoptool) is an open source optimization tool writte in C++, distributed under GNU General Public License. Evoptool implements meta-heuristics based on the Evolutionary Computation paradigm and aims to provide a common platform for the development and test of new algorithms, in order to facilitate the performance comparison activity. Evoptool offers a wide set of benchmark problems, from classical toy samples to more complex tasks, and a collection of algorithm implementations from Genetic Algorithms and Estimation of Distribution Algorithms paradigms. Evoptool is flexible, easy to extend, also with algorithms based on other approaches other from EAs.&lt;br /&gt;
&lt;br /&gt;
== The Evoptool Team ==&lt;br /&gt;
&lt;br /&gt;
*[[User:MatteoMatteucci| Matteo Matteucci]] - matteucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
*[http://www.dei.polimi.it/personale/dettaglio.php?id_persona=829&amp;amp;id_sezione=&amp;amp;lettera=M&amp;amp;idlang=ita| Luigi Malagò] - malago [AT] elet.polimi.it &lt;br /&gt;
&lt;br /&gt;
*[[User:GabrieleValentini| Gabriele Valentini]] - gvalentini [AT] iridia.ulb.ac.be&lt;br /&gt;
&lt;br /&gt;
*[[User:DavideCucci| Davide Cucci]] - cucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
'''Formerly involved'''&lt;br /&gt;
*Emanuele Corsano&lt;br /&gt;
&lt;br /&gt;
== Mailing List ==&lt;br /&gt;
http://groups.google.com/group/evoptool&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Developers may also access unstable branch. Contact the evoptool team for more details.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
Follow these steps in order to compile evoptool&lt;br /&gt;
&lt;br /&gt;
1. Download source code from svn&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Refer to trunk for the lastest (stable?) version of evoptool&lt;br /&gt;
&lt;br /&gt;
2. First you need to manually compile the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; package, http://www.stanford.edu/~boyd/l1_logreg/&lt;br /&gt;
whose source are already included in the evoptool repository. In order to do that follow the instrunctions in &lt;br /&gt;
&amp;lt;code&amp;gt;README.evoptool&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
Next, compile &amp;lt;code&amp;gt;&amp;lt;id_dist/code&amp;gt; following the instructions in &amp;lt;code&amp;gt;README.evoptool&amp;lt;code&amp;gt; in the &amp;lt;code&amp;gt;&amp;lt;id_dist&amp;lt;/code&amp;gt; folder&lt;br /&gt;
&lt;br /&gt;
3. Then you need to compile a module at a time. Each module is included in a different folder. &lt;br /&gt;
To compile a module, from go to the module source folder and do make lib. For instance, for the module named &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  cd common/src&lt;br /&gt;
  make lib&lt;br /&gt;
  cd ..&lt;br /&gt;
&lt;br /&gt;
Compile modules in the following orderm due to dependencies&lt;br /&gt;
&lt;br /&gt;
  common&lt;br /&gt;
  functions&lt;br /&gt;
  ga&lt;br /&gt;
  stochastic&lt;br /&gt;
  eda&lt;br /&gt;
&lt;br /&gt;
To clean a module, do &lt;br /&gt;
&lt;br /&gt;
  make clean&lt;br /&gt;
&lt;br /&gt;
from the module source directory&lt;br /&gt;
&lt;br /&gt;
4. Go to &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;  module and type&lt;br /&gt;
&lt;br /&gt;
  make exe&lt;br /&gt;
&lt;br /&gt;
Binary files will be copied in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root as well as the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory of the &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt; module&lt;br /&gt;
&lt;br /&gt;
'''Required packages'''&lt;br /&gt;
* Libraries&lt;br /&gt;
&lt;br /&gt;
** ''gtkmm-2.4''&lt;br /&gt;
** ''glademm-2.4''&lt;br /&gt;
** ''gthread-2.0''&lt;br /&gt;
** ''sigc++-2.0''&lt;br /&gt;
** ''opencv'' (see for instance http://www.samontab.com/web/2011/06/installing-opencv-2-2-in-ubuntu-11-04/)&lt;br /&gt;
** ''gsl''&lt;br /&gt;
** ''gslcblas''&lt;br /&gt;
** ''libxml++-2.6''&lt;br /&gt;
** '''f2c''&lt;br /&gt;
&lt;br /&gt;
* Software&lt;br /&gt;
** ''gnuplot''&lt;br /&gt;
&lt;br /&gt;
== Running  ==&lt;br /&gt;
&lt;br /&gt;
Right now &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; only runs as a script. GUI is not maintained in the latest version.&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; binary file is supposed to be run in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root, this is because right now the script looks for some configuration files, for the instances of the problems, and temp directories. If you want to run the script from other directories, you just need to copy in that directory the &amp;lt;code&amp;gt;evoptool-file&amp;lt;/code&amp;gt; directory that you find in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory. Link such directory instead of copying it is not safe if you run multiple scripts at the same time, since output files will be shared. &lt;br /&gt;
&lt;br /&gt;
To run the algorithm you need to enter as input an xml file. For instance you can run&lt;br /&gt;
&lt;br /&gt;
  ./evoptool evoptool-file/examples/unitTestOneMax.xml&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool-file/example&amp;lt;/code&amp;gt; directory contains a set of xml files for different benchmarks and different algorithms.&lt;br /&gt;
Take a loot at the &amp;lt;code&amp;gt;example.xml&amp;lt;/code&amp;gt; file for the documentation on hoe to set the parameters for an each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; produces a set of files as output. You can find all files in &amp;lt;code&amp;gt;evoptool-file/temp&amp;lt;/code&amp;gt; directory. Plus a tar.gz file containing such files can be produced at the end of the execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. See the xml file for details.&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/data&lt;br /&gt;
contains the raw data of the statistics according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/gnuplot&lt;br /&gt;
contains the gnuplot files to produce images of the statistics&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/image&lt;br /&gt;
contains images of the statistics produced according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/support&lt;br /&gt;
contains logs&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
==== Implement a new benchmark function====&lt;br /&gt;
&lt;br /&gt;
Benchmarks are defined in the &amp;lt;code&amp;gt;function&amp;lt;/code&amp;gt; module. A benchmark is the maximization problem of a real valued function defined over a vector of n binary variables. Functions are maximized in &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. In order to implement a new benchmark function you have to create a new &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt; that inherits from &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt; module. Take a look at the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; benchmark function.&lt;br /&gt;
&lt;br /&gt;
Among the arguments of the constructor of the &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; class there must be the size of the benchmark, which may or may not be a parameter of the new benchmark.&lt;br /&gt;
&lt;br /&gt;
  OneMax::OneMax(int size) : ObjectiveFunction(size)&lt;br /&gt;
&lt;br /&gt;
In the constructor you have whether the maximum of the function is known or not&lt;br /&gt;
&lt;br /&gt;
   _knownSolution = true;&lt;br /&gt;
&lt;br /&gt;
And in case this is known, set the minimum value and maximum value for the function&lt;br /&gt;
&lt;br /&gt;
 _minFitness = 0; &lt;br /&gt;
 _maxFitness = size; //the maximum value of the OneMax function is defined as the sum of the bits of x set to one.&lt;br /&gt;
&lt;br /&gt;
Besides, such values are used in the normalization of the functions in the plots of the statistics.&lt;br /&gt;
&lt;br /&gt;
Each benchmark must implement the &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; method, which takes the &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x and return f(x). For instance, for &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; you have&lt;br /&gt;
&lt;br /&gt;
  double OneMax::f(BinaryString *bi) {&lt;br /&gt;
  &amp;amp;nbsp;if (bi != NULL) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;if(!(bi-&amp;gt;validCache())) { &lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;/* Fitness cache value not valid */&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;int sum = 0;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;for (int j = 0; j &amp;lt; _size; j++) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;sum = sum + bi-&amp;gt;get(j);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;bi-&amp;gt;setFitnessCache(sum);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return sum;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return bi-&amp;gt;getFitnessCache();&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;cerr &amp;lt;&amp;lt; &amp;quot;[OneMax::f] binary instance cannot be null&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;return 0;&lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In order to avoid multiple evaluations of the same &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x, a caching mechanism has been implemented.&lt;br /&gt;
&lt;br /&gt;
Moreover, you are asked to implement the &amp;lt;code&amp;gt;exportInteration&amp;lt;/code&amp;gt; function, which return an &amp;lt;code&amp;gt;HyperGraph&amp;lt;/code&amp;gt; which represents the interactions present in the function. In order to determine such hypergraph, start from the polinomial representation of the function, and for each monomial introduce a new hyperedge in the hypergraph.&lt;br /&gt;
&lt;br /&gt;
For the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; function, such representation corresponds to the independence graph, since such function is linear. &lt;br /&gt;
&lt;br /&gt;
  HyperGraph* OneMax::exportInteractions() {&lt;br /&gt;
  &amp;amp;nbsp;HyperGraph *interactions = new HyperGraph();&lt;br /&gt;
  &amp;amp;nbsp;interactions-&amp;gt;createIndependenceGraph(_size);&lt;br /&gt;
  &amp;amp;nbsp;return interactions;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;Evoptool.h&amp;lt;/code&amp;gt; add an entry in the &amp;lt;code&amp;gt;Tasks&amp;lt;/code&amp;gt; enum.&lt;br /&gt;
&lt;br /&gt;
  /* This enumeration defines an identifier for each task function. */&lt;br /&gt;
  typedef enum {&lt;br /&gt;
  &amp;amp;nbsp;ONE_MAX = 7,&lt;br /&gt;
  } Tasks;&lt;br /&gt;
&lt;br /&gt;
This value will identify uniquely the benchmark in the xml file. In the &amp;lt;code&amp;gt;XMLParser.cpp&amp;lt;/code&amp;gt; file, add an entry for the new function.&lt;br /&gt;
&lt;br /&gt;
  bool XMLParser::parseTask(xmlpp::TextReader &amp;amp;reader, Evoptool::TestParameters *params) {&lt;br /&gt;
  &amp;amp;nbsp;.. &lt;br /&gt;
  &amp;amp;nbsp;switch (task) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;case Evoptool::ONE_MAX: params-&amp;gt;task = new OneMax(size);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;break;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;..&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;default: return false; &lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;..&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Additional parameters can be obtained using the xml TextReader object, as for the &amp;lt;code&amp;gt;ForPeaks&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
  case Evoptool::FOUR_PEAKS: &lt;br /&gt;
  &amp;amp;nbsp;value = readNodeContent(reader, &amp;quot;peaks&amp;quot;, &amp;amp;errorFlag);&lt;br /&gt;
  &amp;amp;nbsp;if (errorFlag) return false;&lt;br /&gt;
  &amp;amp;nbsp;int peaks = toInt(value);&lt;br /&gt;
  &amp;amp;nbsp;params-&amp;gt;task = new FourPeaks(size, peaks);&lt;br /&gt;
  &amp;amp;nbsp;break; &lt;br /&gt;
&lt;br /&gt;
Finally in the xml file, a function can set with the &amp;lt;code&amp;gt;task&amp;lt;/code&amp;gt; tag, together with all parameters.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;task&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;name&amp;gt;7&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;size&amp;gt;64&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;/task&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== To create a new algorithm ====&lt;br /&gt;
&lt;br /&gt;
1. Implement a new algorithm&lt;br /&gt;
&lt;br /&gt;
All algorithms must inherit from the Algorithm class. First override the Algorithm::initAlgorithm as follows:&lt;br /&gt;
&lt;br /&gt;
  void DEUM::initAlgorithm(ObjectiveFunction* of) {&lt;br /&gt;
    Algorithm::initAlgorithm(of);&lt;br /&gt;
  &lt;br /&gt;
    /* Initialization tasks */&lt;br /&gt;
    ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Then implement a run() method which performs al the required task for '''one''' iteration of your algorithm.&lt;br /&gt;
&lt;br /&gt;
There are some classes which contain useful methods such as samplers and estimators from which your algorithm can inherit. The most useful are:&lt;br /&gt;
&lt;br /&gt;
  PopulationBasedAlgorithm&lt;br /&gt;
  ModelBasedAlgorithm&lt;br /&gt;
  ExponentialFamilyAlgorithm&lt;br /&gt;
  BayesianNetworkBasedAlgorithm&lt;br /&gt;
&lt;br /&gt;
2. Append entry in the &amp;lt;tt&amp;gt;Algorithms&amp;lt;/tt&amp;gt; enum in Evoptool.h.&lt;br /&gt;
&lt;br /&gt;
  typedef enum {&lt;br /&gt;
    ...&lt;br /&gt;
    DEUM    // 5&lt;br /&gt;
  } Algorithms;&lt;br /&gt;
&lt;br /&gt;
In the xml configuration file, your algorithm will be characterized by the int value associated with the position in this enum declaration.&lt;br /&gt;
&lt;br /&gt;
3. modify the file&lt;br /&gt;
core/src/XMLParser.cpp. Search for the method &amp;lt;tt&amp;gt;bool XMLParser::parseAlgorithms&amp;lt;/tt&amp;gt; and insert an new entry for your algorithm in the &amp;lt;tt&amp;gt;algorithmParameters&amp;lt;/tt&amp;gt; array, for example&lt;br /&gt;
&lt;br /&gt;
  AlgorithmParameters algorithmParameters[] = {&lt;br /&gt;
    ...&lt;br /&gt;
    { Evoptool::DEUM, 5, (char*) &amp;quot;IDDDI&amp;quot; }, // Pop, percElitism, percSelec, CoolRate, GibbsIterations&lt;br /&gt;
    ...&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
In each entry, the first field is the name of the entry in the &amp;lt;tt&amp;gt;Algorithms&amp;lt;/tt&amp;gt; enum just modified in &amp;lt;tt&amp;gt;Evoptool.h&amp;lt;/tt&amp;gt;, the second is the number of parameters to be parsed in the xml configuration file and the third is a string specifying their type: &amp;lt;tt&amp;gt;I&amp;lt;/tt&amp;gt; for integer and &amp;lt;tt&amp;gt;D&amp;lt;/tt&amp;gt; for double.&lt;br /&gt;
&lt;br /&gt;
4. add a case in the switch that follows in &amp;lt;tt&amp;gt;bool XMLParser::parseAlgorithms&amp;lt;/tt&amp;gt;, for instance:&lt;br /&gt;
&lt;br /&gt;
  case Evoptool::DEUM: &lt;br /&gt;
    algos[i] = new extendedFCA(intVal[0], doubleVal[0], doubleVal[1], intVal[1], intVal[2], params-&amp;gt;rng);&lt;br /&gt;
    algos[i]-&amp;gt;initAlgorithm(params-&amp;gt;task);&lt;br /&gt;
    break;&lt;br /&gt;
&lt;br /&gt;
Note that your algorithm can employ the random number generator provided by the Evoptool core, &amp;lt;tt&amp;gt;params-&amp;gt;rng&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
5. Include your headers in core/src/Algorithms.h&lt;br /&gt;
&lt;br /&gt;
6. Document how your algorithm is instantiated in the comments appearing in evoptool-file/exec-scripts/example.xml&lt;br /&gt;
&lt;br /&gt;
   Algorithm  Id    Types    Parameters&lt;br /&gt;
  =====================================================================================================&lt;br /&gt;
    ...&lt;br /&gt;
    FCA       26    &amp;quot;IDDII&amp;quot;  (Pop, PercSelection, LearningRate, MaxCompositionLenght, MaxMonomialOrder)&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
7. Add an instantiation example for your algorithm in evoptool-file/exec-scripts/example.xml&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!algo id=&amp;quot;26&amp;quot; instanceName=&amp;quot;FCA&amp;quot;&amp;gt;  &lt;br /&gt;
    &amp;lt;int&amp;gt;1000&amp;lt;/int&amp;gt;&lt;br /&gt;
    &amp;lt;double&amp;gt;0.5&amp;lt;/double&amp;gt;&lt;br /&gt;
    &amp;lt;double&amp;gt;1&amp;lt;/double&amp;gt;&lt;br /&gt;
    &amp;lt;int&amp;gt;64&amp;lt;/int&amp;gt;&lt;br /&gt;
    &amp;lt;int&amp;gt;2&amp;lt;/int&amp;gt;&lt;br /&gt;
  &amp;lt;/algo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Run an algorithm in a C++ program ====&lt;br /&gt;
&lt;br /&gt;
The simplest way to do this is to create a new submodule in &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;, i.e., a new source directory within the source directory of a module&lt;br /&gt;
For instance, the steps to create a new submodule named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; are&lt;br /&gt;
&lt;br /&gt;
1. copy the example submodule &amp;lt;code&amp;gt;exampleRunAlgorithm&amp;lt;/code&amp;gt; in a new folder named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; in&lt;br /&gt;
&lt;br /&gt;
  evoptool/core/src&lt;br /&gt;
&lt;br /&gt;
2. modify the &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; directory, see comments in the makefile for more details.&lt;br /&gt;
&lt;br /&gt;
3. edit the &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; function in the source file, if you need you can create other C++ and .h files in the same folder.&lt;br /&gt;
&lt;br /&gt;
4. from &amp;lt;code&amp;gt;evoptool/core/src/myexample&amp;lt;/code&amp;gt; run&lt;br /&gt;
&lt;br /&gt;
  make bin&lt;br /&gt;
&lt;br /&gt;
The bin file is create in &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; and copied in &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTICE that &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; may be deleted after a &amp;lt;code&amp;gt;make cleanall&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. from &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt; run &lt;br /&gt;
&lt;br /&gt;
  ./myexample&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14165</id>
		<title>Evoptool: Evolutionary Optimization Tool</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14165"/>
				<updated>2011-10-24T10:35:15Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: /* To create a new algorithm (draft) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
Evolutionary Optimization Tool (Evoptool) is an open source optimization tool writte in C++, distributed under GNU General Public License. Evoptool implements meta-heuristics based on the Evolutionary Computation paradigm and aims to provide a common platform for the development and test of new algorithms, in order to facilitate the performance comparison activity. Evoptool offers a wide set of benchmark problems, from classical toy samples to more complex tasks, and a collection of algorithm implementations from Genetic Algorithms and Estimation of Distribution Algorithms paradigms. Evoptool is flexible, easy to extend, also with algorithms based on other approaches other from EAs.&lt;br /&gt;
&lt;br /&gt;
== The Evoptool Team ==&lt;br /&gt;
&lt;br /&gt;
*[[User:MatteoMatteucci| Matteo Matteucci]] - matteucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
*[http://www.dei.polimi.it/personale/dettaglio.php?id_persona=829&amp;amp;id_sezione=&amp;amp;lettera=M&amp;amp;idlang=ita| Luigi Malagò] - malago [AT] elet.polimi.it &lt;br /&gt;
&lt;br /&gt;
*[[User:GabrieleValentini| Gabriele Valentini]] - gvalentini [AT] iridia.ulb.ac.be&lt;br /&gt;
&lt;br /&gt;
*[[User:DavideCucci| Davide Cucci]] - cucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
'''Formerly involved'''&lt;br /&gt;
*Emanuele Corsano&lt;br /&gt;
&lt;br /&gt;
== Mailing List ==&lt;br /&gt;
http://groups.google.com/group/evoptool&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Developers may also access unstable branch. Contact the evoptool team for more details.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
Follow these steps in order to compile evoptool&lt;br /&gt;
&lt;br /&gt;
1. Download source code from svn&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Refer to trunk for the lastest (stable?) version of evoptool&lt;br /&gt;
&lt;br /&gt;
2. First you need to manually compile the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; package, http://www.stanford.edu/~boyd/l1_logreg/&lt;br /&gt;
whose source are already included in the evoptool repository. In order to do that follow the instrunctions in &lt;br /&gt;
&amp;lt;code&amp;gt;README.evoptool&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
Next, compile &amp;lt;code&amp;gt;&amp;lt;id_dist/code&amp;gt; following the instructions in &amp;lt;code&amp;gt;README.evoptool&amp;lt;code&amp;gt; in the &amp;lt;code&amp;gt;&amp;lt;id_dist&amp;lt;/code&amp;gt; folder&lt;br /&gt;
&lt;br /&gt;
3. Then you need to compile a module at a time. Each module is included in a different folder. &lt;br /&gt;
To compile a module, from go to the module source folder and do make lib. For instance, for the module named &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  cd common/src&lt;br /&gt;
  make lib&lt;br /&gt;
  cd ..&lt;br /&gt;
&lt;br /&gt;
Compile modules in the following orderm due to dependencies&lt;br /&gt;
&lt;br /&gt;
  common&lt;br /&gt;
  functions&lt;br /&gt;
  ga&lt;br /&gt;
  stochastic&lt;br /&gt;
  eda&lt;br /&gt;
&lt;br /&gt;
To clean a module, do &lt;br /&gt;
&lt;br /&gt;
  make clean&lt;br /&gt;
&lt;br /&gt;
from the module source directory&lt;br /&gt;
&lt;br /&gt;
4. Go to &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;  module and type&lt;br /&gt;
&lt;br /&gt;
  make exe&lt;br /&gt;
&lt;br /&gt;
Binary files will be copied in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root as well as the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory of the &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt; module&lt;br /&gt;
&lt;br /&gt;
'''Required packages'''&lt;br /&gt;
* Libraries&lt;br /&gt;
&lt;br /&gt;
** ''gtkmm-2.4''&lt;br /&gt;
** ''glademm-2.4''&lt;br /&gt;
** ''gthread-2.0''&lt;br /&gt;
** ''sigc++-2.0''&lt;br /&gt;
** ''opencv'' (see for instance http://www.samontab.com/web/2011/06/installing-opencv-2-2-in-ubuntu-11-04/)&lt;br /&gt;
** ''gsl''&lt;br /&gt;
** ''gslcblas''&lt;br /&gt;
** ''libxml++-2.6''&lt;br /&gt;
** '''f2c''&lt;br /&gt;
&lt;br /&gt;
* Software&lt;br /&gt;
** ''gnuplot''&lt;br /&gt;
&lt;br /&gt;
== Running  ==&lt;br /&gt;
&lt;br /&gt;
Right now &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; only runs as a script. GUI is not maintained in the latest version.&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; binary file is supposed to be run in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root, this is because right now the script looks for some configuration files, for the instances of the problems, and temp directories. If you want to run the script from other directories, you just need to copy in that directory the &amp;lt;code&amp;gt;evoptool-file&amp;lt;/code&amp;gt; directory that you find in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory. Link such directory instead of copying it is not safe if you run multiple scripts at the same time, since output files will be shared. &lt;br /&gt;
&lt;br /&gt;
To run the algorithm you need to enter as input an xml file. For instance you can run&lt;br /&gt;
&lt;br /&gt;
  ./evoptool evoptool-file/examples/unitTestOneMax.xml&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool-file/example&amp;lt;/code&amp;gt; directory contains a set of xml files for different benchmarks and different algorithms.&lt;br /&gt;
Take a loot at the &amp;lt;code&amp;gt;example.xml&amp;lt;/code&amp;gt; file for the documentation on hoe to set the parameters for an each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; produces a set of files as output. You can find all files in &amp;lt;code&amp;gt;evoptool-file/temp&amp;lt;/code&amp;gt; directory. Plus a tar.gz file containing such files can be produced at the end of the execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. See the xml file for details.&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/data&lt;br /&gt;
contains the raw data of the statistics according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/gnuplot&lt;br /&gt;
contains the gnuplot files to produce images of the statistics&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/image&lt;br /&gt;
contains images of the statistics produced according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/support&lt;br /&gt;
contains logs&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
==== Implement a new benchmark function====&lt;br /&gt;
&lt;br /&gt;
Benchmarks are defined in the &amp;lt;code&amp;gt;function&amp;lt;/code&amp;gt; module. A benchmark is the maximization problem of a real valued function defined over a vector of n binary variables. Functions are maximized in &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. In order to implement a new benchmark function you have to create a new &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt; that inherits from &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt; module. Take a look at the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; benchmark function.&lt;br /&gt;
&lt;br /&gt;
Among the arguments of the constructor of the &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; class there must be the size of the benchmark, which may or may not be a parameter of the new benchmark.&lt;br /&gt;
&lt;br /&gt;
  OneMax::OneMax(int size) : ObjectiveFunction(size)&lt;br /&gt;
&lt;br /&gt;
In the constructor you have whether the maximum of the function is known or not&lt;br /&gt;
&lt;br /&gt;
   _knownSolution = true;&lt;br /&gt;
&lt;br /&gt;
And in case this is known, set the minimum value and maximum value for the function&lt;br /&gt;
&lt;br /&gt;
 _minFitness = 0; &lt;br /&gt;
 _maxFitness = size; //the maximum value of the OneMax function is defined as the sum of the bits of x set to one.&lt;br /&gt;
&lt;br /&gt;
Besides, such values are used in the normalization of the functions in the plots of the statistics.&lt;br /&gt;
&lt;br /&gt;
Each benchmark must implement the &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; method, which takes the &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x and return f(x). For instance, for &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; you have&lt;br /&gt;
&lt;br /&gt;
  double OneMax::f(BinaryString *bi) {&lt;br /&gt;
  &amp;amp;nbsp;if (bi != NULL) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;if(!(bi-&amp;gt;validCache())) { &lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;/* Fitness cache value not valid */&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;int sum = 0;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;for (int j = 0; j &amp;lt; _size; j++) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;sum = sum + bi-&amp;gt;get(j);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;bi-&amp;gt;setFitnessCache(sum);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return sum;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return bi-&amp;gt;getFitnessCache();&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;cerr &amp;lt;&amp;lt; &amp;quot;[OneMax::f] binary instance cannot be null&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;return 0;&lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In order to avoid multiple evaluations of the same &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x, a caching mechanism has been implemented.&lt;br /&gt;
&lt;br /&gt;
Moreover, you are asked to implement the &amp;lt;code&amp;gt;exportInteration&amp;lt;/code&amp;gt; function, which return an &amp;lt;code&amp;gt;HyperGraph&amp;lt;/code&amp;gt; which represents the interactions present in the function. In order to determine such hypergraph, start from the polinomial representation of the function, and for each monomial introduce a new hyperedge in the hypergraph.&lt;br /&gt;
&lt;br /&gt;
For the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; function, such representation corresponds to the independence graph, since such function is linear. &lt;br /&gt;
&lt;br /&gt;
  HyperGraph* OneMax::exportInteractions() {&lt;br /&gt;
  &amp;amp;nbsp;HyperGraph *interactions = new HyperGraph();&lt;br /&gt;
  &amp;amp;nbsp;interactions-&amp;gt;createIndependenceGraph(_size);&lt;br /&gt;
  &amp;amp;nbsp;return interactions;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;Evoptool.h&amp;lt;/code&amp;gt; add an entry in the &amp;lt;code&amp;gt;Tasks&amp;lt;/code&amp;gt; enum.&lt;br /&gt;
&lt;br /&gt;
  /* This enumeration defines an identifier for each task function. */&lt;br /&gt;
  typedef enum {&lt;br /&gt;
  &amp;amp;nbsp;ONE_MAX = 7,&lt;br /&gt;
  } Tasks;&lt;br /&gt;
&lt;br /&gt;
This value will identify uniquely the benchmark in the xml file. In the &amp;lt;code&amp;gt;XMLParser.cpp&amp;lt;/code&amp;gt; file, add an entry for the new function.&lt;br /&gt;
&lt;br /&gt;
  bool XMLParser::parseTask(xmlpp::TextReader &amp;amp;reader, Evoptool::TestParameters *params) {&lt;br /&gt;
  &amp;amp;nbsp;.. &lt;br /&gt;
  &amp;amp;nbsp;switch (task) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;case Evoptool::ONE_MAX: params-&amp;gt;task = new OneMax(size);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;break;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;..&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;default: return false; &lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;..&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Additional parameters can be obtained using the xml TextReader object, as for the &amp;lt;code&amp;gt;ForPeaks&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
  case Evoptool::FOUR_PEAKS: &lt;br /&gt;
  &amp;amp;nbsp;value = readNodeContent(reader, &amp;quot;peaks&amp;quot;, &amp;amp;errorFlag);&lt;br /&gt;
  &amp;amp;nbsp;if (errorFlag) return false;&lt;br /&gt;
  &amp;amp;nbsp;int peaks = toInt(value);&lt;br /&gt;
  &amp;amp;nbsp;params-&amp;gt;task = new FourPeaks(size, peaks);&lt;br /&gt;
  &amp;amp;nbsp;break; &lt;br /&gt;
&lt;br /&gt;
Finally in the xml file, a function can set with the &amp;lt;code&amp;gt;task&amp;lt;/code&amp;gt; tag, together with all parameters.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;task&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;name&amp;gt;7&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;size&amp;gt;64&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;/task&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== To create a new algorithm ====&lt;br /&gt;
&lt;br /&gt;
1. Implement a new algorithm&lt;br /&gt;
&lt;br /&gt;
All algorithms must inherit from the Algorithm class. First override the Algorithm::initAlgorithm as follows:&lt;br /&gt;
&lt;br /&gt;
  void DEUM::initAlgorithm(ObjectiveFunction* of) {&lt;br /&gt;
    Algorithm::initAlgorithm(of);&lt;br /&gt;
  &lt;br /&gt;
    /* Initialization tasks */&lt;br /&gt;
    ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Then implement a run() method which performs al the required task for '''one''' iteration of your algorithm.&lt;br /&gt;
&lt;br /&gt;
2. Append entry in the &amp;lt;tt&amp;gt;Algorithms&amp;lt;/tt&amp;gt; enum in Evoptool.h.&lt;br /&gt;
&lt;br /&gt;
  typedef enum {&lt;br /&gt;
    ...&lt;br /&gt;
    DEUM    // 5&lt;br /&gt;
  } Algorithms;&lt;br /&gt;
&lt;br /&gt;
In the xml configuration file, your algorithm will be characterized by the int value associated with the position in this enum declaration.&lt;br /&gt;
&lt;br /&gt;
3. modify the file&lt;br /&gt;
core/src/XMLParser.cpp. Search for the method &amp;lt;tt&amp;gt;bool XMLParser::parseAlgorithms&amp;lt;/tt&amp;gt; and insert an new entry for your algorithm in the &amp;lt;tt&amp;gt;algorithmParameters&amp;lt;/tt&amp;gt; array, for example&lt;br /&gt;
&lt;br /&gt;
  AlgorithmParameters algorithmParameters[] = {&lt;br /&gt;
    ...&lt;br /&gt;
    { Evoptool::DEUM, 5, (char*) &amp;quot;IDDDI&amp;quot; }, // Pop, percElitism, percSelec, CoolRate, GibbsIterations&lt;br /&gt;
    ...&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
In each entry, the first field is the name of the entry in the &amp;lt;tt&amp;gt;Algorithms&amp;lt;/tt&amp;gt; enum just modified in &amp;lt;tt&amp;gt;Evoptool.h&amp;lt;/tt&amp;gt;, the second is the number of parameters to be parsed in the xml configuration file and the third is a string specifying their type: &amp;lt;tt&amp;gt;I&amp;lt;/tt&amp;gt; for integer and &amp;lt;tt&amp;gt;D&amp;lt;/tt&amp;gt; for double.&lt;br /&gt;
&lt;br /&gt;
4. add a case in the switch that follows in &amp;lt;tt&amp;gt;bool XMLParser::parseAlgorithms&amp;lt;/tt&amp;gt;, for instance:&lt;br /&gt;
&lt;br /&gt;
  case Evoptool::DEUM: &lt;br /&gt;
    algos[i] = new extendedFCA(intVal[0], doubleVal[0], doubleVal[1], intVal[1], intVal[2], params-&amp;gt;rng);&lt;br /&gt;
    algos[i]-&amp;gt;initAlgorithm(params-&amp;gt;task);&lt;br /&gt;
    break;&lt;br /&gt;
&lt;br /&gt;
Note that your algorithm can employ the random number generator provided by the Evoptool core, &amp;lt;tt&amp;gt;params-&amp;gt;rng&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
5. Include your headers in core/src/Algorithms.h&lt;br /&gt;
&lt;br /&gt;
6. Document how your algorithm is instantiated in the comments appearing in evoptool-file/exec-scripts/example.xml&lt;br /&gt;
&lt;br /&gt;
   Algorithm  Id    Types    Parameters&lt;br /&gt;
  =====================================================================================================&lt;br /&gt;
    ...&lt;br /&gt;
    FCA       26    &amp;quot;IDDII&amp;quot;  (Pop, PercSelection, LearningRate, MaxCompositionLenght, MaxMonomialOrder)&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
7. Add an instantiation example for your algorithm in evoptool-file/exec-scripts/example.xml&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!algo id=&amp;quot;26&amp;quot; instanceName=&amp;quot;FCA&amp;quot;&amp;gt;  &lt;br /&gt;
    &amp;lt;int&amp;gt;1000&amp;lt;/int&amp;gt;&lt;br /&gt;
    &amp;lt;double&amp;gt;0.5&amp;lt;/double&amp;gt;&lt;br /&gt;
    &amp;lt;double&amp;gt;1&amp;lt;/double&amp;gt;&lt;br /&gt;
    &amp;lt;int&amp;gt;64&amp;lt;/int&amp;gt;&lt;br /&gt;
    &amp;lt;int&amp;gt;2&amp;lt;/int&amp;gt;&lt;br /&gt;
  &amp;lt;/algo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Run an algorithm in a C++ program ====&lt;br /&gt;
&lt;br /&gt;
The simplest way to do this is to create a new submodule in &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;, i.e., a new source directory within the source directory of a module&lt;br /&gt;
For instance, the steps to create a new submodule named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; are&lt;br /&gt;
&lt;br /&gt;
1. copy the example submodule &amp;lt;code&amp;gt;exampleRunAlgorithm&amp;lt;/code&amp;gt; in a new folder named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; in&lt;br /&gt;
&lt;br /&gt;
  evoptool/core/src&lt;br /&gt;
&lt;br /&gt;
2. modify the &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; directory, see comments in the makefile for more details.&lt;br /&gt;
&lt;br /&gt;
3. edit the &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; function in the source file, if you need you can create other C++ and .h files in the same folder.&lt;br /&gt;
&lt;br /&gt;
4. from &amp;lt;code&amp;gt;evoptool/core/src/myexample&amp;lt;/code&amp;gt; run&lt;br /&gt;
&lt;br /&gt;
  make bin&lt;br /&gt;
&lt;br /&gt;
The bin file is create in &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; and copied in &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTICE that &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; may be deleted after a &amp;lt;code&amp;gt;make cleanall&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. from &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt; run &lt;br /&gt;
&lt;br /&gt;
  ./myexample&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14164</id>
		<title>Evoptool: Evolutionary Optimization Tool</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14164"/>
				<updated>2011-10-24T10:19:41Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: /* To create a new algorithm (draft) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
Evolutionary Optimization Tool (Evoptool) is an open source optimization tool writte in C++, distributed under GNU General Public License. Evoptool implements meta-heuristics based on the Evolutionary Computation paradigm and aims to provide a common platform for the development and test of new algorithms, in order to facilitate the performance comparison activity. Evoptool offers a wide set of benchmark problems, from classical toy samples to more complex tasks, and a collection of algorithm implementations from Genetic Algorithms and Estimation of Distribution Algorithms paradigms. Evoptool is flexible, easy to extend, also with algorithms based on other approaches other from EAs.&lt;br /&gt;
&lt;br /&gt;
== The Evoptool Team ==&lt;br /&gt;
&lt;br /&gt;
*[[User:MatteoMatteucci| Matteo Matteucci]] - matteucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
*[http://www.dei.polimi.it/personale/dettaglio.php?id_persona=829&amp;amp;id_sezione=&amp;amp;lettera=M&amp;amp;idlang=ita| Luigi Malagò] - malago [AT] elet.polimi.it &lt;br /&gt;
&lt;br /&gt;
*[[User:GabrieleValentini| Gabriele Valentini]] - gvalentini [AT] iridia.ulb.ac.be&lt;br /&gt;
&lt;br /&gt;
*[[User:DavideCucci| Davide Cucci]] - cucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
'''Formerly involved'''&lt;br /&gt;
*Emanuele Corsano&lt;br /&gt;
&lt;br /&gt;
== Mailing List ==&lt;br /&gt;
http://groups.google.com/group/evoptool&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Developers may also access unstable branch. Contact the evoptool team for more details.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
Follow these steps in order to compile evoptool&lt;br /&gt;
&lt;br /&gt;
1. Download source code from svn&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Refer to trunk for the lastest (stable?) version of evoptool&lt;br /&gt;
&lt;br /&gt;
2. First you need to manually compile the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; package, http://www.stanford.edu/~boyd/l1_logreg/&lt;br /&gt;
whose source are already included in the evoptool repository. In order to do that follow the instrunctions in &lt;br /&gt;
&amp;lt;code&amp;gt;README.evoptool&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
Next, compile &amp;lt;code&amp;gt;&amp;lt;id_dist/code&amp;gt; following the instructions in &amp;lt;code&amp;gt;README.evoptool&amp;lt;code&amp;gt; in the &amp;lt;code&amp;gt;&amp;lt;id_dist&amp;lt;/code&amp;gt; folder&lt;br /&gt;
&lt;br /&gt;
3. Then you need to compile a module at a time. Each module is included in a different folder. &lt;br /&gt;
To compile a module, from go to the module source folder and do make lib. For instance, for the module named &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  cd common/src&lt;br /&gt;
  make lib&lt;br /&gt;
  cd ..&lt;br /&gt;
&lt;br /&gt;
Compile modules in the following orderm due to dependencies&lt;br /&gt;
&lt;br /&gt;
  common&lt;br /&gt;
  functions&lt;br /&gt;
  ga&lt;br /&gt;
  stochastic&lt;br /&gt;
  eda&lt;br /&gt;
&lt;br /&gt;
To clean a module, do &lt;br /&gt;
&lt;br /&gt;
  make clean&lt;br /&gt;
&lt;br /&gt;
from the module source directory&lt;br /&gt;
&lt;br /&gt;
4. Go to &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;  module and type&lt;br /&gt;
&lt;br /&gt;
  make exe&lt;br /&gt;
&lt;br /&gt;
Binary files will be copied in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root as well as the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory of the &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt; module&lt;br /&gt;
&lt;br /&gt;
'''Required packages'''&lt;br /&gt;
* Libraries&lt;br /&gt;
&lt;br /&gt;
** ''gtkmm-2.4''&lt;br /&gt;
** ''glademm-2.4''&lt;br /&gt;
** ''gthread-2.0''&lt;br /&gt;
** ''sigc++-2.0''&lt;br /&gt;
** ''opencv'' (see for instance http://www.samontab.com/web/2011/06/installing-opencv-2-2-in-ubuntu-11-04/)&lt;br /&gt;
** ''gsl''&lt;br /&gt;
** ''gslcblas''&lt;br /&gt;
** ''libxml++-2.6''&lt;br /&gt;
** '''f2c''&lt;br /&gt;
&lt;br /&gt;
* Software&lt;br /&gt;
** ''gnuplot''&lt;br /&gt;
&lt;br /&gt;
== Running  ==&lt;br /&gt;
&lt;br /&gt;
Right now &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; only runs as a script. GUI is not maintained in the latest version.&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; binary file is supposed to be run in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root, this is because right now the script looks for some configuration files, for the instances of the problems, and temp directories. If you want to run the script from other directories, you just need to copy in that directory the &amp;lt;code&amp;gt;evoptool-file&amp;lt;/code&amp;gt; directory that you find in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory. Link such directory instead of copying it is not safe if you run multiple scripts at the same time, since output files will be shared. &lt;br /&gt;
&lt;br /&gt;
To run the algorithm you need to enter as input an xml file. For instance you can run&lt;br /&gt;
&lt;br /&gt;
  ./evoptool evoptool-file/examples/unitTestOneMax.xml&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool-file/example&amp;lt;/code&amp;gt; directory contains a set of xml files for different benchmarks and different algorithms.&lt;br /&gt;
Take a loot at the &amp;lt;code&amp;gt;example.xml&amp;lt;/code&amp;gt; file for the documentation on hoe to set the parameters for an each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; produces a set of files as output. You can find all files in &amp;lt;code&amp;gt;evoptool-file/temp&amp;lt;/code&amp;gt; directory. Plus a tar.gz file containing such files can be produced at the end of the execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. See the xml file for details.&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/data&lt;br /&gt;
contains the raw data of the statistics according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/gnuplot&lt;br /&gt;
contains the gnuplot files to produce images of the statistics&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/image&lt;br /&gt;
contains images of the statistics produced according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/support&lt;br /&gt;
contains logs&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
==== Implement a new benchmark function====&lt;br /&gt;
&lt;br /&gt;
Benchmarks are defined in the &amp;lt;code&amp;gt;function&amp;lt;/code&amp;gt; module. A benchmark is the maximization problem of a real valued function defined over a vector of n binary variables. Functions are maximized in &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. In order to implement a new benchmark function you have to create a new &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt; that inherits from &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt; module. Take a look at the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; benchmark function.&lt;br /&gt;
&lt;br /&gt;
Among the arguments of the constructor of the &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; class there must be the size of the benchmark, which may or may not be a parameter of the new benchmark.&lt;br /&gt;
&lt;br /&gt;
  OneMax::OneMax(int size) : ObjectiveFunction(size)&lt;br /&gt;
&lt;br /&gt;
In the constructor you have whether the maximum of the function is known or not&lt;br /&gt;
&lt;br /&gt;
   _knownSolution = true;&lt;br /&gt;
&lt;br /&gt;
And in case this is known, set the minimum value and maximum value for the function&lt;br /&gt;
&lt;br /&gt;
 _minFitness = 0; &lt;br /&gt;
 _maxFitness = size; //the maximum value of the OneMax function is defined as the sum of the bits of x set to one.&lt;br /&gt;
&lt;br /&gt;
Besides, such values are used in the normalization of the functions in the plots of the statistics.&lt;br /&gt;
&lt;br /&gt;
Each benchmark must implement the &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; method, which takes the &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x and return f(x). For instance, for &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; you have&lt;br /&gt;
&lt;br /&gt;
  double OneMax::f(BinaryString *bi) {&lt;br /&gt;
  &amp;amp;nbsp;if (bi != NULL) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;if(!(bi-&amp;gt;validCache())) { &lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;/* Fitness cache value not valid */&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;int sum = 0;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;for (int j = 0; j &amp;lt; _size; j++) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;sum = sum + bi-&amp;gt;get(j);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;bi-&amp;gt;setFitnessCache(sum);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return sum;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return bi-&amp;gt;getFitnessCache();&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;cerr &amp;lt;&amp;lt; &amp;quot;[OneMax::f] binary instance cannot be null&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;return 0;&lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In order to avoid multiple evaluations of the same &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x, a caching mechanism has been implemented.&lt;br /&gt;
&lt;br /&gt;
Moreover, you are asked to implement the &amp;lt;code&amp;gt;exportInteration&amp;lt;/code&amp;gt; function, which return an &amp;lt;code&amp;gt;HyperGraph&amp;lt;/code&amp;gt; which represents the interactions present in the function. In order to determine such hypergraph, start from the polinomial representation of the function, and for each monomial introduce a new hyperedge in the hypergraph.&lt;br /&gt;
&lt;br /&gt;
For the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; function, such representation corresponds to the independence graph, since such function is linear. &lt;br /&gt;
&lt;br /&gt;
  HyperGraph* OneMax::exportInteractions() {&lt;br /&gt;
  &amp;amp;nbsp;HyperGraph *interactions = new HyperGraph();&lt;br /&gt;
  &amp;amp;nbsp;interactions-&amp;gt;createIndependenceGraph(_size);&lt;br /&gt;
  &amp;amp;nbsp;return interactions;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;Evoptool.h&amp;lt;/code&amp;gt; add an entry in the &amp;lt;code&amp;gt;Tasks&amp;lt;/code&amp;gt; enum.&lt;br /&gt;
&lt;br /&gt;
  /* This enumeration defines an identifier for each task function. */&lt;br /&gt;
  typedef enum {&lt;br /&gt;
  &amp;amp;nbsp;ONE_MAX = 7,&lt;br /&gt;
  } Tasks;&lt;br /&gt;
&lt;br /&gt;
This value will identify uniquely the benchmark in the xml file. In the &amp;lt;code&amp;gt;XMLParser.cpp&amp;lt;/code&amp;gt; file, add an entry for the new function.&lt;br /&gt;
&lt;br /&gt;
  bool XMLParser::parseTask(xmlpp::TextReader &amp;amp;reader, Evoptool::TestParameters *params) {&lt;br /&gt;
  &amp;amp;nbsp;.. &lt;br /&gt;
  &amp;amp;nbsp;switch (task) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;case Evoptool::ONE_MAX: params-&amp;gt;task = new OneMax(size);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;break;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;..&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;default: return false; &lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;..&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Additional parameters can be obtained using the xml TextReader object, as for the &amp;lt;code&amp;gt;ForPeaks&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
  case Evoptool::FOUR_PEAKS: &lt;br /&gt;
  &amp;amp;nbsp;value = readNodeContent(reader, &amp;quot;peaks&amp;quot;, &amp;amp;errorFlag);&lt;br /&gt;
  &amp;amp;nbsp;if (errorFlag) return false;&lt;br /&gt;
  &amp;amp;nbsp;int peaks = toInt(value);&lt;br /&gt;
  &amp;amp;nbsp;params-&amp;gt;task = new FourPeaks(size, peaks);&lt;br /&gt;
  &amp;amp;nbsp;break; &lt;br /&gt;
&lt;br /&gt;
Finally in the xml file, a function can set with the &amp;lt;code&amp;gt;task&amp;lt;/code&amp;gt; tag, together with all parameters.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;task&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;name&amp;gt;7&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;size&amp;gt;64&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;/task&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== To create a new algorithm (draft) ====&lt;br /&gt;
&lt;br /&gt;
1. Implement a new algorithm&lt;br /&gt;
&lt;br /&gt;
All algorithms must inherit from the Algorithm class. First override the Algorithm::initAlgorithm as follows:&lt;br /&gt;
&lt;br /&gt;
  void DEUM::initAlgorithm(ObjectiveFunction* of) {&lt;br /&gt;
    Algorithm::initAlgorithm(of);&lt;br /&gt;
  &lt;br /&gt;
    /* Initialization tasks */&lt;br /&gt;
    ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Then implement a run() method which performs al the required task for '''one''' iteration of your algorithm.&lt;br /&gt;
&lt;br /&gt;
2. Append entry in the &amp;lt;tt&amp;gt;Algorithms&amp;lt;/tt&amp;gt; enum in Evoptool.h.&lt;br /&gt;
&lt;br /&gt;
  typedef enum {&lt;br /&gt;
    ...&lt;br /&gt;
    DEUM&lt;br /&gt;
  } Algorithms;&lt;br /&gt;
&lt;br /&gt;
In the xml configuration file, your algorithm will be characterized by the int value associated with the position in this enum declaration.&lt;br /&gt;
&lt;br /&gt;
3. modify the file&lt;br /&gt;
core/src/XMLParser.cpp. Search for the method &amp;lt;tt&amp;gt;bool XMLParser::parseAlgorithms&amp;lt;/tt&amp;gt; and insert an new entry for your algorithm in the &amp;lt;tt&amp;gt;algorithmParameters&amp;lt;/tt&amp;gt; array, for example&lt;br /&gt;
&lt;br /&gt;
  AlgorithmParameters algorithmParameters[] = {&lt;br /&gt;
    ...&lt;br /&gt;
    { Evoptool::DEUM, 5, (char*) &amp;quot;IDDDI&amp;quot; }, // Pop, percElitism, percSelec, CoolRate, GibbsIterations&lt;br /&gt;
    ...&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
In each entry, the first field is the name of the entry in the &amp;lt;tt&amp;gt;Algorithms&amp;lt;/tt&amp;gt; enum just modified in &amp;lt;tt&amp;gt;Evoptool.h&amp;lt;/tt&amp;gt;, the second is the number of parameters to be parsed in the xml configuration file and the third is a string specifying their type: &amp;lt;tt&amp;gt;I&amp;lt;/tt&amp;gt; for integer and &amp;lt;tt&amp;gt;D&amp;lt;/tt&amp;gt; for double.&lt;br /&gt;
&lt;br /&gt;
4. add a case in the switch that follows in &lt;br /&gt;
bool XMLParser::parseAlgorithms&lt;br /&gt;
&lt;br /&gt;
for instance&lt;br /&gt;
	case Evoptool::EXTENDEDFCA: &lt;br /&gt;
	  algos[i] = new extendedFCA(intVal[0], doubleVal[0], doubleVal[1], intVal[1], intVal[2], params-&amp;gt;rng);&lt;br /&gt;
	  algos[i]-&amp;gt;initAlgorithm(params-&amp;gt;task);&lt;br /&gt;
	  break;&lt;br /&gt;
&lt;br /&gt;
where the algorithm is instantiated&lt;br /&gt;
&lt;br /&gt;
5. Add an entry for your algorithm in &lt;br /&gt;
core/src/Algorithms.h&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Add a line in &lt;br /&gt;
evoptool-file/exec-scripts/example.xml&lt;br /&gt;
as a documenation for the parameters of your algorithm.&lt;br /&gt;
Choose a new Id for your algorithm&lt;br /&gt;
Types indicates then type of the parameters (the order is important) that will must be specified&lt;br /&gt;
in the xml file (see &amp;lt;algo&amp;gt;) and are passed to the constructor of the algorithm when the object is instantiated&lt;br /&gt;
I = integer&lt;br /&gt;
D = double&lt;br /&gt;
B = bool&lt;br /&gt;
&lt;br /&gt;
==== Run an algorithm in a C++ program ====&lt;br /&gt;
&lt;br /&gt;
The simplest way to do this is to create a new submodule in &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;, i.e., a new source directory within the source directory of a module&lt;br /&gt;
For instance, the steps to create a new submodule named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; are&lt;br /&gt;
&lt;br /&gt;
1. copy the example submodule &amp;lt;code&amp;gt;exampleRunAlgorithm&amp;lt;/code&amp;gt; in a new folder named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; in&lt;br /&gt;
&lt;br /&gt;
  evoptool/core/src&lt;br /&gt;
&lt;br /&gt;
2. modify the &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; directory, see comments in the makefile for more details.&lt;br /&gt;
&lt;br /&gt;
3. edit the &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; function in the source file, if you need you can create other C++ and .h files in the same folder.&lt;br /&gt;
&lt;br /&gt;
4. from &amp;lt;code&amp;gt;evoptool/core/src/myexample&amp;lt;/code&amp;gt; run&lt;br /&gt;
&lt;br /&gt;
  make bin&lt;br /&gt;
&lt;br /&gt;
The bin file is create in &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; and copied in &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTICE that &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; may be deleted after a &amp;lt;code&amp;gt;make cleanall&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. from &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt; run &lt;br /&gt;
&lt;br /&gt;
  ./myexample&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14163</id>
		<title>Evoptool: Evolutionary Optimization Tool</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14163"/>
				<updated>2011-10-24T10:16:44Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: /* To create a new algorithm (draft) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
Evolutionary Optimization Tool (Evoptool) is an open source optimization tool writte in C++, distributed under GNU General Public License. Evoptool implements meta-heuristics based on the Evolutionary Computation paradigm and aims to provide a common platform for the development and test of new algorithms, in order to facilitate the performance comparison activity. Evoptool offers a wide set of benchmark problems, from classical toy samples to more complex tasks, and a collection of algorithm implementations from Genetic Algorithms and Estimation of Distribution Algorithms paradigms. Evoptool is flexible, easy to extend, also with algorithms based on other approaches other from EAs.&lt;br /&gt;
&lt;br /&gt;
== The Evoptool Team ==&lt;br /&gt;
&lt;br /&gt;
*[[User:MatteoMatteucci| Matteo Matteucci]] - matteucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
*[http://www.dei.polimi.it/personale/dettaglio.php?id_persona=829&amp;amp;id_sezione=&amp;amp;lettera=M&amp;amp;idlang=ita| Luigi Malagò] - malago [AT] elet.polimi.it &lt;br /&gt;
&lt;br /&gt;
*[[User:GabrieleValentini| Gabriele Valentini]] - gvalentini [AT] iridia.ulb.ac.be&lt;br /&gt;
&lt;br /&gt;
*[[User:DavideCucci| Davide Cucci]] - cucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
'''Formerly involved'''&lt;br /&gt;
*Emanuele Corsano&lt;br /&gt;
&lt;br /&gt;
== Mailing List ==&lt;br /&gt;
http://groups.google.com/group/evoptool&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Developers may also access unstable branch. Contact the evoptool team for more details.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
Follow these steps in order to compile evoptool&lt;br /&gt;
&lt;br /&gt;
1. Download source code from svn&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Refer to trunk for the lastest (stable?) version of evoptool&lt;br /&gt;
&lt;br /&gt;
2. First you need to manually compile the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; package, http://www.stanford.edu/~boyd/l1_logreg/&lt;br /&gt;
whose source are already included in the evoptool repository. In order to do that follow the instrunctions in &lt;br /&gt;
&amp;lt;code&amp;gt;README.evoptool&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
Next, compile &amp;lt;code&amp;gt;&amp;lt;id_dist/code&amp;gt; following the instructions in &amp;lt;code&amp;gt;README.evoptool&amp;lt;code&amp;gt; in the &amp;lt;code&amp;gt;&amp;lt;id_dist&amp;lt;/code&amp;gt; folder&lt;br /&gt;
&lt;br /&gt;
3. Then you need to compile a module at a time. Each module is included in a different folder. &lt;br /&gt;
To compile a module, from go to the module source folder and do make lib. For instance, for the module named &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  cd common/src&lt;br /&gt;
  make lib&lt;br /&gt;
  cd ..&lt;br /&gt;
&lt;br /&gt;
Compile modules in the following orderm due to dependencies&lt;br /&gt;
&lt;br /&gt;
  common&lt;br /&gt;
  functions&lt;br /&gt;
  ga&lt;br /&gt;
  stochastic&lt;br /&gt;
  eda&lt;br /&gt;
&lt;br /&gt;
To clean a module, do &lt;br /&gt;
&lt;br /&gt;
  make clean&lt;br /&gt;
&lt;br /&gt;
from the module source directory&lt;br /&gt;
&lt;br /&gt;
4. Go to &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;  module and type&lt;br /&gt;
&lt;br /&gt;
  make exe&lt;br /&gt;
&lt;br /&gt;
Binary files will be copied in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root as well as the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory of the &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt; module&lt;br /&gt;
&lt;br /&gt;
'''Required packages'''&lt;br /&gt;
* Libraries&lt;br /&gt;
&lt;br /&gt;
** ''gtkmm-2.4''&lt;br /&gt;
** ''glademm-2.4''&lt;br /&gt;
** ''gthread-2.0''&lt;br /&gt;
** ''sigc++-2.0''&lt;br /&gt;
** ''opencv'' (see for instance http://www.samontab.com/web/2011/06/installing-opencv-2-2-in-ubuntu-11-04/)&lt;br /&gt;
** ''gsl''&lt;br /&gt;
** ''gslcblas''&lt;br /&gt;
** ''libxml++-2.6''&lt;br /&gt;
** '''f2c''&lt;br /&gt;
&lt;br /&gt;
* Software&lt;br /&gt;
** ''gnuplot''&lt;br /&gt;
&lt;br /&gt;
== Running  ==&lt;br /&gt;
&lt;br /&gt;
Right now &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; only runs as a script. GUI is not maintained in the latest version.&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; binary file is supposed to be run in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root, this is because right now the script looks for some configuration files, for the instances of the problems, and temp directories. If you want to run the script from other directories, you just need to copy in that directory the &amp;lt;code&amp;gt;evoptool-file&amp;lt;/code&amp;gt; directory that you find in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory. Link such directory instead of copying it is not safe if you run multiple scripts at the same time, since output files will be shared. &lt;br /&gt;
&lt;br /&gt;
To run the algorithm you need to enter as input an xml file. For instance you can run&lt;br /&gt;
&lt;br /&gt;
  ./evoptool evoptool-file/examples/unitTestOneMax.xml&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool-file/example&amp;lt;/code&amp;gt; directory contains a set of xml files for different benchmarks and different algorithms.&lt;br /&gt;
Take a loot at the &amp;lt;code&amp;gt;example.xml&amp;lt;/code&amp;gt; file for the documentation on hoe to set the parameters for an each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; produces a set of files as output. You can find all files in &amp;lt;code&amp;gt;evoptool-file/temp&amp;lt;/code&amp;gt; directory. Plus a tar.gz file containing such files can be produced at the end of the execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. See the xml file for details.&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/data&lt;br /&gt;
contains the raw data of the statistics according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/gnuplot&lt;br /&gt;
contains the gnuplot files to produce images of the statistics&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/image&lt;br /&gt;
contains images of the statistics produced according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/support&lt;br /&gt;
contains logs&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
==== Implement a new benchmark function====&lt;br /&gt;
&lt;br /&gt;
Benchmarks are defined in the &amp;lt;code&amp;gt;function&amp;lt;/code&amp;gt; module. A benchmark is the maximization problem of a real valued function defined over a vector of n binary variables. Functions are maximized in &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. In order to implement a new benchmark function you have to create a new &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt; that inherits from &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt; module. Take a look at the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; benchmark function.&lt;br /&gt;
&lt;br /&gt;
Among the arguments of the constructor of the &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; class there must be the size of the benchmark, which may or may not be a parameter of the new benchmark.&lt;br /&gt;
&lt;br /&gt;
  OneMax::OneMax(int size) : ObjectiveFunction(size)&lt;br /&gt;
&lt;br /&gt;
In the constructor you have whether the maximum of the function is known or not&lt;br /&gt;
&lt;br /&gt;
   _knownSolution = true;&lt;br /&gt;
&lt;br /&gt;
And in case this is known, set the minimum value and maximum value for the function&lt;br /&gt;
&lt;br /&gt;
 _minFitness = 0; &lt;br /&gt;
 _maxFitness = size; //the maximum value of the OneMax function is defined as the sum of the bits of x set to one.&lt;br /&gt;
&lt;br /&gt;
Besides, such values are used in the normalization of the functions in the plots of the statistics.&lt;br /&gt;
&lt;br /&gt;
Each benchmark must implement the &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; method, which takes the &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x and return f(x). For instance, for &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; you have&lt;br /&gt;
&lt;br /&gt;
  double OneMax::f(BinaryString *bi) {&lt;br /&gt;
  &amp;amp;nbsp;if (bi != NULL) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;if(!(bi-&amp;gt;validCache())) { &lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;/* Fitness cache value not valid */&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;int sum = 0;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;for (int j = 0; j &amp;lt; _size; j++) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;sum = sum + bi-&amp;gt;get(j);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;bi-&amp;gt;setFitnessCache(sum);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return sum;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return bi-&amp;gt;getFitnessCache();&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;cerr &amp;lt;&amp;lt; &amp;quot;[OneMax::f] binary instance cannot be null&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;return 0;&lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In order to avoid multiple evaluations of the same &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x, a caching mechanism has been implemented.&lt;br /&gt;
&lt;br /&gt;
Moreover, you are asked to implement the &amp;lt;code&amp;gt;exportInteration&amp;lt;/code&amp;gt; function, which return an &amp;lt;code&amp;gt;HyperGraph&amp;lt;/code&amp;gt; which represents the interactions present in the function. In order to determine such hypergraph, start from the polinomial representation of the function, and for each monomial introduce a new hyperedge in the hypergraph.&lt;br /&gt;
&lt;br /&gt;
For the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; function, such representation corresponds to the independence graph, since such function is linear. &lt;br /&gt;
&lt;br /&gt;
  HyperGraph* OneMax::exportInteractions() {&lt;br /&gt;
  &amp;amp;nbsp;HyperGraph *interactions = new HyperGraph();&lt;br /&gt;
  &amp;amp;nbsp;interactions-&amp;gt;createIndependenceGraph(_size);&lt;br /&gt;
  &amp;amp;nbsp;return interactions;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;Evoptool.h&amp;lt;/code&amp;gt; add an entry in the &amp;lt;code&amp;gt;Tasks&amp;lt;/code&amp;gt; enum.&lt;br /&gt;
&lt;br /&gt;
  /* This enumeration defines an identifier for each task function. */&lt;br /&gt;
  typedef enum {&lt;br /&gt;
  &amp;amp;nbsp;ONE_MAX = 7,&lt;br /&gt;
  } Tasks;&lt;br /&gt;
&lt;br /&gt;
This value will identify uniquely the benchmark in the xml file. In the &amp;lt;code&amp;gt;XMLParser.cpp&amp;lt;/code&amp;gt; file, add an entry for the new function.&lt;br /&gt;
&lt;br /&gt;
  bool XMLParser::parseTask(xmlpp::TextReader &amp;amp;reader, Evoptool::TestParameters *params) {&lt;br /&gt;
  &amp;amp;nbsp;.. &lt;br /&gt;
  &amp;amp;nbsp;switch (task) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;case Evoptool::ONE_MAX: params-&amp;gt;task = new OneMax(size);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;break;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;..&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;default: return false; &lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;..&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Additional parameters can be obtained using the xml TextReader object, as for the &amp;lt;code&amp;gt;ForPeaks&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
  case Evoptool::FOUR_PEAKS: &lt;br /&gt;
  &amp;amp;nbsp;value = readNodeContent(reader, &amp;quot;peaks&amp;quot;, &amp;amp;errorFlag);&lt;br /&gt;
  &amp;amp;nbsp;if (errorFlag) return false;&lt;br /&gt;
  &amp;amp;nbsp;int peaks = toInt(value);&lt;br /&gt;
  &amp;amp;nbsp;params-&amp;gt;task = new FourPeaks(size, peaks);&lt;br /&gt;
  &amp;amp;nbsp;break; &lt;br /&gt;
&lt;br /&gt;
Finally in the xml file, a function can set with the &amp;lt;code&amp;gt;task&amp;lt;/code&amp;gt; tag, together with all parameters.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;task&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;name&amp;gt;7&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;size&amp;gt;64&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;/task&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== To create a new algorithm (draft) ====&lt;br /&gt;
&lt;br /&gt;
1. Implement a new algorithm&lt;br /&gt;
&lt;br /&gt;
All algorithms must inherit from the Algorithm class. First override the Algorithm::initAlgorithm as follows:&lt;br /&gt;
&lt;br /&gt;
  void DEUM::initAlgorithm(ObjectiveFunction* of) {&lt;br /&gt;
    Algorithm::initAlgorithm(of);&lt;br /&gt;
  &lt;br /&gt;
    /* Initialization tasks */&lt;br /&gt;
    ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Then implement a run() method which performs al the required task for '''one''' iteration of your algorithm.&lt;br /&gt;
&lt;br /&gt;
2. Add an entry in Evoptool.h&lt;br /&gt;
&lt;br /&gt;
  typedef enum {   &lt;br /&gt;
    DEUM&lt;br /&gt;
  } Algorithms;&lt;br /&gt;
&lt;br /&gt;
3. modify the file&lt;br /&gt;
core/src/XMLParser.cpp. Search for the method &amp;lt;tt&amp;gt;bool XMLParser::parseAlgorithms&amp;lt;/tt&amp;gt; and insert an new entry for your algorithm in the &amp;lt;tt&amp;gt;algorithmParameters&amp;lt;/tt&amp;gt; array, for example&lt;br /&gt;
&lt;br /&gt;
  AlgorithmParameters algorithmParameters[] = {&lt;br /&gt;
    ...&lt;br /&gt;
    { Evoptool::DEUM, 5, (char*) &amp;quot;IDDDI&amp;quot; }, // Pop, percElitism, percSelec, CoolRate, GibbsIterations&lt;br /&gt;
    ...&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
In each entry, the first field is the name of the entry in the &amp;lt;tt&amp;gt;Algorithms&amp;lt;/tt&amp;gt; enum just modified in &amp;lt;tt&amp;gt;Evoptool.h&amp;lt;/tt&amp;gt;, the second is the number of parameters to be parsed in the xml configuration file and the third is a string specifying their type: &amp;lt;tt&amp;gt;I&amp;lt;/tt&amp;gt; for integer and &amp;lt;tt&amp;gt;D&amp;lt;/tt&amp;gt; for double.&lt;br /&gt;
&lt;br /&gt;
4. add a case in the switch that follows in &lt;br /&gt;
bool XMLParser::parseAlgorithms&lt;br /&gt;
&lt;br /&gt;
for instance&lt;br /&gt;
	case Evoptool::EXTENDEDFCA: &lt;br /&gt;
	  algos[i] = new extendedFCA(intVal[0], doubleVal[0], doubleVal[1], intVal[1], intVal[2], params-&amp;gt;rng);&lt;br /&gt;
	  algos[i]-&amp;gt;initAlgorithm(params-&amp;gt;task);&lt;br /&gt;
	  break;&lt;br /&gt;
&lt;br /&gt;
where the algorithm is instantiated&lt;br /&gt;
&lt;br /&gt;
5. Add an entry for your algorithm in &lt;br /&gt;
core/src/Algorithms.h&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Add a line in &lt;br /&gt;
evoptool-file/exec-scripts/example.xml&lt;br /&gt;
as a documenation for the parameters of your algorithm.&lt;br /&gt;
Choose a new Id for your algorithm&lt;br /&gt;
Types indicates then type of the parameters (the order is important) that will must be specified&lt;br /&gt;
in the xml file (see &amp;lt;algo&amp;gt;) and are passed to the constructor of the algorithm when the object is instantiated&lt;br /&gt;
I = integer&lt;br /&gt;
D = double&lt;br /&gt;
B = bool&lt;br /&gt;
&lt;br /&gt;
==== Run an algorithm in a C++ program ====&lt;br /&gt;
&lt;br /&gt;
The simplest way to do this is to create a new submodule in &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;, i.e., a new source directory within the source directory of a module&lt;br /&gt;
For instance, the steps to create a new submodule named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; are&lt;br /&gt;
&lt;br /&gt;
1. copy the example submodule &amp;lt;code&amp;gt;exampleRunAlgorithm&amp;lt;/code&amp;gt; in a new folder named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; in&lt;br /&gt;
&lt;br /&gt;
  evoptool/core/src&lt;br /&gt;
&lt;br /&gt;
2. modify the &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; directory, see comments in the makefile for more details.&lt;br /&gt;
&lt;br /&gt;
3. edit the &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; function in the source file, if you need you can create other C++ and .h files in the same folder.&lt;br /&gt;
&lt;br /&gt;
4. from &amp;lt;code&amp;gt;evoptool/core/src/myexample&amp;lt;/code&amp;gt; run&lt;br /&gt;
&lt;br /&gt;
  make bin&lt;br /&gt;
&lt;br /&gt;
The bin file is create in &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; and copied in &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTICE that &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; may be deleted after a &amp;lt;code&amp;gt;make cleanall&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. from &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt; run &lt;br /&gt;
&lt;br /&gt;
  ./myexample&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14162</id>
		<title>Evoptool: Evolutionary Optimization Tool</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=Evoptool:_Evolutionary_Optimization_Tool&amp;diff=14162"/>
				<updated>2011-10-24T09:55:31Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: /* The Evoptool Team */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
Evolutionary Optimization Tool (Evoptool) is an open source optimization tool writte in C++, distributed under GNU General Public License. Evoptool implements meta-heuristics based on the Evolutionary Computation paradigm and aims to provide a common platform for the development and test of new algorithms, in order to facilitate the performance comparison activity. Evoptool offers a wide set of benchmark problems, from classical toy samples to more complex tasks, and a collection of algorithm implementations from Genetic Algorithms and Estimation of Distribution Algorithms paradigms. Evoptool is flexible, easy to extend, also with algorithms based on other approaches other from EAs.&lt;br /&gt;
&lt;br /&gt;
== The Evoptool Team ==&lt;br /&gt;
&lt;br /&gt;
*[[User:MatteoMatteucci| Matteo Matteucci]] - matteucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
*[http://www.dei.polimi.it/personale/dettaglio.php?id_persona=829&amp;amp;id_sezione=&amp;amp;lettera=M&amp;amp;idlang=ita| Luigi Malagò] - malago [AT] elet.polimi.it &lt;br /&gt;
&lt;br /&gt;
*[[User:GabrieleValentini| Gabriele Valentini]] - gvalentini [AT] iridia.ulb.ac.be&lt;br /&gt;
&lt;br /&gt;
*[[User:DavideCucci| Davide Cucci]] - cucci [AT] elet.polimi.it&lt;br /&gt;
&lt;br /&gt;
'''Formerly involved'''&lt;br /&gt;
*Emanuele Corsano&lt;br /&gt;
&lt;br /&gt;
== Mailing List ==&lt;br /&gt;
http://groups.google.com/group/evoptool&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Developers may also access unstable branch. Contact the evoptool team for more details.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
Follow these steps in order to compile evoptool&lt;br /&gt;
&lt;br /&gt;
1. Download source code from svn&lt;br /&gt;
&lt;br /&gt;
  svn checkout https://svn.ws.dei.polimi.it/evoptool/trunk --username usrevoptool --password evoptoolpsw&lt;br /&gt;
&lt;br /&gt;
Refer to trunk for the lastest (stable?) version of evoptool&lt;br /&gt;
&lt;br /&gt;
2. First you need to manually compile the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; package, http://www.stanford.edu/~boyd/l1_logreg/&lt;br /&gt;
whose source are already included in the evoptool repository. In order to do that follow the instrunctions in &lt;br /&gt;
&amp;lt;code&amp;gt;README.evoptool&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;l1_logreg-0.8.2&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
Next, compile &amp;lt;code&amp;gt;&amp;lt;id_dist/code&amp;gt; following the instructions in &amp;lt;code&amp;gt;README.evoptool&amp;lt;code&amp;gt; in the &amp;lt;code&amp;gt;&amp;lt;id_dist&amp;lt;/code&amp;gt; folder&lt;br /&gt;
&lt;br /&gt;
3. Then you need to compile a module at a time. Each module is included in a different folder. &lt;br /&gt;
To compile a module, from go to the module source folder and do make lib. For instance, for the module named &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  cd common/src&lt;br /&gt;
  make lib&lt;br /&gt;
  cd ..&lt;br /&gt;
&lt;br /&gt;
Compile modules in the following orderm due to dependencies&lt;br /&gt;
&lt;br /&gt;
  common&lt;br /&gt;
  functions&lt;br /&gt;
  ga&lt;br /&gt;
  stochastic&lt;br /&gt;
  eda&lt;br /&gt;
&lt;br /&gt;
To clean a module, do &lt;br /&gt;
&lt;br /&gt;
  make clean&lt;br /&gt;
&lt;br /&gt;
from the module source directory&lt;br /&gt;
&lt;br /&gt;
4. Go to &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;  module and type&lt;br /&gt;
&lt;br /&gt;
  make exe&lt;br /&gt;
&lt;br /&gt;
Binary files will be copied in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root as well as the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory of the &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt; module&lt;br /&gt;
&lt;br /&gt;
'''Required packages'''&lt;br /&gt;
* Libraries&lt;br /&gt;
&lt;br /&gt;
** ''gtkmm-2.4''&lt;br /&gt;
** ''glademm-2.4''&lt;br /&gt;
** ''gthread-2.0''&lt;br /&gt;
** ''sigc++-2.0''&lt;br /&gt;
** ''opencv'' (see for instance http://www.samontab.com/web/2011/06/installing-opencv-2-2-in-ubuntu-11-04/)&lt;br /&gt;
** ''gsl''&lt;br /&gt;
** ''gslcblas''&lt;br /&gt;
** ''libxml++-2.6''&lt;br /&gt;
** '''f2c''&lt;br /&gt;
&lt;br /&gt;
* Software&lt;br /&gt;
** ''gnuplot''&lt;br /&gt;
&lt;br /&gt;
== Running  ==&lt;br /&gt;
&lt;br /&gt;
Right now &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; only runs as a script. GUI is not maintained in the latest version.&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; binary file is supposed to be run in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory in the root, this is because right now the script looks for some configuration files, for the instances of the problems, and temp directories. If you want to run the script from other directories, you just need to copy in that directory the &amp;lt;code&amp;gt;evoptool-file&amp;lt;/code&amp;gt; directory that you find in the &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory. Link such directory instead of copying it is not safe if you run multiple scripts at the same time, since output files will be shared. &lt;br /&gt;
&lt;br /&gt;
To run the algorithm you need to enter as input an xml file. For instance you can run&lt;br /&gt;
&lt;br /&gt;
  ./evoptool evoptool-file/examples/unitTestOneMax.xml&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;evoptool-file/example&amp;lt;/code&amp;gt; directory contains a set of xml files for different benchmarks and different algorithms.&lt;br /&gt;
Take a loot at the &amp;lt;code&amp;gt;example.xml&amp;lt;/code&amp;gt; file for the documentation on hoe to set the parameters for an each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt; produces a set of files as output. You can find all files in &amp;lt;code&amp;gt;evoptool-file/temp&amp;lt;/code&amp;gt; directory. Plus a tar.gz file containing such files can be produced at the end of the execution of &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. See the xml file for details.&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/data&lt;br /&gt;
contains the raw data of the statistics according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/gnuplot&lt;br /&gt;
contains the gnuplot files to produce images of the statistics&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/image&lt;br /&gt;
contains images of the statistics produced according to the xml file&lt;br /&gt;
&lt;br /&gt;
  evoptool-file/temp/support&lt;br /&gt;
contains logs&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
==== Implement a new benchmark function====&lt;br /&gt;
&lt;br /&gt;
Benchmarks are defined in the &amp;lt;code&amp;gt;function&amp;lt;/code&amp;gt; module. A benchmark is the maximization problem of a real valued function defined over a vector of n binary variables. Functions are maximized in &amp;lt;code&amp;gt;evoptool&amp;lt;/code&amp;gt;. In order to implement a new benchmark function you have to create a new &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt; that inherits from &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;common&amp;lt;/code&amp;gt; module. Take a look at the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; benchmark function.&lt;br /&gt;
&lt;br /&gt;
Among the arguments of the constructor of the &amp;lt;code&amp;gt;ObjectiveFunction&amp;lt;/code&amp;gt; class there must be the size of the benchmark, which may or may not be a parameter of the new benchmark.&lt;br /&gt;
&lt;br /&gt;
  OneMax::OneMax(int size) : ObjectiveFunction(size)&lt;br /&gt;
&lt;br /&gt;
In the constructor you have whether the maximum of the function is known or not&lt;br /&gt;
&lt;br /&gt;
   _knownSolution = true;&lt;br /&gt;
&lt;br /&gt;
And in case this is known, set the minimum value and maximum value for the function&lt;br /&gt;
&lt;br /&gt;
 _minFitness = 0; &lt;br /&gt;
 _maxFitness = size; //the maximum value of the OneMax function is defined as the sum of the bits of x set to one.&lt;br /&gt;
&lt;br /&gt;
Besides, such values are used in the normalization of the functions in the plots of the statistics.&lt;br /&gt;
&lt;br /&gt;
Each benchmark must implement the &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; method, which takes the &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x and return f(x). For instance, for &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; you have&lt;br /&gt;
&lt;br /&gt;
  double OneMax::f(BinaryString *bi) {&lt;br /&gt;
  &amp;amp;nbsp;if (bi != NULL) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;if(!(bi-&amp;gt;validCache())) { &lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;/* Fitness cache value not valid */&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;int sum = 0;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;for (int j = 0; j &amp;lt; _size; j++) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;sum = sum + bi-&amp;gt;get(j);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;bi-&amp;gt;setFitnessCache(sum);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return sum;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;return bi-&amp;gt;getFitnessCache();&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;} else {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;cerr &amp;lt;&amp;lt; &amp;quot;[OneMax::f] binary instance cannot be null&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;return 0;&lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In order to avoid multiple evaluations of the same &amp;lt;code&amp;gt;BinaryString&amp;lt;/code&amp;gt; x, a caching mechanism has been implemented.&lt;br /&gt;
&lt;br /&gt;
Moreover, you are asked to implement the &amp;lt;code&amp;gt;exportInteration&amp;lt;/code&amp;gt; function, which return an &amp;lt;code&amp;gt;HyperGraph&amp;lt;/code&amp;gt; which represents the interactions present in the function. In order to determine such hypergraph, start from the polinomial representation of the function, and for each monomial introduce a new hyperedge in the hypergraph.&lt;br /&gt;
&lt;br /&gt;
For the &amp;lt;code&amp;gt;OneMax&amp;lt;/code&amp;gt; function, such representation corresponds to the independence graph, since such function is linear. &lt;br /&gt;
&lt;br /&gt;
  HyperGraph* OneMax::exportInteractions() {&lt;br /&gt;
  &amp;amp;nbsp;HyperGraph *interactions = new HyperGraph();&lt;br /&gt;
  &amp;amp;nbsp;interactions-&amp;gt;createIndependenceGraph(_size);&lt;br /&gt;
  &amp;amp;nbsp;return interactions;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;Evoptool.h&amp;lt;/code&amp;gt; add an entry in the &amp;lt;code&amp;gt;Tasks&amp;lt;/code&amp;gt; enum.&lt;br /&gt;
&lt;br /&gt;
  /* This enumeration defines an identifier for each task function. */&lt;br /&gt;
  typedef enum {&lt;br /&gt;
  &amp;amp;nbsp;ONE_MAX = 7,&lt;br /&gt;
  } Tasks;&lt;br /&gt;
&lt;br /&gt;
This value will identify uniquely the benchmark in the xml file. In the &amp;lt;code&amp;gt;XMLParser.cpp&amp;lt;/code&amp;gt; file, add an entry for the new function.&lt;br /&gt;
&lt;br /&gt;
  bool XMLParser::parseTask(xmlpp::TextReader &amp;amp;reader, Evoptool::TestParameters *params) {&lt;br /&gt;
  &amp;amp;nbsp;.. &lt;br /&gt;
  &amp;amp;nbsp;switch (task) {&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;case Evoptool::ONE_MAX: params-&amp;gt;task = new OneMax(size);&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;break;&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;..&lt;br /&gt;
  &amp;amp;nbsp;&amp;amp;nbsp;default: return false; &lt;br /&gt;
  &amp;amp;nbsp;}&lt;br /&gt;
  &amp;amp;nbsp;..&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Additional parameters can be obtained using the xml TextReader object, as for the &amp;lt;code&amp;gt;ForPeaks&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
  case Evoptool::FOUR_PEAKS: &lt;br /&gt;
  &amp;amp;nbsp;value = readNodeContent(reader, &amp;quot;peaks&amp;quot;, &amp;amp;errorFlag);&lt;br /&gt;
  &amp;amp;nbsp;if (errorFlag) return false;&lt;br /&gt;
  &amp;amp;nbsp;int peaks = toInt(value);&lt;br /&gt;
  &amp;amp;nbsp;params-&amp;gt;task = new FourPeaks(size, peaks);&lt;br /&gt;
  &amp;amp;nbsp;break; &lt;br /&gt;
&lt;br /&gt;
Finally in the xml file, a function can set with the &amp;lt;code&amp;gt;task&amp;lt;/code&amp;gt; tag, together with all parameters.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;task&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;name&amp;gt;7&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;amp;nbsp;&amp;lt;size&amp;gt;64&amp;lt;/size&amp;gt;&lt;br /&gt;
  &amp;lt;/task&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== To create a new algorithm (draft) ====&lt;br /&gt;
&lt;br /&gt;
1. Implement a new algorithm&lt;br /&gt;
&lt;br /&gt;
All algorithm must implement intiAlgorithm, and call Algorithm::initAlgorithm&lt;br /&gt;
same thing for &lt;br /&gt;
Algorithm::run();&lt;br /&gt;
&lt;br /&gt;
2. Add an entry in Evoptool.h&lt;br /&gt;
&lt;br /&gt;
  typedef enum {   &lt;br /&gt;
    DEUM&lt;br /&gt;
  } Algorithms;&lt;br /&gt;
&lt;br /&gt;
3. modify the file&lt;br /&gt;
core/src/XMLParser.cpp&lt;br /&gt;
and insert an new entry for your algorithm in&lt;br /&gt;
bool XMLParser::parseAlgorithms&lt;br /&gt;
for instance&lt;br /&gt;
&lt;br /&gt;
{ Evoptool::DEUM, 5, (char*) &amp;quot;IDDDI&amp;quot; }	          // Pop, percElitism, percSelec, CoolRate, GibbsIterations&lt;br /&gt;
where the first argument is the class of the algorithm &lt;br /&gt;
the second the number of paramers parsed in the xml file&lt;br /&gt;
the third the types of each parameter&lt;br /&gt;
&lt;br /&gt;
4. add a case in the switch that follows in &lt;br /&gt;
bool XMLParser::parseAlgorithms&lt;br /&gt;
&lt;br /&gt;
for instance&lt;br /&gt;
	case Evoptool::EXTENDEDFCA: &lt;br /&gt;
	  algos[i] = new extendedFCA(intVal[0], doubleVal[0], doubleVal[1], intVal[1], intVal[2], params-&amp;gt;rng);&lt;br /&gt;
	  algos[i]-&amp;gt;initAlgorithm(params-&amp;gt;task);&lt;br /&gt;
	  break;&lt;br /&gt;
&lt;br /&gt;
where the algorithm is instantiated&lt;br /&gt;
&lt;br /&gt;
5. Add an entry for your algorithm in &lt;br /&gt;
core/src/Algorithms.h&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Add a line in &lt;br /&gt;
evoptool-file/exec-scripts/example.xml&lt;br /&gt;
as a documenation for the parameters of your algorithm.&lt;br /&gt;
Choose a new Id for your algorithm&lt;br /&gt;
Types indicates then type of the parameters (the order is important) that will must be specified&lt;br /&gt;
in the xml file (see &amp;lt;algo&amp;gt;) and are passed to the constructor of the algorithm when the object is instantiated&lt;br /&gt;
I = integer&lt;br /&gt;
D = double&lt;br /&gt;
B = bool&lt;br /&gt;
&lt;br /&gt;
==== Run an algorithm in a C++ program ====&lt;br /&gt;
&lt;br /&gt;
The simplest way to do this is to create a new submodule in &amp;lt;code&amp;gt;core&amp;lt;/code&amp;gt;, i.e., a new source directory within the source directory of a module&lt;br /&gt;
For instance, the steps to create a new submodule named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; are&lt;br /&gt;
&lt;br /&gt;
1. copy the example submodule &amp;lt;code&amp;gt;exampleRunAlgorithm&amp;lt;/code&amp;gt; in a new folder named &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; in&lt;br /&gt;
&lt;br /&gt;
  evoptool/core/src&lt;br /&gt;
&lt;br /&gt;
2. modify the &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;myexample&amp;lt;/code&amp;gt; directory, see comments in the makefile for more details.&lt;br /&gt;
&lt;br /&gt;
3. edit the &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; function in the source file, if you need you can create other C++ and .h files in the same folder.&lt;br /&gt;
&lt;br /&gt;
4. from &amp;lt;code&amp;gt;evoptool/core/src/myexample&amp;lt;/code&amp;gt; run&lt;br /&gt;
&lt;br /&gt;
  make bin&lt;br /&gt;
&lt;br /&gt;
The bin file is create in &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; and copied in &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTICE that &amp;lt;code&amp;gt;evoptool/core/bin&amp;lt;/code&amp;gt; may be deleted after a &amp;lt;code&amp;gt;make cleanall&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. from &amp;lt;code&amp;gt;evoptool/bin&amp;lt;/code&amp;gt; run &lt;br /&gt;
&lt;br /&gt;
  ./myexample&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=12866</id>
		<title>User:DavideCucci</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=12866"/>
				<updated>2011-01-12T09:57:00Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Student&lt;br /&gt;
|category=Student&lt;br /&gt;
|firstname=Davide&lt;br /&gt;
|lastname=Cucci&lt;br /&gt;
|photo=3.jpg&lt;br /&gt;
|email=davide.cucci@mail.polimi.it&lt;br /&gt;
|advisor=MatteoMatteucci;&lt;br /&gt;
|status=active&lt;br /&gt;
}}&lt;br /&gt;
== Brief CV ==&lt;br /&gt;
&lt;br /&gt;
Davide Cucci is currently a student in Computing Systems Engineering at Politecnico di Milano. He received his Bachelor degree in Computer Engineering in March 2008 with a thesis about embedded systems design with the [http://www.dresd.org DRESD] group. His interests range from computer architectures to artificial intelligence, information and coding theory and evolutionary computing.&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=File:3.jpg&amp;diff=12865</id>
		<title>File:3.jpg</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=File:3.jpg&amp;diff=12865"/>
				<updated>2011-01-12T09:56:59Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=12864</id>
		<title>User:DavideCucci</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=12864"/>
				<updated>2011-01-12T09:56:40Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Student&lt;br /&gt;
|category=Student&lt;br /&gt;
|firstname=Davide&lt;br /&gt;
|lastname=Cucci&lt;br /&gt;
|photo=2.jpg&lt;br /&gt;
|email=davide.cucci@mail.polimi.it&lt;br /&gt;
|advisor=MatteoMatteucci;&lt;br /&gt;
|status=active&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Brief CV ==&lt;br /&gt;
&lt;br /&gt;
Davide Cucci is currently a student in Computing Systems Engineering at Politecnico di Milano. He received his Bachelor degree in Computer Engineering in March 2008 with a thesis about embedded systems design with the [http://www.dresd.org DRESD] group. His interests range from computer architectures to artificial intelligence, information and coding theory and evolutionary computing.&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=12863</id>
		<title>User:DavideCucci</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=12863"/>
				<updated>2011-01-12T09:56:03Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: /* Brief CV */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Student&lt;br /&gt;
|category=Student&lt;br /&gt;
|firstname=Davide&lt;br /&gt;
|lastname=Cucci&lt;br /&gt;
|photo=2.jpg&lt;br /&gt;
|email=davide.cucci@mail.polimi.it&lt;br /&gt;
|advisor=MatteoMatteucci;&lt;br /&gt;
|status=active&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Brief CV ==&lt;br /&gt;
&lt;br /&gt;
Davide Cucci is currently a student in Computing Systems Engineering at Politecnico di Milano. He received his Bachelor degree in Computer Engineering in March 2008 with a thesis about embedded systems design with the [DRESD http://www.dresd.org] group. His interests range from computer architectures to artificial intelligence, information and coding theory and evolutionary computing.&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=12862</id>
		<title>User:DavideCucci</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=12862"/>
				<updated>2011-01-12T09:55:15Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Student&lt;br /&gt;
|category=Student&lt;br /&gt;
|firstname=Davide&lt;br /&gt;
|lastname=Cucci&lt;br /&gt;
|photo=2.jpg&lt;br /&gt;
|email=davide.cucci@mail.polimi.it&lt;br /&gt;
|advisor=MatteoMatteucci;&lt;br /&gt;
|status=active&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Brief CV ==&lt;br /&gt;
&lt;br /&gt;
Davide Cucci is currently a student in Computing Systems Engineering at Politecnico di Milano. He received his Bachelor degree in Computer Engineering in March 2008 with a thesis about embedded systems design with the DRESD[http://www.dresd.org] group. His interests range from computer architectures to artificial intelligence, information and coding theory and evolutionary computing.&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=12861</id>
		<title>User:DavideCucci</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=12861"/>
				<updated>2011-01-12T09:43:11Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Student&lt;br /&gt;
|category=Student&lt;br /&gt;
|firstname=Davide&lt;br /&gt;
|lastname=Cucci&lt;br /&gt;
|photo=2.jpg&lt;br /&gt;
|email=davide.cucci@mail.polimi.it&lt;br /&gt;
|advisor=MatteoMatteucci;&lt;br /&gt;
|status=active&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=File:2.jpg&amp;diff=12860</id>
		<title>File:2.jpg</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=File:2.jpg&amp;diff=12860"/>
				<updated>2011-01-12T09:43:06Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=12850</id>
		<title>User:DavideCucci</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=12850"/>
				<updated>2011-01-11T18:07:14Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Student&lt;br /&gt;
|category=Student&lt;br /&gt;
|firstname=Davide&lt;br /&gt;
|lastname=Cucci&lt;br /&gt;
|email=davide.cucci@mail.polimi.it&lt;br /&gt;
|advisor=MatteoMatteucci;&lt;br /&gt;
|status=active&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=Product_based_variables_transformations_for_evolutionary_computing&amp;diff=12848</id>
		<title>Product based variables transformations for evolutionary computing</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=Product_based_variables_transformations_for_evolutionary_computing&amp;diff=12848"/>
				<updated>2011-01-11T18:05:29Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Project&lt;br /&gt;
|title=Product based variables transformations for evolutionary computing&lt;br /&gt;
|short_descr=This work is about evaluating a class of variables transformation as a novel model building technique in evolutionary computing and pseudo boolean optimization. Convergence properties and theoretical results will be derived using the information geometry theory by Shun-ichi Amari.&lt;br /&gt;
|coordinator=MatteoMatteucci&lt;br /&gt;
|tutor=LuigiMalago&lt;br /&gt;
|students=EmanueleCorsano;DavideCucci&lt;br /&gt;
|resarea=Machine Learning&lt;br /&gt;
|start=2010/03/01&lt;br /&gt;
|end=2011/03/31&lt;br /&gt;
|status=Active&lt;br /&gt;
|level=Ms&lt;br /&gt;
|type=Thesis&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=12847</id>
		<title>User:DavideCucci</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=12847"/>
				<updated>2011-01-11T18:04:54Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Student&lt;br /&gt;
|category=Student&lt;br /&gt;
|firstname=Davide&lt;br /&gt;
|lastname=Cucci&lt;br /&gt;
|email=davide.cucci@mail.polimi.it&lt;br /&gt;
|projectpage=Product_based_variables_transformations_for_evolutionary_computing&lt;br /&gt;
|advisor=MatteoMatteucci;&lt;br /&gt;
|status=active&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	<entry>
		<id>https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=12647</id>
		<title>User:DavideCucci</title>
		<link rel="alternate" type="text/html" href="https://airwiki.deib.polimi.it/index.php?title=User:DavideCucci&amp;diff=12647"/>
				<updated>2010-10-31T14:11:59Z</updated>
		
		<summary type="html">&lt;p&gt;DavideCucci: New page: {{Student |category=Student |firstname=Davide |lastname=Cucci |email=davide.cucci@mail.polimi.it |advisor=MatteoMatteucci;  |status=active }}&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Student&lt;br /&gt;
|category=Student&lt;br /&gt;
|firstname=Davide&lt;br /&gt;
|lastname=Cucci&lt;br /&gt;
|email=davide.cucci@mail.polimi.it&lt;br /&gt;
|advisor=MatteoMatteucci; &lt;br /&gt;
|status=active&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>DavideCucci</name></author>	</entry>

	</feed>