1 # Created by Octave 3.6.1, Wed Apr 18 13:13:19 2012 UTC <root@brouzouf>
13 # name: <cell-element>
17 simplified example (nvars == 4)
18 p1 = [varA varB varC varD]
19 p2 = [var1 var2 var3 var4]
21 child = [varA varB var3 varD]
25 # name: <cell-element>
29 simplified example (nvars == 4)
30 p1 = [varA varB varC varD]
35 # name: <cell-element>
42 # name: <cell-element>
47 ranks ([7,2,2]) == [3.0,1.5,1.5]
48 is [3,1,2] (or [3,2,1]) useful?
52 # name: <cell-element>
57 ranks ([7,2,2]) == [3.
61 # name: <cell-element>
68 # name: <cell-element>
72 -- Function File: X = ga (FITNESSFCN, NVARS)
73 -- Function File: X = ga (FITNESSFCN, NVARS, A, B)
74 -- Function File: X = ga (FITNESSFCN, NVARS, A, B, AEQ, BEQ)
75 -- Function File: X = ga (FITNESSFCN, NVARS, A, B, AEQ, BEQ, LB, UB)
76 -- Function File: X = ga (FITNESSFCN, NVARS, A, B, AEQ, BEQ, LB, UB,
78 -- Function File: X = ga (FITNESSFCN, NVARS, A, B, AEQ, BEQ, LB, UB,
80 -- Function File: X = ga (PROBLEM)
81 -- Function File: [X, FVAL] = ga (...)
82 -- Function File: [X, FVAL, EXITFLAG] = ga (...)
83 -- Function File: [X, FVAL, EXITFLAG, OUTPUT] = ga (...)
84 -- Function File: [X, FVAL, EXITFLAG, OUTPUT, POPULATION] = ga (...)
85 -- Function File: [X, FVAL, EXITFLAG, OUTPUT, POPULATION, SCORES] = ga
87 Find minimum of function using genetic algorithm.
91 The objective function to minimize. It accepts a vector X of
92 size 1-by-NVARS, and returns a scalar evaluated at X.
95 The dimension (number of design variables) of FITNESSFCN.
98 The structure of the optimization parameters; can be created
99 using the `gaoptimset' function. If not specified, `ga'
100 minimizes with the default optimization parameters.
103 A structure containing the following fields:
132 The local unconstrained found minimum to the objective
133 function, FITNESSFCN.
136 The value of the fitness function at X.
144 # name: <cell-element>
148 Find minimum of function using genetic algorithm.
152 # name: <cell-element>
159 # name: <cell-element>
163 -- Function File: POPULATION = gacreationuniform (GENOMELENGTH,
165 Create a random initial population with a uniform distribution.
169 The number of indipendent variables for the fitness function.
172 The fitness function.
175 The options structure.
179 The initial population for the genetic algorithm.
181 See also: ga, gaoptimset
187 # name: <cell-element>
191 Create a random initial population with a uniform distribution.
195 # name: <cell-element>
202 # name: <cell-element>
206 -- Function File: OPTIONS = gaoptimset
207 -- Function File: OPTIONS = gaoptimset ('PARAM1', VALUE1, 'PARAM2',
209 Create genetic algorithm options structure.
213 Parameter to set. Unspecified parameters are set to their
214 default values; specifying no parameters is allowed.
221 Structure containing the options, or parameters, for the
243 column vector | [] (default) . Can be partial.
256 "always" | "never" (default) . Parallel evaluation of
257 objective function. TODO: parallel evaluation of nonlinear
261 "on" | "off" (default) . Vectorized evaluation of objective
262 function. TODO: vectorized evaluation of nonlinear constraints
270 # name: <cell-element>
274 Create genetic algorithm options structure.
278 # name: <cell-element>
285 # name: <cell-element>
289 start mutationgaussian logic
293 # name: <cell-element>
297 start mutationgaussian logic
302 # name: <cell-element>
309 # name: <cell-element>
313 -- Function File: Y = rastriginsfcn (X)
314 Rastrigin's function.
319 # name: <cell-element>
323 Rastrigin's function.
327 # name: <cell-element>
334 # name: <cell-element>
338 fix an entry of the steps (or parents) vector
339 assert (steps(1, index_steps) < max_step_size); ## DEBUG
343 # name: <cell-element>
347 fix an entry of the steps (or parents) vector
348 assert (steps(1, index_steps) < m
352 # name: <cell-element>
359 # name: <cell-element>
363 -- Script File: test_ga
364 Execute all available tests at once.
369 # name: <cell-element>
373 Execute all available tests at once.