Can gaplotpareto be used with saved gamultiobj state data?

I have the gamultiobj state being saved after each generation using outputfunction.m with the following added:
assignin('base','fcnStatus',state)
dt = datestr(now,'mmmm-dd-yyyy_HH_MM_SS');
name = strcat('/Log/',dt,'_Generation');
Filename = sprintf('%s_%d',[pwd name],state.Generation);
save(Filename,'state')
Is it possible to use gaplotpareto to create a graph during the gamultiobj run or after by loading the state data on another computer's matlab instance?
Picture attached of the state loaded on another machine. If gaplotpareto can't be used is there another way to easily recreate the plots from the state data? I'm not too worried about the progressing plot image a static plot for each save state would be great.
Thanks, David

답변 (1개)

Alan Weiss
Alan Weiss 2018년 8월 6일
I think that gaplotpareto is intended to be used as a plot function, so I believe that it would be difficult to call directly. But you can easily plot the Pareto set yourself from the saved state structure. Extract the state.Population matrix, then call your objective function to get the matrix of values (one row for each population member, one column for each objective function). If your objective function is not vectorized, call it on each row of the population matrix in a loop.
Then plot the resulting values however you like. For example, assuming that F is the resulting matrix of objective function values, and assuming that F has two columns:
plot(F(:,1),F(:,2),'m*')
xlabel('Objective 1')
ylabel('Objective 2')
title('Pareto Front')
Alan Weiss
MATLAB mathematical toolbox documentation

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

제품

릴리스

R2018a

질문:

2018년 8월 2일

답변:

2018년 8월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by