[scilab-Users] Genetic algorithm with binary representation

Michaël Baudin michael.baudin at scilab.org
Tue Aug 31 14:44:19 CEST 2010


  Hi,

You will find in attachment a demo of the optimization of the Rastrigin 
function with GA. It makes use of the three pre-defined functions 
crossover_ga_binary,mutation_ga_binary and coding_ga_binary. The 
function to be minimized receives as input argument a string made of 0 
and 1. It uses the convert_to_float function in order to transform the 
binary variables into floating point numbers, then uses the floats to 
evaluate the Rastrigin function.

The picture in attachment is the contour plot of the Rastrigin function, 
with the initial population in blue and the optimal population in green. 
You see that several local optimums have been identified, approximately 
7, from what I see on the picture. If we compare to the default settings 
(with doubles instead of strings), this is worse, since the other 
algorithm allows to put more points in the neighborhood of (0,0) with 
the same number of generations.

This demo is adapted from the second part of the demo available from :

editor(fullfile(SCI,"modules","genetic_algorithms","demos","GAdemo.sce"))

Thanks to Yann Collette for this information.

Best regards,

Michaël Baudin

PS
I added this demo to the bugtracker, so that it can be added to the 
demos of the GA module as soon as possible: 
http://bugzilla.scilab.org/show_bug.cgi?id=7913
There is no help page for convert_to_float: 
http://bugzilla.scilab.org/show_bug.cgi?id=7912


Le 26/08/2010 22:15, Marcelo Menezes Reis a écrit :
> Greetings
>
> Does somebody know a genetic algorithm example in SciLab, with binary 
> (0 and 1) representation?
>
> Thanks in advance.
>


-- 
Michaël Baudin
Ingénieur de développement
michael.baudin at scilab.org
-------------------------
Consortium Scilab - Digiteo
Domaine de Voluceau - Rocquencourt
B.P. 105 - 78153 Le Chesnay Cedex
Tel. : 01 39 63 56 87 - Fax : 01 39 63 55 94


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: demoGAbinary.sce
URL: <https://lists.scilab.org/pipermail/users/attachments/20100831/ac295bb5/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GAbinary.png
Type: image/png
Size: 22497 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20100831/ac295bb5/attachment.png>


More information about the users mailing list