Detailed instructions for use are in the User's Guide.
[. . . ] Global Optimization Toolbox 3 User's Guide
How to Contact The MathWorks
Web Newsgroup www. mathworks. com/contact_TS. html Technical Support
www. mathworks. com comp. soft-sys. matlab suggest@mathworks. com bugs@mathworks. com doc@mathworks. com service@mathworks. com info@mathworks. com
Product enhancement suggestions Bug reports Documentation error reports Order status, license renewals, passcodes Sales, pricing, and general information
508-647-7000 (Phone) 508-647-7001 (Fax) The MathWorks, Inc. 3 Apple Hill Drive Natick, MA 01760-2098
For contact information about worldwide offices, see the MathWorks Web site. Global Optimization Toolbox User's Guide © COPYRIGHT 20042010 by The MathWorks, Inc.
The software described in this document is furnished under a license agreement. The software may be used or copied only under the terms of the license agreement. [. . . ] The options are · Elite count -- The number of individuals with the best fitness values in the current generation that are guaranteed to survive to the next generation. When Elite count is at least 1, the best fitness value can only decrease from one generation to the next. This is what you want to happen, since the genetic algorithm minimizes the fitness function. Setting Elite count to a high value causes the fittest individuals to dominate the population, which can make the search less effective. · Crossover fraction -- The fraction of individuals in the next generation, other than elite children, that are created by crossover. "Setting the Crossover Fraction" on page 5-66 describes how the value of Crossover fraction affects the performance of the genetic algorithm.
Mutation and Crossover
The genetic algorithm uses the individuals in the current generation to create the children that make up the next generation. Besides elite children, which correspond to the individuals in the current generation with the best fitness values, the algorithm creates · Crossover children by selecting vector entries, or genes, from a pair of individuals in the current generation and combines them to form a child · Mutation children by applying random changes to a single individual in the current generation to create a child
5-63
5
Using the Genetic Algorithm
Both processes are essential to the genetic algorithm. Crossover enables the algorithm to extract the best genes from different individuals and recombine them into potentially superior children. Mutation adds to the diversity of a population and thereby increases the likelihood that the algorithm will generate individuals with better fitness values. See "Creating the Next Generation" on page 5-22 for an example of how the genetic algorithm applies mutation and crossover. You can specify how many of each type of children the algorithm creates as follows: · Elite count, in Reproduction options, specifies the number of elite children. · Crossover fraction, in Reproduction options, specifies the fraction of the population, other than elite children, that are crossover children. For example, if the Population size is 20, the Elite count is 2, and the Crossover fraction is 0. 8, the numbers of each type of children in the next generation are as follows: · There are two elite children. · There are 18 individuals other than elite children, so the algorithm rounds 0. 8*18 = 14. 4 to 14 to get the number of crossover children. · The remaining four individuals, other than elite children, are mutation children.
Setting the Amount of Mutation
The genetic algorithm applies mutations using the option that you specify on the Mutation function pane. The default mutation option, Gaussian, adds a random number, or mutation, chosen from a Gaussian distribution, to each entry of the parent vector. Typically, the amount of mutation, which is proportional to the standard deviation of the distribution, decreases at each new generation. You can control the average amount of mutation that the algorithm applies to a parent in each generation through the Scale and Shrink options:
5-64
Genetic Algorithm Examples
· Scale controls the standard deviation of the mutation at the first generation, which is Scale multiplied by the range of the initial population, which you specify by the Initial range option. · Shrink controls the rate at which the average amount of mutation decreases. The standard deviation decreases linearly so that its final value equals 1 - Shrink times its initial value at the first generation. For example, if Shrink has the default value of 1, then the amount of mutation decreases to 0 at the final step. You can see the effect of mutation by selecting the plot options Distance and Range, and then running the genetic algorithm on a problem such as the one described in "Example: Rastrigin's Function" on page 5-8. [. . . ] See Chapter 9, "Options Reference" for a complete description of these options and their values. You can also view the options parameters by typing saoptimset at the command line. Description Handle to the function the algorithm uses to determine if a new point is accepted Handle to the function the algorithm uses to generate new points Type of decision variable Values Function handle |{@acceptancesa} Function handle | @annealingboltz |
{@annealingfast} 'custom' | {'double'}
Option
AcceptanceFcn
AnnealingFcn
DataType
12-66
saoptimset
Option
Display DisplayInterval HybridFcn
Description Level of display Interval for iterative display Automatically run HybridFcn (another optimization function) during or at the end of iterations of the solver
Values
'off' | 'iter' | 'diagnose' | {'final'}
Positive integer | {10} Function handle | @fminsearch |
@patternsearch | @fminunc | @fmincon | {[]}
or 1-by-2 cell array | {@solver, hybridoptions}, where solver
= fminsearch, patternsearch, fminunc, or fmincon {[]}
HybridInterval
Interval (if not 'end' or 'never') at which HybridFcn is called Initial value of temperature Maximum number of objective function evaluations allowed Maximum number of iterations allowed Minimum objective function value desired Function(s) get(s) iterative data and can change options at run time Plot function(s) called during iterations
Positive integer | 'never' |
{'end'}
InitialTemperature MaxFunEvals
Positive scalar |{100} Positive integer |
{3000*numberOfVariables}
MaxIter ObjectiveLimit OutputFcns
Positive integer | {Inf} Scalar | {-Inf} Function handle or cell array of function handles | {[]} Function handle or cell array of function handles | @saplotbestf | @saplotbestx | @saplotf | @saplotstopping | @saplottemperature | {[]}
PlotFcns
12-67
saoptimset
Option
PlotInterval ReannealInterval StallIterLimit
Description Plot functions are called at every interval Reannealing interval Number of iterations over which average change in fitness function value at current point is less than
options. TolFun
Values Positive integer |{1} Positive integer | {100} Positive integer |
{500*numberOfVariables}
TemperatureFcn
Function used to update temperature schedule
Function handle |
@temperatureboltz | @temperaturefast | {@temperatureexp}
TimeLimit
The algorithm stops after running for TimeLimit seconds Termination tolerance on function value
Positive scalar | {Inf}
TolFun
Positive scalar | {1e-6}
See Also
For more about these options, see "Simulated Annealing Options" on page 9-53.
saoptimget, simulannealbnd
12-68
simulannealbnd
Purpose Syntax
Find unconstrained or bound-constrained minimum of function of several variables using simulated annealing algorithm
x = simulannealbnd(fun, x0) x = simulannealbnd(fun, x0, lb, ub) x = simulannealbnd(fun, x0, lb, ub, options) x = simulannealbnd(problem) [x, fval] = simulannealbnd(. . . ) [x, fval, exitflag] = simulannealbnd(. . . ) [x, fval, exitflag, output] = simulannealbnd(fun, . . . ) x = simulannealbnd(fun, x0) starts at x0 and finds a local minimum x to the objective function specified by the function handle fun. The objective function accepts input x and returns a scalar function value evaluated at x. [. . . ]