# doc-cache created by Octave 11.3.0
# name: cache
# type: cell
# rows: 3
# columns: 9
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
crossoverscattered


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 863
 -- Function File: XOVERKIDS = crossoverscattered (PARENTS, OPTIONS, NVARS,
          FITNESSFCN, UNUSED, POPUPLATION)
     Default crossover function for problems without linear constraints

     crossoverscattered creates a random binary vector and selects genes where
     the vector is a 1 from the first parent and a 0 from the next parent.

     *Inputs*
     PARENTS
          Row vector of parents chosen from selection function
     OPTIONS
          options
     NVARS
          Number of variables
     FITNESSFCN
          Fitness function to use
     UNUSED
          Placeholder variable not used
     POPULATION
          Matrix representing the current population

     *Outputs*
     XOVERKIDS
          Crossover offspring matrix where roes correspond to children.  The
          number of columns is the number of variables.

     See also: ga.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 66
Default crossover function for problems without linear constraints



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
fitscalingrank


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 500
 -- Function File: EXPECTION = fitscalingrank (SCORES, NPARENTS)
     Default fitness scaling function

     fitscalingrank provides scaling based on rank instead of score.

     *Inputs*
     SCORES
          A vector of scalars for each member of the population
     NPARENTS
          The number of parents needs from the population

     *Outputs*
     EXPECTATION
          Column vector of same size as scores giving scaled values of each
          member of the population.

     See also: ga.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Default fitness scaling function



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2
ga


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1922
 -- Function File: X = ga (FITNESSFCN, NVARS)
 -- Function File: X = ga (FITNESSFCN, NVARS, A, B)
 -- Function File: X = ga (FITNESSFCN, NVARS, A, B, AEQ, BEQ)
 -- Function File: X = ga (FITNESSFCN, NVARS, A, B, AEQ, BEQ, LB, UB)
 -- Function File: X = ga (FITNESSFCN, NVARS, A, B, AEQ, BEQ, LB, UB, NONLCON)
 -- Function File: X = ga (FITNESSFCN, NVARS, A, B, AEQ, BEQ, LB, UB, NONLCON,
          OPTIONS)
 -- Function File: X = ga (PROBLEM)
 -- Function File: [X, FVAL] = ga (...)
 -- Function File: [X, FVAL, EXITFLAG] = ga (...)
 -- Function File: [X, FVAL, EXITFLAG, OUTPUT] = ga (...)
 -- Function File: [X, FVAL, EXITFLAG, OUTPUT, POPULATION] = ga (...)
 -- Function File: [X, FVAL, EXITFLAG, OUTPUT, POPULATION, SCORES] = ga (...)
     Find minimum of function using genetic algorithm.

     *Inputs*
     FITNESSFCN
          The objective function to minimize.  It accepts a vector X of size
          1-by-NVARS, and returns a scalar evaluated at X.
     NVARS
          The dimension (number of design variables) of FITNESSFCN.
     OPTIONS
          The structure of the optimization parameters; can be created using the
          ‘gaoptimset’ function.  If not specified, ‘ga’ minimizes with the
          default optimization parameters.
     PROBLEM
          A structure containing the following fields:
             • ‘fitnessfcn’
             • ‘nvars’
             • ‘Aineq’
             • ‘Bineq’
             • ‘Aeq’
             • ‘Beq’
             • ‘lb’
             • ‘ub’
             • ‘nonlcon’
             • ‘randstate’
             • ‘randnstate’
             • ‘solver’
             • ‘options’

     *Outputs*
     X
          The local unconstrained found minimum to the objective function,
          FITNESSFCN.
     FVAL
          The value of the fitness function at X.

     See also: gaoptimset.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Find minimum of function using genetic algorithm.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
