- 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
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);
0 件のコメント
回答 (1 件)
Walter Roberson
2018 年 6 月 10 日
gamultiobj is not designed for discrete variables.
What you have to do is use the options structure:
3 件のコメント
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
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 Exchange で Surrogate Optimization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!