Problem with linear constraints in Genetic algorithm - optimtool.
显示 更早的评论
Hi all. We have a problem with genetic algorithm in optimtool. We use linear contraints to minimize cost function. It seems that optimtool cannot get linear constraints into account during computation. We have simple cost function: y= -(1000*x(1) + 2000*x(2)); Linear constraints: function [c, ceq] = simple_constraint(x); c = [50*x(1) + 80*x(2) - 100]; ceq = []; We use bitstring as genes in chromozomes. Minimizing this function, x = [0 1]. Cost function value is -2000. When we use function "ga" in m-file, everything is OK. But when we use optimtool, we assign cost function, then we insert matrix A = [50 80] and vector b = [100] as linear constraints. But result of minimizing of this problem is x = [1 1] and cost function value is -3000. It seems that with bitstring coding constraints are not computed. When we use another example for double vector minimizing problem, everything is OK. We have also tried to set all parameters in OPTIONS in funtion ga and parameters in optimtool same, but still we have different results.
If anybody of you have some example with genetic algorithm in optimtool with bit coding (bitstring) to minimize cost function with linear constraints we would be pleased to see your solution.
Thanks a lot.
Best regards.
Jiri Kocian, Czech Republic
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Genetic Algorithm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!