Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.3.3 - 日本語

Change language to:
English - Français - Português

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Scilab help >> Genetic Algorithms > init_ga_default

init_ga_default

A function a initialize a population

Calling Sequence

Pop_init = init_ga_default(popsize,param)

Arguments

popsize

the number of individuals to generate.

param

a list of parameters.

  • "dimension": the size of the vector X. Default dimension=2.

  • "minbound": a vector of minimum bounds for the variable X. Default minbound = -2*ones(1,dimension).

  • "maxbound": a vector of maximum bounds for the variable X. Default maxbound=2*ones(1,dimension).

Pop_init

a list which contains the initial population of individuals.

Description

This function generate an initial population containing pop_size individuals. It uses the rand function to generate the points uniformly distributed in the bounds. As a side effect, it modifies the state of the random generator of the rand function. Other initial populations might be generated from the grand function, or any other uniform random generator (including low discrepancy sequences). In the case were we want to compute another initial population, we might define our own init function: in this case, we may use the init_ga_default function as a template and plug our customized population generator.

Examples

// Generate 10 points in 2 dimensions, in the 
// interval [-2,2]^2.
popsize = 10;
ga_params = init_param();
ga_params = add_param(ga_params,"dimension",2);
ga_params = add_param(ga_params,"minbound",[-2; -2]);
ga_params = add_param(ga_params,"maxbound",[2; 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

See Also

Authors

2008, Yann COLLETTE, ycollet@freesurf.fr

2010 - DIGITEO - Michael Baudin (updated this help page)

<< crossover_ga_default Genetic Algorithms mutation_ga_binary >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Oct 05 12:12:55 CEST 2011