function DrawFinal(HOURS,steps,waittime)

% DRAWFINAL Draws the results of the steps saved for a selected experiment
%
% DrawFinal(Hours,steps,waittime)
% Hours: experiment of the given hours
% 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-%d',HOURS,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));
        hold on
      end
       title(sprintf('Case: %d. Iter %d',HOURS,j));
      pause(waittime)
   end
end
