problem with curve tracking obtained by the genetic algorithm
Afficher commentaires plus anciens
Hello,
I'm running a genetic algorithm with linear inequality constraints:
gaoptions = gaoptimset('TolCon', 1e-12, 'TolFun', 1e-8, 'CrossoverFcn', @crossoverheuristic, 'MutationFcn',@mutationadaptfeasible, 'PopulationSize', 100, 'Generations', 200, 'InitialPopulation',U0');
U =ga(@(U0) funcaoObjetivo(QP,U0',n,auxPrevisoes,R,Riqueza,auxR1,tbBarra,C,D,r1,ci,Uant,peso1,peso2),m*(n+1),B,b,[],[],[],[],[],gaoptions);
I'm also running the same algorithm with fmincon optimization.
options = optimoptions(@fmincon,'Algorithm','sqp','TolFun',1e-12);
U = fmincon(@(U0) funcaoObjetivo(QP,U0,n,auxPrevisoes,R,Riqueza,auxR1,tbBarra,C,D,r1,ci,Uant,peso1,peso2),U0,B,b,[],[],[],[],[],options);
Both results must be equivalents however, the genetic algorithm is not able to achieve good solutions as fmincon does. The main objective is tracking a curve, the solutions obtained by fmincon get tracking the curve exactly (with small error), the solutions obtained by ga also get tracking the curve but with a big error. Do you know what can be my mistake?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Genetic Algorithm dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!