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

Welcome to EO, the Evolving Objects library, and to

# EO Tutorial

Version 0.97 - May. 9 2002

New

- ParadisEO, the parallel version of EO, is available together with a PDF presentation
Thanks to Sébastien Cahon (LIFL, Lille)
- Lesson 5 gives you the opportunity to build your own genotype
and still benefit from all powerful EO features (evolution engines, I/O, ...).

Welcome to EO tutorial/on-line documentation.
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.

###

About this tutorial

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???).
So 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: Fri Nov 28 2000