Lesson 1 - Lesson 3 - Main page - Algorithm-Based - Component-Based - Hints - EO documentation

Tutorial Lesson 2: more encapsulations

In this lesson, the same Evolutionary Algorithm will be rewritten in a much more general context.
First, look at the changes that have been done to the algorithms. Then benefit from the new features by


Again, two basic algorithms are provided, namely FirstBitEA and FirstRealEA.
To compile and run them, go to the Lesson2 sub-directory of the tutorial dir and simply type make. Both examples should get compiled, and you can then run them by calling their name from the system prompt.

Note the slim difference in names, from GA to EA: the behavior of these  EAs is almost identical to that of their GA counterpart, at least with the default settings that are provided. But their potentialities for easy modifications are much larger, both in terms of variation operators and of evolution engine (i.e. selection/replacement mechanism). 


Changes

Browse through the code, and discover them one after the other:


Exercise 1: minimizing
Modify the algorithm so that it minimizes the fitness. Exercise 2: initialization
Use different initializers: for instance, on the real-valued sphere function minimization, try to initialize half of the population in [-2,-1] and the other half in [1,2], with and without the segment and hypercube crossovers (and for large values of VEC_SIZE, the size of the vectors). Amazing, isn't it! Explain that result.

Exercise 3:  full selection/replacement
You can now twiddle the number of offspring that will be generated from the parents. But of course you need to adjust the replacement to keep a constant population size.

Remember: all solutions are in the same sub-directory of the Tutorial dir than the examples (i.e. here Lesson2), and are described here.



Lessons learned:
Lesson 1 - Lesson 3 - Main page - Algorithm-Based - Component-Based - Hints - EO documentation

Marc Schoenauer

Last modified: Fri Nov 3 18:49:12 CET 2000