How can i use ga optimization to generate bit solutions in a vector?
1 次查看(过去 30 天)
显示 更早的评论
Hi.
I am trying to use optimization toolbox with ga solver or only with ga function to find a solution that contains only bit variables present in a vector with 9 positions. Each position contains 0 or 1, as a representation of the "on/off" of 9 branches in a distribution network.
I've set: Polpulation type as : bitString Creation funtion as : uniform Mutation function as: uniform Crossover funtion as: scaterred
As was said by toolbox warning that appears when bitString population is choosen.
I've defined an equality constraint to confine the solutions to 6 and only 6 bits. For that, I set:
Aeq=[1,1,1,1,1,1,1,1,1].
beq=6
The problem is that generated solutions are not only bits. Some solutions do not respect the population type specified, so they are not valid.
I mean, when it should generate solutions like [1,1,1,1,1,1,0,0,0].
In many cases it generates a solution like [1.6161, 0, 0, 0.7306, 0, 0.7306, 0.7306, 0.7306, 0].
So I do not understand what is happening, and I think that I am probably missing some parameter that is adulterating the solutions generated in each iteration.
So if anyone can help me I really appreciate.
Best regards, Vitor Ribeiro.
0 个评论
采纳的回答
Alan Weiss
2014-5-8
I suggest that you use mixed integer GA. This form does not take equality constraints, but, as documented, you can use two inequality constraints, possibly with a bit of slack.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
2 个评论
Alan Weiss
2014-5-15
编辑:Alan Weiss
2014-5-16
The documentation link I gave states the following for the bit string population type:
You cannot use a Hybrid function, and ga ignores all constraints, including bounds, linear constraints, and nonlinear constraints.
It is very easy to use mixed integer GA, I suggest again that you look at it.
Alan Weiss
MATLAB mathematical toolbox documentation
更多回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!