function demo(problem)
clear all; clc ;
global mop params evalCounter itrCounter;
tic;
path('../problems',path); 
path('../evolve',path);
path('../performance',path);

%     rs = RandStream.create('mt19937ar', 'Seed', params.seed);
%     RandStream.setDefaultStream(rs);
%     seed = rem((params.seed+23),1377);
%     rnduni = -seed;
%     rand('state',10);
methodname='MOEAD-AGR';
% methodname='MOEAD-GR';
% methodname='MOEAD-DE';
% methodname='gMOEAD-AGR';
maxruntime=30;
testset={'MOP1','MOP2','MOP3','MOP4','MOP5','tec09_f1','tec09_f2','tec09_f3',...
          'tec09_f4','tec09_f5','tec09_f7','tec09_f8','tec09_f9','tec09_f6','MOP6','MOP7','ZDT1','ZDT2','ZDT3','ZDT4','ZDT6','DTLZ1','DTLZ2'};
for i=1:length(testset)
    testname=testset{i};
    params = loadparams(testname,methodname);
    inputparams(methodname,'dmethod','te');
    for j=1:maxruntime
    evalCounter = 0;
    itrCounter = 1;
    %init
    init(mop);
    %evolve
    while ~terminate()
    pareto = moead(mop);
    pf     = [pareto.objective];  
    ps     = [pareto.parameter];
    end
    end
end
  toc
end
function y =terminate()
    global params evalCounter;
    y = evalCounter>=params.evaluation;
end
