[scilab-Users] Re: Genetic Algoritm

michael.baudin at contrib.scilab.org michael.baudin at contrib.scilab.org
Fri Jul 20 09:43:28 CEST 2012


 Hi,

 I am not sure, but you may have to include the number of calls required 
 to create the
 initial population.

 Regards,

 Michaël

 On Thu, 19 Jul 2012 23:18:25 -0700 (PDT), rcbsimoes 
 <rcbsimoes at hotmail.com> wrote:
> hi,
>
> it worked!!
> only...
> i couldn't understand the numeber of function calls the GA makes.
>
> if:
>
> *// example of use of the genetic algorithm //
> PopSize     = 10;
> Proba_cross = 0.7;
> Proba_mut   = 0.1;
> NbGen       = 2;
> NbCouples   = 110;
> Log         = %T;
> nb_disp     = 10; // Nb point to display from the optimal population
> pressure    = 0.05;
>
> ga_params = init_param();
> // Parameters to adapt to the shape of the optimization problem
> ga_params = add_param(ga_params,'minbound',1);
> ga_params = add_param(ga_params,'maxbound',4);
> ga_params = add_param(ga_params,'dimension',3);
> ga_params = add_param(ga_params,'beta',0);
> ga_params = add_param(ga_params,'delta',0.1);
> // Parameters to fine tune the Genetic algorithm. All these 
> parameters are
> optional for continuous optimization
> // If you need to adapt the GA to a special problem, you
> ga_params = add_param(ga_params,'init_func',init_ga_default);
> ga_params = 
> add_param(ga_params,'crossover_func',crossover_ga_default);
> ga_params = add_param(ga_params,'mutation_func',mutation_ga_default);
> ga_params = add_param(ga_params,'codage_func',coding_ga_identity);
> ga_params = 
> add_param(ga_params,'selection_func',selection_ga_elitist);
> //ga_params = 
> add_param(ga_params,'selection_func',selection_ga_random);
> ga_params = add_param(ga_params,'nb_couples',NbCouples);
> ga_params = add_param(ga_params,'pressure',pressure);
>
> /////// Genetic Algorithm for binary codage //
>
> ga_params = add_param(ga_params,'binary_length',6);
> ga_params = 
> set_param(ga_params,'crossover_func',crossover_ga_binary);
> ga_params = set_param(ga_params,'mutation_func',mutation_ga_binary);
> ga_params = set_param(ga_params,'codage_func',coding_ga_binary);
> ga_params = add_param(ga_params,'multi_cross',%T);
> ga_params = add_param(ga_params,'multi_cross_nb',3);
>
> [pop_opt, fobj_pop_opt, pop_init, fobj_pop_init] = optim_ga(opt_bin,
> PopSize, NbGen, Proba_mut, Proba_cross, Log, ga_params);
>
> *
>
> shouldn't the number of calls be 20 (= PopSize * NbGen) ??
> with this settings I had 345.
>
> greetings
> rui
>
>
> --
> View this message in context:
> 
> http://mailinglists.scilab.org/Genetic-Algoritm-tp4024549p4024617.html
> Sent from the Scilab users - Mailing Lists Archives mailing list
> archive at Nabble.com.
>
> --
> To unsubscribe from this mailing-list, please send an empty mail to
> users-unsubscribe at lists.scilab.org
> To check the archives of this mailing list, see
> http://mailinglists.scilab.org/




More information about the users mailing list