The examples are implemented in standard C. They should compile on a standard unix-like operating system, such as ubuntu etc. The C source code archive simplEvo.tar.gz is ready for download.
Assuming the classic software development environment - a terminal running on a unix-, linux-like operating system, please unpack and compile the source files as follows:
tar -xvf simplEvo.tar.gz cd simplEvo make
There is one executable available that can be run as follows
./simpEvo
Without any arguments the programs displays expected parameter values.
./simpEvo Wrong number of arguments! Usage: simpEvo <P> <O> <G> <R> <P> number of parents > 0 <O> number of offsprings; O >= P <G> number of generations to evolve; G > 0 <R> relative variation rate; 0.0 <= R < 1.0
If you run the program simpEvo
it will write the data of the
evolutuion process into directory data
. These data are written
as simple text files. They can directly be used for plotting with gnuplot
.
But first you have to run an evolution. For example by calling simpEvo
with
the follwing parameter settings.
./simpEvo 10 10 30 0.1
The in directory data you will find one file fct.txt
, evo.txt
and 30 files pop_*.txt
and off_*.txt
.
The file fct.txt
contains the fitness function used in the run.
The file evo.txt
lists maximal, minmal, average and standard deviation of the
fitness of the parents for each generation.
The other files contain the behavior and fitness values for each parent
(pop_*.txt
) and offspring (off_*.txt
) individual in the corresponding
generation. The number of generation corresponds to the number in the file name.
Now you can plot the evoltion data.
Change to directory gnuplot
and call the gnuplot as follows:
cd gnuplot gnuplot ./plotEvoRun.dem
When executing the command above the following window similar to the follwing should pop up.
On the command line the output Go to next generation
should be displayed.
The plot shows best fitness value achived for each generation (black line with points), the fitness function (blue filled curve), the histogram (grey boxes) of the behavior values of the parents, and, furthermore, the red stars mark the actual behavior values of the parents. The plot shows the values of the parents of the first generation.
If one confirms the Go to next generation
message by pressing enter then
the next generation will be plotted.
In order to change the fitness function the one has to edit the file
main.c
and re-compile. The fitness functions used are implemented in
this file. Currently the function F1(struct Indy *i)
is applied
for the evolution by the following assignment in line 58:
ptrPop->fitnessFctPtr = &F1;
Notice, apart from the executable simpEvo
the command:
make clean
deletes also the data files in the directory data
.
[1] Presentation, Künstliche Evolution zur Entwicklung von Steuerungen für autonome Roboter. Make Faire, Oct 2016, Berlin. (pdf)
[2] Presentation and material, Maker Faire, Oct 2015, Berlin
[3] M. Hülse, Multifunktionalität rekurrenter neuronaler Netze. DISKI 306, 2007.(pdf)
[4] Hülse, M., Wischmann, S., and Pasemann F.: Structure and function of evolved neuro-
controllers for autonomous robots. Connection Science, 16(4): 249-266, 2004.(pdf)
[5] Neurocybernetics
[6] Website Ingo Rechenberg incl. lecture scripts