Home > Mateda2.0 > verbose > simple_verbose.m

# simple_verbose

## PURPOSE

[] = simple_verbose(k,AllStat,verbose_params,auxedaparams)

## SYNOPSIS

function[] = simple_verbose(k,AllStat,verbose_params,auxedaparams)

## DESCRIPTION

     [] = simple_verbose(k,AllStat,verbose_params,auxedaparams)
     simple_verbose:      Prints a number of statistics (depending on verbose_params) about generation k of the EDA
     INPUTS
     k:                   Current generation
     AllStat:             Array containing the statistics of the populations.
                          It is updated by the method
                          AllStat{k,1}= matrix of 5 rows and number_objectives
                          columns. Each row shows information about
                          max,mean,median,min, and variance values of the
                          corresponding objective in the current population
                          AllStat{k,2}= Stores the best individual
                          AllStat{k,3}= Number of different individuals
                          AllStat{k,4}= matrix of 5 rows and n
                          columns. Each row shows information about
                          max,mean,median,min, and variance values of the
                          corresponding variable in the current population
                          AllStat{k,5} = time_operations(k,:) Matrix with the time in seconds spent at the main
                          EDA steps at each generation, each of the 6 column stores the times for the
                          following steps {sampling,evaluation,replacement,selection,learning and
                          total (which consider the time by the previous
                          5 and other EDA operations)}
                          AllStat{k,6} =   Vector with the number of evaluations up to each generation
     verbose__params{1}: find_bestinds_method: Name of the procedure for selecting the  best individuals
                                                     from a population (by default is 'fitness_ordering')
     auxedaparams:      Contains the description of all EDA methods and
                        parameters
     OUTPUTS
     AllStat: Array containing the statistics of the population

     Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es)

## CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

## SOURCE CODE

    0001 function[] = simple_verbose(k,AllStat,verbose_params,auxedaparams)
    0002 % [] = simple_verbose(k,AllStat,verbose_params,auxedaparams)
    0003 % simple_verbose:      Prints a number of statistics (depending on verbose_params) about generation k of the EDA
    0004 % INPUTS
    0005 % k:                   Current generation
    0006 % AllStat:             Array containing the statistics of the populations.
    0007 %                      It is updated by the method
    0008 %                      AllStat{k,1}= matrix of 5 rows and number_objectives
    0009 %                      columns. Each row shows information about
    0010 %                      max,mean,median,min, and variance values of the
    0011 %                      corresponding objective in the current population
    0012 %                      AllStat{k,2}= Stores the best individual
    0013 %                      AllStat{k,3}= Number of different individuals
    0014 %                      AllStat{k,4}= matrix of 5 rows and n
    0015 %                      columns. Each row shows information about
    0016 %                      max,mean,median,min, and variance values of the
    0017 %                      corresponding variable in the current population
    0018 %                      AllStat{k,5} = time_operations(k,:) Matrix with the time in seconds spent at the main
    0019 %                      EDA steps at each generation, each of the 6 column stores the times for the
    0020 %                      following steps {sampling,evaluation,replacement,selection,learning and
    0021 %                      total (which consider the time by the previous
    0022 %                      5 and other EDA operations)}
    0023 %                      AllStat{k,6} =   Vector with the number of evaluations up to each generation
    0024 % verbose__params{1}: find_bestinds_method: Name of the procedure for selecting the  best individuals
    0025 %                                                 from a population (by default is 'fitness_ordering')
    0026 % auxedaparams:      Contains the description of all EDA methods and
    0027 %                    parameters
    0028 % OUTPUTS
    0029 % AllStat: Array containing the statistics of the population
    0030 %
    0031 % Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es)
    0032
    0033
    0034  if(k==1)
    0035     PopSize = cell2num(auxedaparams{1}(1));
    0036     n = cell2num(auxedaparams{1}(2));
    0037     F = char(cellstr(auxedaparams{1}(3)));
    0038     Card = cell2num(auxedaparams{1}(4));
    0039     disp([sprintf('PopSize: %d',PopSize)]);
    0040     disp([sprintf('Number of variables: %d',n)]);
    0041     disp([sprintf('Function: %s',F)]);
    0042     %disp([sprintf('Range of the values for the variables: ')]);
    0043     %disp(Card);
    0044
    0045    for i=2:size(auxedaparams,1)
    0046      auxstr1 =  [char(cellstr(auxedaparams{i}(1)))];
    0047      auxstr2 =  [char(cellstr(auxedaparams{i}(2)))];
    0048      disp([sprintf('%s:  %s',auxstr1,auxstr2)]);
    0049      auxparams = auxedaparams{i}(3);
    0050      for j=1:size(auxparams,1)
    0051        if(iscell(auxparams{j}))
    0052         disp([sprintf('Params: '),auxparams{j}{:}]);
    0053        else
    0054         disp([sprintf('Params: '),auxparams{j}]);
    0055        end
    0056      end
    0057    end
    0058  end
    0059
    0060  disp([sprintf('*****************  Generation %d ********************** \n',k)]);
    0061
    0062  disp([sprintf('Max objective values: '), sprintf('%d ',AllStat{k,1}(1,:))]);
    0063  disp([sprintf('Sum of max objective values: '), sprintf('%d ',sum(AllStat{k,1}(1,:)))]);
    0064  disp([sprintf('Mean objective values: '), sprintf('%d ',AllStat{k,1}(2,:))]);
    0065  disp([sprintf('Sum of mean objective values: '), sprintf('%d ',sum(AllStat{k,1}(2,:)))]);
    0066  disp([sprintf('Median objective values: '), sprintf('%d ',AllStat{k,1}(3,:))]);
    0067  disp([sprintf('Sum of median objective values: '), sprintf('%d ',sum(AllStat{k,1}(3,:)))]);
    0068  disp([sprintf('Min objective values: '),    sprintf('%d ',AllStat{k,1}(4,:))]);
    0069   disp([sprintf('Sum of min objective values: '), sprintf('%d ',sum(AllStat{k,1}(4,:)))]);
    0070   disp([sprintf('Variance of the objective values: '), sprintf('%d ',AllStat{k,1}(5,:))]);
    0071
    0072  disp([sprintf('Best individual: '), sprintf('%d ',AllStat{k,2})]);
    0073  disp([sprintf('Number of different individuals: '), sprintf('%d ',AllStat{k,3})]);
    0074
    0075  disp([sprintf('Max values of the variables: '), sprintf('%d ',AllStat{k,4}(1,:))]);
    0076  disp([sprintf('Mean values of the variables: '), sprintf('%d ',AllStat{k,4}(2,:))]);
    0077  disp([sprintf('Median values of the variables: '), sprintf('%d ',AllStat{k,4}(3,:))]);
    0078  disp([sprintf('Min values of the variables: '), sprintf('%d ',AllStat{k,4}(4,:))]);
    0079  disp([sprintf('Variance of the variables: '), sprintf('%d ',AllStat{k,4}(5,:))]);
    0080
    0081  disp([sprintf('number of evaluations: '), sprintf('%d ',AllStat{k,5})]);
    0082
    0083  disp([sprintf('Time: sampling %d, repairing %d, evaluation %d, local_opt %d, replacement %d, selection %d, learning %d, and total %d \n ',AllStat{k,6})]);
    0084
    0085
    0086 return;
    0087