How to solve linear constraint in genetic algorithm with population type of Bit string .?
Mostrar comentarios más antiguos
I am trying to solve binary optimisation problem in matlab R2016a , where i am giving popultion type as 'Bitstring' Problem is when i am giving linear constraint (sum(x)=20), it is ignoring it. How to fix this ?
}
if
{opts = gaoptimset('PopulationSize',300,'InitialPopulation',mypop,..
'PopulationType', 'bitstring','SelectionFcn',{@selectiontournament,tournamentSize},...
'MutationFcn',{@mutationuniform, 0.1},'CrossoverFcn', {@crossoverarithmetic,0.8},...
'EliteCount',2,'StallGenLimit',50,'PlotFcns',{@gaplotbestf},'Display', 'iter');
num=100;
Aeq=[ones(1,num);-ones(1,num)];Beq=[20;-20];
[X_opt,feval,exitflag,output]=ga(@(z)myfunc4_full_2(z,phi_100),num,Aineq,Bineq,[],[],[],[],[],[],opts);
end
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Genetic Algorithm en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!