Why fgoalattain does not work?

2 views (last 30 days)
Jamais avenir
Jamais avenir on 8 Jun 2015
Dear all I am solving a multi-objective problem in Matlab using fgoalattain function in order to compare my results with NBI method. Since the problem is so large and the constraints are so tight, any arbitrary setting and initial point don't lead to a correct results. I used sqp algorithm within fmincon solver with a particular staring point and got the correct Pareto points with NBI and some other method.
I also tried to use fgoalattain to compare my results. But, unfortunately, it doesn't return any good solutions. Apart from the 1st Pareto point which is all zeros [0 0 0] , it returns a particular answer for all of the other Pareto points. On the other hand, normally I gwt the answers in 200 sec for other methods (NBI,..), but this fgoalattain takes few hours . Also, it should be noted that fgoalattain returns the exit flag zero.
I was suspect of the scales of objective functions. because the first objective function is in range of 1,00000 and the other 2 objective are in range of 10 to 100. So for the next time I considered normalization of the objective functions. but it didn't help.
I don't know what is the problem. But, I am now suspect of the settings of fgoalattain function and the weights.(solver , initial point and ... However I tried to supply it same as NBI method which I already solved the problem with)
Also, I don't know if my implementation of fgoalattain is correct or not. Besides, Are my weights correct? Please check this code below to help me with this problem.
Thanks you in advance.
Here is the structure of my code:
% Option for fmincon, to find anchor points (optimum value of each single objectives)
% Other solvers don't reveal any good answer.
options = optimset('Algorithm', 'sqp', 'Display', 'off');
% here, each objective function is individually optimized to find the anchor points %( or goals?)
rc=1;
R=[1;1;1] % ignore normalization of single objectives.
for i = 1:3 % 3 objective function
g_Index = i; % This index determines which objective function to be optimized
[ShadowX(:,i),Fval, FLAG] =fmincon(@(X)myFS(X,Dat,g_Index),X,A_ineq,B_ineq,Aeq,Beq,...
lb,ub,@(X)SQPnolcon(X,Dat),options);
ShadowF(:,i)=myFM(ShadowX(:,i),Dat,rc,R);%[f1* f1 f1; f2 f2* f2 ;f3 f3 f3*] , payyoff table
disp(['ExitFlag: ' num2str(FLAG)]); % all exit flags are 1 at this stage.
end
% here is the goal vector. right?
g=zeros(1,3);
g(1)=min(ShadowF(1,:)); % min of f1
g(2)=min(ShadowF(2,:)); % min of f2
g(3)=min(ShadowF(3,:)); % min of f3
mx(1)=max(ShadowF(1,:));% max of f1
mx(2)=max(ShadowF(2,:));% max of f2
mx(3)=max(ShadowF(3,:));% max of f3
R=abs(g-mx); % Range for normalization for objective
k=0;
% Here I define a set of weights
k=0;
alpha1 = 0:0.5:1;
for i = 1:numel(alpha1)
for ii = 1:numel(alpha1)-i+1
k = k + 1;
w(k,:) = [alpha1(i) alpha1(ii) 1-(alpha1(i)+alpha1(ii))];
end
end
N=size(w,1); % Number of weights
rc=0;
for h=1:N
[x(N+1,:),f(N+1,:),attainfactor,exitflag]=fgoalattain(@(X)myFM(X,Dat,rc,R),X,g,w(1,:),...
A_ineq,B_ineq,Aeq,Beq,lb,ub,@(X)SQPnolcon(X,Dat),options);
exitflag
end

Answers (0)

Community Treasure Hunt

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

Start Hunting!