ga with population from a given set

2 ビュー (過去 30 日間)
jason beckell
jason beckell 2017 年 8 月 3 日
コメント済み: jason beckell 2017 年 8 月 21 日
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.

採用された回答

Elizabeth Reese
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.
  1 件のコメント
jason beckell
jason beckell 2017 年 8 月 21 日
Many thanks dear dr. VanDenburgh,
I didn't absolutely know that a logical function (dismember) could be used as a nonlinear constraint. Such news is a great relief for me.
Many thanks again and best regards,
Fabio.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultiobjective Optimization についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by