No 'FunctionTolerance' or 'TolFun' in gaoptimset
5 views (last 30 days)
Show older comments
Hi!
I use Matlab 2014b with Global Optimization Toolbox installed and Windows 10.
After running the following in command window:
options = gaoptimset
I get this list of options
options =
PopulationType: 'doubleVector'
PopInitRange: [2x1 double]
PopulationSize: 20
EliteCount: 2
CrossoverFraction: 0.8000
MigrationDirection: 'forward'
MigrationInterval: 20
MigrationFraction: 0.2000
Generations: 100
TimeLimit: Inf
FitnessLimit: -Inf
StallGenLimit: 50
StallTimeLimit: 20
InitialPopulation: []
InitialScores: []
PlotInterval: 1
CreationFcn: @gacreationuniform
FitnessScalingFcn: @fitscalingrank
SelectionFcn: @selectionstochunif
CrossoverFcn: @crossoverscattered
MutationFcn: @mutationgaussian
HybridFcn: []
Display: 'final'
PlotFcns: []
OutputFcns: []
Vectorized: 'off'
with no option for function tolerance ('FunctionTolerance' or 'TolFun').
How can I run ga solver with specific value for function tolerance? How can I set its value in options struct when there is no field for this?
0 Comments
Accepted Answer
Walter Roberson
on 5 Dec 2021
I just ran that code in the version you indicate, R2014b. I get a different result than you do:
options = gaoptimset
options =
PopulationType: []
PopInitRange: []
PopulationSize: []
EliteCount: []
CrossoverFraction: []
ParetoFraction: []
MigrationDirection: []
MigrationInterval: []
MigrationFraction: []
Generations: []
TimeLimit: []
FitnessLimit: []
StallGenLimit: []
StallTest: []
StallTimeLimit: []
TolFun: []
TolCon: []
InitialPopulation: []
InitialScores: []
NonlinConAlgorithm: []
InitialPenalty: []
PenaltyFactor: []
PlotInterval: []
CreationFcn: []
FitnessScalingFcn: []
SelectionFcn: []
CrossoverFcn: []
MutationFcn: []
DistanceMeasureFcn: []
HybridFcn: []
Display: []
PlotFcns: []
OutputFcns: []
Vectorized: []
UseParallel: []
The results you show are more what you get when you use
options = gaoptimset(@ga)
options =
PopulationType: 'doubleVector'
PopInitRange: []
PopulationSize: '50 when numberOfVariables <= 5, else 200'
EliteCount: '0.05*PopulationSize'
CrossoverFraction: 0.8000
ParetoFraction: []
MigrationDirection: 'forward'
MigrationInterval: 20
MigrationFraction: 0.2000
Generations: '100*numberOfVariables'
TimeLimit: Inf
FitnessLimit: -Inf
StallGenLimit: 50
StallTest: 'averageChange'
StallTimeLimit: Inf
TolFun: 1.0000e-06
TolCon: 1.0000e-03
InitialPopulation: []
InitialScores: []
NonlinConAlgorithm: 'auglag'
InitialPenalty: 10
PenaltyFactor: 100
PlotInterval: 1
CreationFcn: @gacreationuniform
FitnessScalingFcn: @fitscalingrank
SelectionFcn: @selectionstochunif
CrossoverFcn: @crossoverscattered
MutationFcn: {[@mutationgaussian] [1] [1]}
DistanceMeasureFcn: []
HybridFcn: []
Display: 'final'
PlotFcns: []
OutputFcns: []
Vectorized: 'off'
UseParallel: 0
but different -- for example PopulationSize is not a specific numeric value like you show.
Actual R2014b has TolFun which is the field you are looking for.
Is it possible you ran in R2014a instead of R2014b ?
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!