How to control the step length or accuracy of decision variables X in gamultiobj? I need the X just be assigned as 0.001, 0.002 or 0.02, instead of 0.001234.

1 visualización (últimos 30 días)
I use the funtion gamultiobj. I need the decision variables X just be assigned as 0.001, 0.002 or 0.02, instead of 0.001234. Is there a method to control the step length or accuracy of decision variables X in the multiobjective optimization?
[X,Fval,exitFlag,Output]=gamultiobj(FitnessFunction,numberOfVariables,A,b,Aeq,beq,lb,ub,options);

Respuestas (1)

Walter Roberson
Walter Roberson el 10 de Jun. de 2018
gamultiobj is not designed for discrete variables.
What you have to do is use the options structure:
  • pass in an CreationFcn that uses only the permitted values
  • supply your own CrossoverFcn and MutationFcn, which "just happen" to satisfy your requirement each time
  3 comentarios
Sonja Kallio
Sonja Kallio el 27 de En. de 2021
Could you give us an example how to write CreationFcn with prmitted values?
I have CreationFcn which uses a for loop to create the Initial Population.
There is 3 decision variables which are varied by the for loop.
Should I define the permitted values somehow in the function, for example like this:
x(1) = (1:1:10)
Best regards,
Sonja Kallio
Walter Roberson
Walter Roberson el 28 de En. de 2021
Assuming for a moment that you are using integer variables and that lb and ub have been set appropriately,
for iter = 1 : population size
for var = 1 : nvars
x(var) = randi([lb(var), ub(var)]);
end
population(iter,:) = x;
end

Iniciar sesión para comentar.

Categorías

Más información sobre Surrogate Optimization 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!

Translated by