Constraints on the genes of a chromosome of multi-objective Genetic algorithm (gamultiobj)
1 view (last 30 days)
Show older comments
I'm using the multi-objective GA in matlab and I have to put constraints on the members of the population as follows: let x be my population vector; its size is 1x192. The constraint is that
sum(reshape(x,6,[]))<=40.
How can I include this in the linear constraints specifications of gamultiobj?
0 Comments
Answers (1)
Alan Weiss
on 28 Mar 2013
You need to write this as a linear inequality of the form
A*x <= b
If I understand you correctly, sum(reshape(x,6,[]) is a 1-by-32 vector. So I am not sure what you mean when you say the value is <= 40. Do you mean each value is less than 40, or the sum of the values?
In any case, you either have one inequality or 32 inequalities that you need to represent as A*x <= b. The matrix A will either be a row vector of 192 elements, some of which are zeros and some are ones. Or it will be a 32-by-192 matrix, again consisting of zeros and ones. b will be either the scalar 40, or will be a vector of 32 elements, probably consisting of all 40s.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
See Also
Categories
Find more on Genetic Algorithm in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!