Chosing the step between lower bound and upper bound in genetic algorithm
12 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Volahasina Rasendramalala
el 6 de Mayo de 2016
Respondida: John D'Errico
el 23 de Sept. de 2021
I am doing the optimization of the membership function of a fuzzy logic controller using genetic algorithm. I would like to control the step between the lower bound and the upper bound. For instance, instead of verifying the number 0.235689745121, it should go from 0.23 to 0.24. Meaning, with a step of 0.01. Any idea how I can achieve that?
1 comentario
Respuestas (1)
John D'Errico
el 23 de Sept. de 2021
Actually, this is simple. even trivial.
Can you force a variable to take on integer valiues in GA? (yes)
In the help for GA, I see it has a variable intcon. intcon allows you to specify that some of the variables will be held to integer values. So you can specify that x(1) is forced to take on only integer values. Why does this help? Easy. Suppose that x(1) must run from 0.23 to 0.24, with a step of 0.001? (I ASSUME YOU MEANT A STEP OF 0.001, NOT 0.01.)
All you need to do is specify that x(1) must lie in the interval [230, 240] using the bound constraints, AND must be an integer. Now, inside your objective function, divide x(1) by 1000.
(230:240)/1000
The result will be a value that can take on all 11 possible increments of 0.001 between 0.23 and 0.24.
Case closed. (Sorry that nobody answered this before, but at least @Sushil Poudel can benefit from this answer.)
0 comentarios
Ver también
Categorías
Más información sobre Genetic Algorithm en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!