Main Content

选择R2的变化016a

Useoptimoptionsto Set Options

Before R2016a, you set options for someGlobal Optimization Toolboxsolvers by using a dedicated option function:

  • gaoptimsetforgaandgamultiobj

  • psoptimsetforpatternsearch

  • saoptimsetforsimulannealbnd

Beginning in R2016a, the recommended way to set options is to useoptimoptions. (You already setparticleswarmoptions usingoptimoptions.)

Note

GlobalSearchandMultiStartuse a different mechanism for setting properties. SeeGlobalSearch and MultiStart Properties (Options). Some of these property names changed as solver option names changed.

Some option names changed in R2016a. SeeTable of Option Names in Legacy Order.

optimoptions“hides” some options, meaning it does not display their values.optimoptionsdisplays only current names, not legacy names. For details, seeView Options.

Options thatoptimoptionsHides

optimoptionsdoes not display some options. To view the setting of any such “hidden” option, use dot notation. For details, seeView Options. These options are listed initalicsin the options tables in the function reference pages.

Options thatoptimoptionsHides

Option Description Solvers Reason for Hiding
Cache

WithCacheset to'on',patternsearchkeeps a history of the mesh points it polls. At subsequent iterations,patternsearchdoes not poll points close to those it already polled. Use this option ifpatternsearchruns slowly while computing the objective function. If the objective function is stochastic, do not use this option.

patternsearch Works poorly
CacheSize

Size of the history.

patternsearch Works poorly
CacheTol

Largest distance from the current mesh point to any point in the history in order forpatternsearchto avoid polling the current point. Use if'Cache'option is set to'on'.

patternsearch Works poorly
DisplayInterval Interval for iterative display. The iterative display prints one line for everyDisplayIntervaliterations. particleswarm,simulannealbnd Not generally useful
FunValCheck

Check whether objective function and constraints values are valid.'on'displays an error when the objective function or constraints return a value that is complex,Inf, orNaN.

particleswarm Not generally useful
HybridInterval

Interval (if not'end'or'never') at whichHybridFcnis called.

simulannealbnd Not generally useful
InitialPenalty

Initial value of penalty parameter.

ga,patternsearch Difficult to know how to set
MaxMeshSize

Maximum mesh size used in a poll or search step.

patternsearch Not generally useful
MeshRotate

Rotate the pattern before declaring a point to be optimum.

patternsearch Default value is best

MigrationDirection

Direction of migration — see迁移选项.

ga Not useful

MigrationFraction

Scalar between 0 and 1 specifying the fraction of individuals in each subpopulation that migrates to a different subpopulation — see迁移选项.

ga Not useful

MigrationInterval

Positive integer specifying the number of generations that take place between migrations of individuals between subpopulations — see迁移选项

ga Not useful

PenaltyFactor

Penalty update parameter.

ga,patternsearch Difficult to know how to set

PlotInterval

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

ga,patternsearch,simulannealbnd Not useful

StallTest

String describing the stopping test.

ga Default value is best
TolBind

Binding tolerance. SeeConstraint Parameters.

patternsearch Default value is usually best

Table of Option Names in Legacy Order

These two tables have identical information. One is in alphabetical order by legacy option name, the other is in order by current option name. The tables show values only when the values differ between legacy and current, and show only the names that differ. For changes in Optimization Toolbox™ solvers, seeCurrent and Legacy Option Names.

* indicatesGlobalSearchandMultiStartproperty names as well as solver option names.

Option Names in Legacy Order

Legacy Name Current Name 遗产的价值es Current Values
CompletePoll UseCompletePoll 'on','off' true,false
CompleteSearch UseCompleteSearch 'on','off' true,false
Generations MaxGenerations
InitialPopulation InitialPopulationMatrix
InitialScores InitialScoreMatrix
InitialSwarm InitialSwarmMatrix
MaxFunEvals MaxFunctionEvaluations
MaxIter MaxIterations
MeshAccelerator AccelerateMesh 'on','off' true,false
MeshContraction MeshContractionFactor
MeshExpansion MeshExpansionFactor
MinFractionNeighbors MinNeighborsFraction
NonlinConAlgorithm NonlinearConstraintAlgorithm
*OutputFcns *OutputFcn
*PlotFcns *PlotFcn
PollingOrder PollOrderAlgorithm
PopInitRange InitialPopulationRange
SearchMethod SearchFcn
SelfAdjustment SelfAdjustmentWeight
SocialAdjustment SocialAdjustmentWeight
StallGenLimit MaxStallGenerations
StallIterLimit MaxStallIterations
StallTimeLimit MaxStallTime
TimeLimit MaxTime
TolCon ConstraintTolerance
*TolFun *FunctionTolerance
TolMesh MeshTolerance
*TolX StepTolerance
*XToleranceforGlobalSearchandMultiStart
Vectorized UseVectorized 'on','off' true,false

Table of Option Names in Current Order

* indicatesGlobalSearchandMultiStartproperty names as well as solver option names.

Option Names in Current Order

Current Name Legacy Name Current Values 遗产的价值es
AccelerateMesh MeshAccelerator true,false 'on','off'
ConstraintTolerance TolCon
*FunctionTolerance *TolFun
InitialPopulationMatrix InitialPopulation
InitialPopulationRange PopInitRange
InitialScoreMatrix InitialScores
InitialSwarmMatrix InitialSwarm
MaxFunctionEvaluations MaxFunEvals
MaxGenerations Generations
MaxIterations MaxIter
MaxStallGenerations StallGenLimit
MaxStallIterations StallIterLimit
MaxStallTime StallTimeLimit
MaxTime TimeLimit
MeshContractionFactor MeshContraction
MeshExpansionFactor MeshExpansion
MeshTolerance TolMesh
MinNeighborsFraction MinFractionNeighbors
NonlinearConstraintAlgorithm NonlinConAlgorithm
*OutputFcn *OutputFcns
*PlotFcn *PlotFcns
PollOrderAlgorithm PollingOrder
SearchFcn SearchMethod
SelfAdjustmentWeight SelfAdjustment
SocialAdjustmentWeight SocialAdjustment
StepTolerance TolX
UseCompletePoll CompletePoll true,false 'on','off'
UseCompleteSearch CompleteSearch true,false 'on','off'
UseVectorized Vectorized true,false 'on','off'
*XTolerance *TolX