- x — Current point
- fval — Objective function value at x
- bestx — Best point found so far
- bestfval — Objective function value at best point
Output function for Simulated Anealing
7 views (last 30 days)
Show older comments
Hello,
I am using Simulated anealing as my optimization solver. Unfortunately, I am unable to get what I want. When I look at the 'optimValues' (see bellow)I do not see 2 VERY IMPORTANT piece of information: 1) the current best solution x 2) The objective value of the current best solution. I believe you agree with me that these 2 pieces of information are the most important information any user needs (or wants) to know.
I do not know what to do with this??? !!!
Any idea?
Thanks for your kind help, in advance!
Babak
Default properties:
AcceptanceFcn: @acceptancesa
AnnealingFcn: @annealingfast
DataType: 'double'
Display: 'iter'
FunctionTolerance: 1.0000e-06
HybridFcn: []
InitialTemperature: [8×1 double]
MaxFunctionEvaluations: 1.7977e+308
MaxIterations: 200
MaxStallIterations: 4000
MaxTime: Inf
ObjectiveLimit: -Inf
OutputFcn: {@(optimValues,options,flag)myoutput_SA_Parametric(optimValues,options,flag,Max_iter)}
PlotFcn: []
ReannealInterval: 100
TemperatureFcn: @temperatureexp
0 Comments
Answers (2)
Sarthak
on 24 Mar 2023
Hi Mohammad,
As per my understanding, the optimValues structure does contain
Attaching a documentation link for your reference as well.
0 Comments
Alan Weiss
on 24 Mar 2023
You have mistaken the output of optimoptions for the optimvalues structure in simulate annealing.
opts = optimoptions("simulannealbnd")
When you create an output function for simulated annealing you can obtain the information from the optimvalues structure as described in Output Function Options. For an example showing how to use an output function for ga, which has a different syntax, see Custom Output Function for Genetic Algorithm. Be careful to use the syntax for simulannealbnd, not the syntax for ga, in your custom output function.
Alan Weiss
MATLAB mathematical toolbox documentation
0 Comments
See Also
Categories
Find more on Simulated Annealing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!