[scilab-Users] Help with function init_func_default - genetic algorithms
Michaël Baudin
michael.baudin at scilab.org
Thu Aug 5 10:11:24 CEST 2010
Dear Marcelo,
I posted a bug fix for the help page of the init_ga_default function.
You will find the example :
// Generate 10 points in 2 dimensions, in the
// interval [-2,2]^2.
popsize = 10;
ga_params = init_param();
ga_params = add_param(ga_params,"minbound",[-2; -2]);
ga_params = add_param(ga_params,"maxbound",[2; 2]);
ga_params = add_param(ga_params,"dimension",2);
Pop_init = init_ga_default(popsize,ga_params);
for k = 1 : popsize
x = Pop_init(k);
xstr = strcat(string(x)," ");
mprintf("x[%d]=[%s]\n",k,xstr);
end
An example is missing in the optim_ga function help page, which
shows how to customize the initial population generator function.
I work on this and let you know about this in some minutes.
Best regards,
Michaël
Marcelo Menezes Reis a écrit :
> Greetings
>
> I have been trying to develop a genetic algorithm in Scilab. I intend
> to use binary coding. But, I am experiencing some problems with
> function *init_func_default*. In help file I found:
>
>
> Calling Sequence
>
> Pop_init = init_func_default(popsize,param)
>
>
> Parameters
>
> * *popsize* : the number of individuals to generate.
> * *param* : a list of parameters. - 'dimension': the size of the
> vector X. - 'minbound': a vector of minimum bounds for the
> variable X. - 'maxbound': a vector of maximum bounds for the
> variable X.
> * *Pop_init* : a list which contains the initial population of
> individuals.
>
> I don´t know how to put in "param" the list dimension, minbound
> and maxbound. Can you help me with that?
> --
> Marcelo Menezes Reis, Dr.Eng.
> Professor Adjunto - Adjunct Professor
> Departamento de Informática e Estatística
> Department of Computer Science and Statistics
> Universidade Federal de Santa Catarina
> http://www.inf.ufsc.br/~marcelo/
> _____________________________________________
>
--
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
More information about the users
mailing list