Genetic Algorithm and Direct Search Toolbox Previous page   Next Page
gaoptimset

Create a genetic algorithm options structure

Syntax

Description

options = gaoptimset (with no input arguments) creates a structure called options that contains the options, or parameters, for the genetic algorithm and sets parameters to their default values.

gaoptimset with no input or output arguments displays a complete list of parameters with their valid values.

options = gaoptimset('param1',value1,'param2',value2,...) creates a structure options and sets the value of 'param1' to value1, 'param2' to value2, and so on. Any unspecified parameters are set to their default values. It is sufficient to type only enough leading characters to define the parameter name uniquely. Case is ignored for parameter names.

options = gaoptimset(oldopts,'param1',value1,...) creates a copy of oldopts, modifying the specified parameters with the specified values.

options = gaoptimset(oldopts,newopts) combines an existing options structure, oldopts, with a new options structure, newopts. Any parameters in newopts with nonempty values overwrite the corresponding old parameters in oldopts.

Options

The following table lists the options you can set with gaoptimset. See Genetic Algorithm Options for a complete description of these options and their values. Values in {} denote the default value. You can also view the optimization parameters and defaults by typing gaoptimset at the command line.

Option
Description
Values
CreationFcn
Handle to the function that creates the initial population

{@gacreationuniform}

CrossoverFraction
The fraction of the population at the next generation, not including elite children, that is created by the crossover function

Positive scalar | {0.8}

CrossoverFcn
Handle to the function that the algorithm uses to create crossover children

@crossoverheuristic
{@crossoverscattered}
@crossoverintermediate
@crossoversinglepoint
@crossovertwopoint

EliteCount
Positive integer specifying how many individuals in the current generation are guaranteed to survive to the next generation

Positive integer | {2}

FitnessLimit
Scalar. If the fitness function attains the value of FitnessLimit, the algorithm halts.

Scalar | {-Inf}

FitnessScalingFcn
Handle to the function that scales the values of the fitness function

@fitscalinggoldberg
{@fitscalingrank}
@fitscalingprop
@fitscalingtop

Generations
Positive integer specifying the maximum number of iterations before the algorithm halts

Positive integer |{100}

PopInitRange
Matrix or vector specifying the range of the individuals in the initial population

Matrix or vector | [0;1]

PopulationType
String describing the data type of the population

'bitstring' | 'custom' | {'doubleVector'}

HybridFcn
Handle to a function that continues the optimization after ga terminates

Function handle | {[]}

InitialPopulation
Initial population

Positive scalar | {[]}

InitialScores
Initial scores

Column vector | {[]}

MigrationDirection
Direction of migration

'both' | {'forward'}

MigrationFraction
Scalar between 0 and 1 specifying the fraction of individuals in each subpopulation that migrates to a different subpopulation

Scalar | {0.2}

MigrationInterval
Positive integer specifying the number of generations that take place between migrations of individuals between subpopulations

Positive integer | {20}

MutationFcn
Handle to the function that produces mutation children

@mutationuniform
{@mutationgaussian}

OutputFcns
Array of handles to functions that ga calls at each iteration.

Array | {[]}

OutputInterval
Positive integer specifying the number of generations between consecutive calls to the output functions

Positive integer | {1}

PlotFcns
Array of handles to functions that plot data computed by the algorithm

@gaplotbestf @gaplotbestgenome @gaplotdistance @gaplotexpectation @gaplotgeneology @gaplotselection @gaplotrange @gaplotscorediversity @gaplotscores @gaplotstopping | {[]}

PlotInterval
Positive integer specifying the number of generations between consecutive calls to the plot functions

Positive integer | {1}

PopulationSize
Size of the population

Positive integer | {20}

SelectionFcn
Handle to the function that selects parents of crossover and mutation children

@selectiongoldberg
@selectionrandom
{@selectionstochunif}
@selectionroulette
@selectiontournament

StallLimitG
Positive integer. The algorithm stops if there is no improvement in the objective function for StallLimitG consecutive generations.

Positive integer | {50}

StallLimitS
Positive scalar. The algorithm stops if there is no improvement in the objective function for StallLimitS seconds.

Positive scalar | {20}

TimeLimit
Positive scalar. The algorithm stops after running for TimeLimit seconds.

Positive scalar | {30}

Vectorized
String specifying whether the computation of the fitness function is vectorized

'on' | {'off'}

See Also

gaoptimget, gatool


Previous page  gaoptimget gatool Next page

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS