function DrawFinal(steps,waittime)

% DRAWFINAL Draws the results of the steps saved for a selected experiment
%
% DrawFinal(steps,waittime)
% steps: An array with the selected steps you want to show. There must be a
%        result file named result_Hours_steps for each of the values in the
%        steps array
% waittime: time to wait before changing the figure for next step

% APRENDIZAJE AUTOMÁTICO (G. Pajares y J. M. de la Cruz, Eds.)
% Editorial: RA-MA
% Capítulo 9: El Aprendizaje con Algoritmos Genéticos
% Autores: Bonifacio de Andres y Toro


figure;
for j=steps
   file=sprintf('results-%d',j) ;
   if exist(sprintf('%s.mat',file))
      load(file);
      index=STORE_INDEX(end,1):STORE_INDEX(end,2);
      OPTIM_VALUES=STORE_VALUE(index,:),
      colour=repmat(['r';'b';'g';'m';'k';'c';'y'],1,ceil(length(index)/7));
      hold off;
	  for i=1:length(index)
        %figure(i);
   		%plot(STORE_CHROM(index(i),:),colour(i));
        plot(cumsum([0,STORE_CHROM{index(i)}(2,1:end-1)]),STORE_CHROM{index(i)}(1,:),colour(i));
	    hold on
      end
      
      title(sprintf('Iter %d',j));
      pause(waittime)
   end
end

