How can i use ga optimization to generate bit solutions in a vector?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Vitor Ribeiro
el 7 de Mayo de 2014
Editada: Alan Weiss
el 16 de Mayo de 2014
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 comentarios
Respuesta aceptada
Alan Weiss
el 8 de Mayo de 2014
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 comentarios
Alan Weiss
el 15 de Mayo de 2014
Editada: Alan Weiss
el 16 de Mayo de 2014
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
Más respuestas (0)
Ver también
Categorías
Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!