Share information between objective and constraint function with genetic algorithm
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I am using the genetic algorithm solver to minimise a function with non-linear constraints and mixed-integer variables. My constraints and objective functions share some heavy and identical computation. I was wondering whether there was a way to pass variables between these functions? I wanted to use something like Objective and Nonlinear Constraints in the Same Function, but it doesn't work with the genetic algorithm solver. I am using the gentic algorithm as follows:
fun = @computeMagVol;
nVars = 4;
A = [];
b = [];
Aeq = [];
beq = [];
lb = [4, 80, 1,1];
ub = [6,130,41,4];
nonlcon = @combineConstraints;
IntCon = [3,4];
options = optimoptions('ga','PopulationSize' , 25, ...
'PlotFcn' ,@gaplotPopAndBestIndiv, ...
'FunctionTolerance', 1.0000e-03 );
[x,fval,exitflag,output] = ga(fun,nVars,A,b,Aeq,beq,lb,ub,nonlcon,IntCon,options);
toc
Any suggestions would be greatly appreciated.
Best,
Ryan
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Genetic Algorithm finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!