Algorithm-Based - Component-Based - Programming hints - EO documentation

Welcome to EO, the Evolving Objects library, and to

# EO Tutorial

Important notice - December 2006
The code that is proposed in this tutorial should not be used as a basis for any comparison with any original method on any benchmark problem. It is an illustration of what you can achieve with EO, but reaching state-of-the-art results requires more work. In particular, if you want to compare your evolutionary algorithm with a good performing algorithm in parameteric optimisation, do not use ESEA in Lesson4, but go to the test directory, type make t-eoCMAES and use the resulting t-eoCMAES. But as of today, the latest algorithms (and comparative results) are better found on Nikolaus Hansen Web page and on his "Comparison of Evolutionary Algorithms on a Benchmark Function Set" page).
Version 0.98a - December 2004

- New - Well, in fact, nothing really new, but some people advised us to announce from the very beginning that if you are looking for a ready-to-use (except for the fitness) fully tunable Evolutionary Algorithm evolving real values or bitstring, you can go directly to Lesson 4 after just reading this page, and maybe the Programming hints (link on top of each page too).
  In fact, there is something new: EO's automatic configuration and build process has been cleaned up and upgraded. For consistency, the same automatically-built `Makefiles` have been created in the tutorial directories. The good-old manually-created files are still there, now named `Makefile.simple`. Moreover, when you compile the whole library (typing make in the main EO dir), all lessons of the tutorial gets compiled, too.
Version 0.98 - May 2004
- Lesson 5 has been improved: some of the empty template files in dir `.../eo/tutorial/Templates` have been simplified, and file stat.tmpl has been added, allowing you to compute and print and save-to-disk and plot-on-line your own statistics. The magic script is now (see Lesson5) `createSimple`.
  The same simplified main file in dir `.../eo/tutorial/Templates`) also allows you to use fitness sharing (together with roulette wheel) as a possible selector.
  Unfortunately, the HTML file for Lesson5 and the corresponding html-ized code are not yet updated - time is missing (volunteers welcome).
May 2002
- ParadisEO, the parallel version of EO, is available together with a PDF presentation
Thanks to Sébastien Cahon (LIFL, Lille)

Welcome to EO tutorial/on-line documentation.

## About this tutorial

First, please note that this tutorial is not supposed to be printed and read off-line, as it takes full advantage of hyper-text links between the different parts, and with the technical documentation. This tutorial can be used in 2 different ways: algorithm-based and component-based.

- Algorithm-Based means you start from a very simple, ready-to-run algorithm, and gradually modify it, making it both more powerful and more complex.
- Component-Based means you start by examining the components of an EA one by one, down to the level of complexity you feel comfortable with, and then build the whole algorithm using those components you need (or the one you are mastering). Such approach might be viewed as going through a simplified user guide, too.

However, it is strongly recommended that you take some time on the first lesson of the Algorithm-Based approach to get familiar with the basic concepts that are used throughout EO. Anyway, as of today, December 19, the Component-Based is only very sparsely written :-)

Links and Related documents

- There are of course a few (very few) programming hints that you should know.
- THe EO documentation - automatically generated from the comments in the code - is very helpful to get an idea of the inheritance diagrams of EO classes, and to quickly reach some specific part of the code.
The top page of each class documentation is for instance the inheritance diagram of the class, and you'll learn a lot by simply looking at it.
- For those who wish to get deeper in STL (Standard Template Library), you might visit the well documented SGI STL Web site. But don't forget you'll find the very basic minimum in EO programming hints.
- And, last but not least, we assume you know approximately that an Evolutionary Algorithm looks like this, but otherwise you can try this very brief introduction (not written yet, Jan. 2001, sorry).

Colors and navigation:

You will see this diagram in quite many places, as for instance at the top of all examples - usually it will be clickable and will help you navigate among the different parts of an EO program. See the brief introduction to Evolutionary Computation for a detailed explanation.

But in the text itself, colors are important, as they will be used throughout this tutorial to clearly mark which part of the algorithm we are discussing. So please keep in mind that, whereas orange is for emphasis,

- Yellowish is for representation, i.e. the choice of the genotype
- Magenta is for the stochastic operators that are representation-dependent, i.e. initialisation and variation operators (crossover, mutation and the like).
- Green is for the implementation of Darwinism, i.e. the way the individuals are selected for reproduction and survive.
- Red is for evaluation, i.e. the computation of the fitness of all individuals
- Blue is for interactions of the user and the program, as for instance choice of stopping criterion, on-line display of nice statistics or initial choice of all program parameters.
- Brown is for everything that is NOT part of any of the above, i.e. random number generator, or basic C++/STL syntax .
- Note that pink will be used to describe the syntax of compile orders (i.e. at the operating system level, see e.g. below).
- Last, but not least, all links into EO documentation will use the Helvetica typeface, like this line you are now reading.

This tutorial is not

- A course on Evolutionary Computation. You can find such things on the Internet, maybe you can start here.
- An interface that would allow you to build your Evolutionary Programs by a few clicks; such a thing does exist, is called EASEA, and is complementary to this tutorial as it helps the user to build some simple EO programs from simple description. But there are things that EASEA cannot do, and you will have to do it yourself and will need to increase your knowledge about EO for that - hence this tutorial.
- A coffee machine - though you might want to spend some time here when you're tired of everything else, to improve your knowledge of EO slowly and gradually rather than when you have something urgent to code :-)

Before you start

You should of course have downloaded and installed the whole EO library (how did you get this file if not???). If you are using a recent version of EO (0.9.3+), all tutorial Lessons should have been compiled when installing the library, and you can now proceed with Lesson1.
Otherwise, we'll assume that you are now in the tutorial directory, and that your prompt looks something like

`(myname@myhost) EOdir/tutorial %`

so you should now type in

`make Lesson1`

and see something like

(myname@myhost) EOdir/tutorial % make Lesson1
`c++ -DPACKAGE=\"eo\" -DVERSION=\"0.9.1\" -I. -I../../src -Wall -g -c FirstBitGA.cpp`
`c++ -Wall -g -o FirstBitGA FirstBitGA.o ../../src/libeo.a ../../src/utils/libeoutils.a`
`c++ -DPACKAGE=\"eo\" -DVERSION=\"0.9.1\" -I. -I../../src -Wall -g -c FirstRealGA.cpp`
`c++ -Wall -g -o FirstRealGA FirstRealGA.o ../../src/libeo.a ../../src/utils/libeoutils.a`

and two now executable files should have appeared in the subdirectory Lesson1, namely `FirstBitGA` and `FirstRealGA` (see First lesson to know more about these two ready-to-run programs). If this doesn't work, please go back to the main EO directory and run the installation program.

You should also test that you can access the EO documentation in the menu line below: you might not need to go there immediately, but just in case you make rapid progress ... This menu bar should be on all pages of this tutorial, allowing you to navigate easily.

Last, but not least: EO is improving only from the good will of contributors. This is also true for this tutorial: If you find anything that you think could be improved, you are welcome to e-mail me.

Enjoy!

Algorithm-Based - Component-Based - Programming hints - EO documentation

Last modified: Wed Feb 22 2006