gamultiobj population type only integers

Hi,
I am using gamultiobj for optimization and i want my populatio to take only integer number values like 0, 1 , 2 , 3 , 4 , 5. How can i do that?

 Respuesta aceptada

Alan Weiss
Alan Weiss el 3 de Ag. de 2012

0 votos

The answer, unfortunately, is that you cannot restrict variables in gamultiobj to be integer-valued.
There is a possibility that custom population, mutation, and crossover functions could work for you, but you will have to do the programming for yourself. See this technical note.
But I am not sure that this will work. Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

4 comentarios

E K
E K el 3 de Ag. de 2012
thank you for your answer alan. Eventhough i coded new mutation and population functions i am still getting errors.
I tried to use binary string but i need it in vector form. So is it possible to turn a binary number to a binary vector like;
101010101010 to [1 0 1 0 1 0 ...]
E K
E K el 3 de Ag. de 2012
and in technical note it says this feature added after 2011 i am using 2012. but i cant find the option in gamultiobj options.
Alan Weiss
Alan Weiss el 3 de Ag. de 2012
The feature was coded in ga, but not gamultiobj. See the release notes.
As for programming the mutation, crossover, and population creation functions, I am afraid that I cannot help you. Sorry. Perhaps if you are in a low enough dimensional space, you could just create all the possible binary variables and evaluate the objective functions, and then see which are nondominated. But this would only work with up to perhaps 20 variables, which would give you about 1e6 points.
Alan Weiss
MATLAB mathematical toolbox documentation
E K
E K el 3 de Ag. de 2012
Editada: E K el 3 de Ag. de 2012
Thank you for your help Alan. It is sad the feature is not added to gamultiobj. i am trying one last round about to get this i turned my population type to binarystring.
but what is the type of x that gamultiobj send as 'binarystring'?
i act as char and added
x=bin2dec(x);
x=dec2bin(x,len)
x = x -'0';
lines to my code to turn it to a binary matrix but i am geting the error
input must be string.
so i guess it is not char.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Particle & Nuclear Physics en Centro de ayuda y File Exchange.

Preguntada:

E K
el 3 de Ag. de 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by