How to solve the problem that the hybrid algorithm in mixed integer programming is ignored

3 ビュー (過去 30 日間)
lb = [0.0002 0.0002 5];
ub = [0.001 0.002 19];
intcon = 3
nonlcon = @yueshu;
hybridopts = optimoptions('fmincon','OptimalityTolerance',1e-10);
options = optimoptions('ga','HybridFcn',{'fmincon',hybridopts});
[x,fval] = ga(fun,nvars,A,b,Aeq,beq,lb,ub,nonlcon,intcon,options)
When I run the hybrid algorithm above, MATLAB gives a warning:GA ignores 'HybridFcn' option when the problem contains integer constraints.My version is 2022b, how to solve this situation, are there any experts who understand

採用された回答

Adam Danz
Adam Danz 2023 年 4 月 15 日
As per the documentation (see this page), there are some restrictions on the types of problems that ga can solve when you include integer contraints. ga overrides the HybridFcn option and throws a warning.
To prevent the warning, remove the HybridFcn from the optimization options.
options = optimoptions('ga','HybridFcn',{'fmincon',hybridopts});
% remove ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2 件のコメント
杨杨 蒋
杨杨 蒋 2023 年 4 月 15 日
What if I have to use a hybrid algorithm
Adam Danz
Adam Danz 2023 年 4 月 15 日
No hybrid functions support integer constraints (see the doc page link in my answer). You can set intcon to empty to ignore integer constraints.
[x,fval] = ga(fun,nvars,A,b,Aeq,beq,lb,ub,nonlcon,[],options)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by