Question Regarding MultiObjective Optimization - gamultiobj
이전 댓글 표시
Hi. I want to create a model for multi objective optimization.
I have 300 items and three variables for each. Objective is the a function of using 300 items * 3 variables. So I don't want to write 900 seperate variables in the function, if possible. Thanks a lot in advance.
My code is as follows. Also I receive the following error.
error message
++
Not enough input arguments.
Error in globalfun (line 6)
y(1) = sum((1-x(1,1)*0.99)+(1-x(1,2)*0.95)+(1-x(1,3)*0.90));
Error in MCICv2 (line 26)
[x,fval] = gamultiobj(globalfun,numberOfVariables);
++
Script part
++
clc;clear all;close all;
global leadtime
data = readmatrix('Data.xlsx');
data(:,1) = [1:301];
ProductCodes = data(:,1);
LeadTime = data(:,4); %This is the value I use for Multi-Objective Optimization
[widthdata, heightdata]= size(data);
numberOfVariables = i*3;
[x,fval] = gamultiobj(globalfun,numberOfVariables);
++
Function Part
+++
function y = globalfun(x)
global LeadTime
y(1) = sum((1-x(:,1)*0.99)+(1-x(:,2)*0.95)+(1-x(:,3)*0.90)); %minimize the sum of all 301 items
y(2) = (x(:,1)*norminv(0.99))+(x(:,2)*norminv(0.95))+(x(:,3)*norminv(0.90))*sqrt(LeadTime(:)); %minimize the sum of this function for 301 items
end
+++
댓글 수: 3
Alan Weiss
2022년 1월 25일
Sorry, I don't quite understand what you are trying to do. How many variables do you have in your optimization, I mean variables that you can control, not data? Do you have 3 variables? 300? 900? I understand that you have two objective functions, but I cannot easily tell which variables you can control and which are data that you do not control.
Alan Weiss
MATLAB mathematical toolbox documentation
Fatih Yigit
2022년 1월 25일
편집: Fatih Yigit
2022년 1월 25일
Fatih Yigit
2022년 1월 25일
채택된 답변
추가 답변 (1개)
카테고리
도움말 센터 및 File Exchange에서 Multiobjective Optimization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!