我正在使用Matlab中的遗传算法解决优化的工作计划。但是有一些特殊的约束不仅仅依赖于输入变量。我的特殊约束如下:
Input variable: x (169 elements in the vector x, integer, 1<=x<=23)
Special constraint: sum(Y.*X,2)=L (X is a 169*23 matrix based on the input variable x, Y is a 169*23 mask matrix, and L is a vector like ones(169,1))
例如
x: [2 5 7 9] => X:[0 1 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 1]
Y:[1 1 1 0 0 0 0 1 0 => First element in x can be 1, 2, 3, and 8
1 1 0 0 0 0 1 1 0 => Second element in x can be 1, 2, 7, and 8
0 0 1 1 1 1 0 0 1 => Third element in x can be 3, 4, 5, 6, and 9
1 0 0 1 1 0 0 1 1] => Forth element in x can be 1, 4, 5, 8, and 9
如何在Matlab遗传算法中设置特殊约束?
谢谢!
Jsearcher