image thumbnail

Leveldiagrams for multiobjective decision making

by

 

08 May 2009 (Updated )

A tool to draw Leveldiagrams for Pareto Set/Front, allowingsome basics graphics manipulations.

[c,lg]=paretopoint5(lg,figura)
function [c,lg]=paretopoint5(lg,figura)
% [c,lg]=paretopoint5(lg,figure)
%    Select a point in the figure and shows Pareto values.
%    Select the point with the mouse and press enter, the point
%    is shown in all subplots
%
% (c) cpoh 2006

figure(figura)
dobj=datacursormode(figura);
set(dobj,'DisplayStyle','window');
set(dobj,'Enable','on');
%waitforbuttonpress;
pause
info = getCursorInfo(dobj);
set(dobj,'Enable','off');


auxj=lg.slayer;%/max(lg.slayer)*100;
% busca que en que eje se ha seleccionado el punto
x=find(lg.axis<info.Target,1,'last');
% busca los puntos que tiene la misma norma
indi=find(auxj==info.Position(2));
if figura==lg.figuras(1)
    xind=find(lg.spf(indi,x)==info.Position(1));
else
    xind=find(lg.sps(indi,x-lg.nobj)==info.Position(1));
end
c=indi(xind);
% for i=1:lg.numind
%     if auxj(i)==info.Position(2)
%         break;
%     end
% end
% c=i;

if isempty(lg.selpoint)
    % si no existe un punto seleccionado crea uno vacio
    lg.selpoint=zeros(1,lg.nobj+lg.npar);
else
    % si existe un punto seleccionado lo borra
    for i=1:(lg.nobj+lg.npar)
        delete(lg.selpoint(i));
    end
end
figure(lg.figuras(1))
for ii=1:lg.nobj
    eval(['subplot(' num2str(lg.layout(1)) ',' num2str(lg.layout(2)) ',' num2str(ii) ')'])
    hold on;
    lg.selpoint(ii)=plot(lg.spf(c,ii),auxj(c),'gs','LineWidth',2);
end
figure(lg.figuras(2))
for ii=1:lg.npar
    eval(['subplot(' num2str(lg.layout(3)) ',' num2str(lg.layout(4)) ',' num2str(ii) ')'])
    hold on;
    lg.selpoint(ii+lg.nobj)=plot(lg.sps(c,ii),auxj(c),'gs','LineWidth',2);
end

disp('Selected point: ')
disp(num2str(c))
disp('Objetives:')
disp(num2str(lg.spf(c,:)))
disp('Theta:')
disp(num2str(lg.sps(c,:)))

Contact us