How can i use ga optimization to generate bit solutions in a vector?
Afficher commentaires plus anciens
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.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Choose a Solver dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!