Итеративное отображение дает вам информацию о прогрессе решателей во время их выполнений.
Существует два типа итеративного отображения:
Глобальное отображение решателя
Локальное отображение решателя
Оба типа появляются в командной строке, в зависимости от глобальных и локальных опций.
Получите локальный решатель итеративное отображение путем установки опции Display в поле problem.options к 'iter' или 'iter-detailed' с optimoptions. Для получения дополнительной информации смотрите Итеративное Отображение (Optimization Toolbox).
Получите глобальный решатель итеративное отображение путем установки свойства Display в объекте GlobalSearch или MultiStart к 'iter'.
Глобальные решатели устанавливают опцию Display по умолчанию локального решателя к 'off', если структура задачи не имеет значение для этой опции. Глобальные решатели не заменяют установки, вы делаете для локальных опций.
При установке локального решателя опция Display на что-либо кроме 'off' может произвести большой вывод. Опцией Display по умолчанию, созданной , является optimoptions(@solver)'final'.
Запустите пример, описанный в Запущенном Решатель с помощью GlobalSearch с GlobalSearch итеративное отображение:
% % Set the random stream to get exactly the same output
% rng(14,'twister')
gs = GlobalSearch('Display','iter');
opts = optimoptions(@fmincon,'Algorithm','interior-point');
sixmin = @(x)(4*x(1)^2 - 2.1*x(1)^4 + x(1)^6/3 ...
+ x(1)*x(2) - 4*x(2)^2 + 4*x(2)^4);
problem = createOptimProblem('fmincon','x0',[-1,2],...
'objective',sixmin,'lb',[-3,-3],'ub',[3,3],...
'options',opts);
[xming,fming,flagg,outptg,manyminsg] = run(gs,problem);
Num Pts Best Current Threshold Local Local
Analyzed F-count f(x) Penalty Penalty f(x) exitflag Procedure
0 34 -1.032 -1.032 1 Initial Point
200 1291 -1.032 -0.2155 1 Stage 1 Local
300 1393 -1.032 248.7 -0.2137 Stage 2 Search
400 1493 -1.032 278 1.134 Stage 2 Search
446 1577 -1.032 1.6 2.073 -0.2155 1 Stage 2 Local
500 1631 -1.032 9.055 0.3214 Stage 2 Search
600 1731 -1.032 -0.7299 -0.7686 Stage 2 Search
700 1831 -1.032 0.3191 -0.7431 Stage 2 Search
800 1931 -1.032 296.4 0.4577 Stage 2 Search
900 2031 -1.032 10.68 0.5116 Stage 2 Search
1000 2131 -1.032 -0.9207 -0.9254 Stage 2 Search
GlobalSearch stopped because it analyzed all the trial points.
All 3 local solver runs converged with a positive local solver exit flag.Запустите тот же пример без GlobalSearch итеративное отображение, но с fmincon итеративное отображение:
gs.Display = 'final';
problem.options.Display = 'iter';
[xming,fming,flagg,outptg,manyminsg] = run(gs,problem);
First-order Norm of
Iter F-count f(x) Feasibility optimality step
0 3 4.823333e+001 0.000e+000 1.088e+002
1 7 2.020476e+000 0.000e+000 2.176e+000 2.488e+000
2 10 6.525252e-001 0.000e+000 1.937e+000 1.886e+000
3 13 -8.776121e-001 0.000e+000 9.076e-001 8.539e-001
4 16 -9.121907e-001 0.000e+000 9.076e-001 1.655e-001
5 19 -1.009367e+000 0.000e+000 7.326e-001 8.558e-002
6 22 -1.030423e+000 0.000e+000 2.172e-001 6.670e-002
7 25 -1.031578e+000 0.000e+000 4.278e-002 1.444e-002
8 28 -1.031628e+000 0.000e+000 8.777e-003 2.306e-003
9 31 -1.031628e+000 0.000e+000 8.845e-005 2.750e-004
10 34 -1.031628e+000 0.000e+000 8.744e-007 1.354e-006
Local minimum found that satisfies the constraints.
Optimization completed because the objective function is non-decreasing in
feasible directions, to within the selected value of the function tolerance,
and constraints were satisfied to within the selected value of the constraint tolerance.
<stopping criteria details>
First-order Norm of
Iter F-count f(x) Feasibility optimality step
0 3 -1.980435e-02 0.000e+00 1.996e+00
... MANY ITERATIONS DELETED ...
8 33 -1.031628e+00 0.000e+00 8.742e-07 2.287e-07
Local minimum found that satisfies the constraints.
Optimization completed because the objective function is non-decreasing in
feasible directions, to within the selected value of the function tolerance,
and constraints were satisfied to within the selected value of the constraint tolerance.
<stopping criteria details>
GlobalSearch stopped because it analyzed all the trial points.
All 4 local solver runs converged with a positive local solver exit flag.При установке GlobalSearch итеративное отображение, а также fmincon итеративное отображение, приводит к обоим смешиваемым отображениям.
Для примера итеративного отображения в параллельной среде смотрите Параллель MultiStart.