Genetic algorithm hybrid scheme with integer constraints

3 ビュー (過去 30 日間)
杨杨 蒋
杨杨 蒋 2023 年 4 月 13 日
コメント済み: 杨杨 蒋 2023 年 4 月 15 日
IntCon = 3;
nonlcon = @yueshu;
options = optimoptions('ga','PlotFcn',{@gaplotbestf,@gaplotstopping},'Display','diagnose',...
'MaxStallGenerations',5,'FunctionTolerance',1e-3,'MaxGenerations',100,'PopulationSize',100,'EliteCount',10,'CrossoverFraction',0.8,...
'UseVectorized',false);
fun = @youhua_ga0201;
lb = [0.0002 0.0002 5];
ub = [0.001 0.002 19];
rng default % For reproducibility
[x,fval,exitflag,output] = ga(fun,3,[],[],[],[],lb,ub,nonlcon,IntCon,options)
In this code, there is an integer constraint, I want to improve the genetic algorithm to use the mixing scheme in the optimization toolbox, but because of the integer constraint, the runtime is warned to ignore the mixing function, how to solve it?
  2 件のコメント
Alan Weiss
Alan Weiss 2023 年 4 月 14 日
As I told you there, you need a version of MATLAB of R2021b or later in order to have a custom crossover, mutation, or creation function. Is there something else that you are asking that is different?
Alan Weiss
MATLAB mathematical toolbox documentation
杨杨 蒋
杨杨 蒋 2023 年 4 月 15 日
No, this time I didn't use a custom variogram, but the "HybridFcn" function in the ga(option) structure, and my version is 2022b, but it still prompts to ignore the hybrid function,

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeGenetic Algorithm についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by