ga with population from a given set
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
jason beckell
am 3 Aug. 2017
Kommentiert: jason beckell
am 21 Aug. 2017
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 Kommentare
Akzeptierte Antwort
Elizabeth Reese
am 9 Aug. 2017
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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Linear Model Identification finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!