gacreationuniform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 487
 -- Function File: POPULATION = gacreationuniform (GENOMELENGTH, FITNESSFCN,
          OPTIONS)
     Create a random initial population with a uniform distribution.

     *Inputs*
     GENOMELENGTH
          The number of indipendent variables for the fitness function.
     FITNESSFCN
          The fitness function.
     OPTIONS
          The options structure.

     *Outputs*
     POPULATION
          The initial population for the genetic algorithm.

     See also: ga, gaoptimset.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
Create a random initial population with a uniform distribution.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
gaoptimset


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1691
 -- Function File: OPTIONS = gaoptimset
 -- Function File: OPTIONS = gaoptimset ('PARAM1', VALUE1, 'PARAM2', VALUE2,
          ...)
     Create genetic algorithm options structure.

     *Inputs*
     PARAM
          Parameter to set.  Unspecified parameters are set to their default
          values; specifying no parameters is allowed.
     VALUE
          Value of PARAM.

     *Outputs*
     OPTIONS
          Structure containing the options, or parameters, for the genetic
          algorithm.

     *Options*
     ‘CreationFcn’
          Default function is @gacreationuniform
     ‘CrossoverFcn’
          Default function is @crossoverscattered
     ‘CrossoverFraction’
          Default value is 0.0
     ‘EliteCount’
          Default value is 2
     ‘FitnessLimit’
     ‘FitnessScalingFcn’
          Default function is @fitscalingrank
     ‘Generations’
          Default valie is 100
     ‘InitialPopulation’
          Can be partial.
     ‘InitialScores’
          column vector | [] (default) .  Can be partial.
     ‘MutationFcn’
          Default mutation is { @mutationgaussian, scale, shrink }

          scale and shrink are 1.0
     ‘PopInitRange’
     ‘PopulationSize’
     ‘SelectionFcn’
          Default function is @selectionstochunif
     ‘TimeLimit’
     ‘UseParallel’
          "always" | "never" (default) .  Parallel evaluation of objective
          function.  TODO: parallel evaluation of nonlinear constraints
     ‘Vectorized’
          "on" | "off" (default) .  Vectorized evaluation of objective function.
          TODO: vectorized evaluation of nonlinear constraints

     See also: ga.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Create genetic algorithm options structure.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
mutationgaussian


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 914
 -- Function File: MUTATIONCHILDREN = mutationgaussian (PARENTS, OPTIONS, NVARS,
          FITNESSFCN, STATE, THISSCORE, thisPopulation)
     Default mutation function

     mutationgaussian uses a random number from the gaussian distribution added
     to the mean to each entry of the parent

     *Inputs*
     PARENTS
          Row vector of parents chosen by a selection function
     OPTIONS
          options
     NVARS
          Number of variables
     FITNESSFCN
          Fitness function
     STATE
          Structure containing information about current generation
     THSISCORE
          vector of scores for the current population
     THISPOPULATION
          Matrix of individuals in the current population

     *Outputs*
     MUTATIONCHILDREN
          mutated offspring as a matrix where rows correspond to children,
          number of columns is the number of variables.

     See also: ga.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Default mutation function



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
rastriginsfcn


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 215
 -- Function File: Y = rastriginsfcn (X)
     Rastrigin's function.

     *Inputs*
     X
          Input 2 column vector

     *Outputs*
     Y
          result output using rastrigin's function

     See also: ga.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
Rastrigin's function.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
selectionstochunif


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 512
 -- Function File: PARENTS = selectionstochunuf (EXPECTIONS, NPARENTS, OPTIONS)
     Default selection function

     Selection based uniform proportional steps based on its caled value.

     *Inputs*
     EXPECTATION
          Column vector of scaled fitness for each member of a population.
     NPARENTS
          The number of parents to select
     OPTIONS
          ga options

     *Outputs*
     PARENTS
          Row vector of size nParents containg the indices of selected parents.

     See also: ga.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Default selection function



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
test_ga


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 66
 -- Script File: test_ga
     Execute all available tests at once.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Execute all available tests at once.





