ga with population from a given set
2 次查看(过去 30 天)
显示 更早的评论
Dear all,
I am writing to ask you whether it is possibile to impose that, at each generation of genetic algorithm, the individuals (whose genotype is a string of 175 bits) belong to a given set. To be more clear, I would like that any individual x = [x(1) ... x(175)] to be equal to one of the rows of the binary matrix A \in \mathbb{R}^{2500 \ntimes 175}. Should I impose any nonlinear constrain? Or else? Many thanks for your kind attention and my best regards,
Fabio.
0 个评论
采纳的回答
Elizabeth Reese
2017-8-9
If you are not using a bitstring or custom for the PopulationType in your ga options, then you can encode this constraint using the nonlcon input. This would require you to write a function that returns C and Ceq such that C( x)<=0 and Ceq( x)=0. In your case, you can let C = [] and then assign Ceq to be a vector where Ceq(i) is 0 if individual i is fulfilling your constraint and 1 otherwise. You can use ismember to test if the x is a row of A.
If you are using those options for PopulationType, then ga and gamultiobj ignore all constraints. In this case, you may consider using gamultiobj and defining an objective function that penalizes the x's that are not a row of A. This would work in a similar way to how Ceq is formulated.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear Model Identification 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!