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 回表示 (過去 30 日間)
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);

回答 (1 件)

Walter Roberson
Walter Roberson 2018 年 6 月 10 日
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 件のコメント
Sonja Kallio
Sonja Kallio 2021 年 1 月 27 日
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 2021 年 1 月 28 日
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

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSurrogate Optimization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by