フィルターのクリア

using gamultiobj with 24 variables

2 ビュー (過去 30 日間)
Thushara De Silva
Thushara De Silva 2018 年 9 月 23 日
コメント済み: Thushara De Silva 2018 年 9 月 28 日
My fitness function (fit_KotPol) calculate two values for 24 variables. I want to define the inti
fitnessfcn = @fit_KotPol;
nvars = 24;
lb=[22.2 22.2 22.2 22.2 22.2 22.2 22.2 22.2 22.2 22.2 22.2 22.2 0 0 0 0 0 0 0 0 0 0 0 0];
ub=[172.9 172.9 172.9 172.9 172.9 172.9 172.9 172.9 172.9 172.9 172.9 172.9 140 140 140 140 140 140 140 140 140 140 140 140];
A = [ ]; b = [ ]; Aeq = [ ]; beq = [ ];
startTime = tic;
options = optimoptions('gamultiobj','UseParallel',true,'PlotFcn',{@gaplotpareto,@gaplotscorediversity});
[x,fval,exitflag,output] = gamultiobj(fitnessfcn,nvars,lb,ub,options);
stopTime = toc(startTime);
I got the error
Error using gamultiobj (line 281)
GAMULTIOBJ requires the following inputs to be of data type double: 'Aeq'.
Help me to use the gamultiobj

回答 (2 件)

Stephan
Stephan 2018 年 9 月 23 日
編集済み: Stephan 2018 年 9 月 23 日
Hi,
the input syntax for gamultiobj has no option for passing lb and ub to gamultiobj without also passing A,b Aeq, beq. You defined them all, but you dont use them in your function call.
Use:
[x,fval,exitflag,output] = gamultiobj(fitnessfcn,nvars,A,b,Aeq,beq,lb,ub,options);
Best regards
Stephan
  16 件のコメント
Walter Roberson
Walter Roberson 2018 年 9 月 28 日
The number of pareto points returned by gamultiobj is not known in advance.
x will be m by nvars, so something by 24 in your case, where m is however many pareto points the function detected during the limits it was given on execution.
Thushara De Silva
Thushara De Silva 2018 年 9 月 28 日
Thank you Walter Roberson and Stephan Jung for the reply. Those are really helpful.

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


Thushara De Silva
Thushara De Silva 2018 年 9 月 27 日
編集済み: Walter Roberson 2018 年 9 月 28 日
Further to the above question how can I initialize the population? I want to give initial values for 24 variables as below.
InitialPopulationMatrix_Data = [93.2 66.6 40 59 78 97 116 135 154 172.9 146.3 119 39 76 104 120 107 58 80 80 53 61 60 36]
However, the population size is 200 as default. How do I do it?
Please help.
  1 件のコメント
Walter Roberson
Walter Roberson 2018 年 9 月 28 日
When you supply a population matrix in the options, if the number of rows you provide is less than the population size, then it will initialize the remaining rows randomly.

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by