Documentation of objfun10

Global Index (all files) (short | long) | Local contents | Local Index (files in subdir) (short | long)

Function Synopsis

ObjVal = objfun10(Chrom, option);

Help text

 OBJective function for ackley`s path FUNction 10

 This function implements the ACKLEY's PATH function 10.
 Source: Ackley, D. "A connectionist machine for genetic hillclimbing";
         International series in engineering and computer science, SECS 28,
         Boston: Kluwer Academic Publishers, 1989
         or in ICGA5 page 592

 Syntax:  ObjVal = objfun10(Chrom, option)

 Input parameters:
    Chrom     - Matrix containing the chromosomes of the current
                population. Each row corresponds to one individual's
                string representation.
                if Chrom == [], then speziell values will be returned
    option    - if Chrom == [] and
                option == 1 (or []) return boundaries
                option == 2 return title
                option == 3 return value of global minimum

 Output parameters:
    ObjVal    - Column vector containing the objective values of the
                individuals in the current population.
                if called with Chrom == [], then ObjVal contains
                option == 1, matrix with the boundaries of the function
                option == 2, text for the title of the graphic output
                option == 3, value of global minimum
                
 See also: objfun1, objfun1a, objfun1b, objfun2, objfun6, objfun7, objfun8, objfun9

Cross-Reference Information

This function is called by

Listing of function objfun10



% Author:     Hartmut Pohlheim
% History:    06.03.95     file created (copy of objfun6.m)

function ObjVal = objfun10(Chrom, option);

% Compute population parameters
   [Nind, Nvar] = size(Chrom);

% Check size of Chrom and do the appropriate thing
   % if Chrom is [], then define size of boundary-matrix and values
   if Nind == 0
      % Default dimension of objective function
      Dim = 20;
      % return text of title for graphic output
      if option == 2
         ObjVal = ['ACKLEYs PATH function 10'];
      % return value of global minimum
      elseif option == 3
         ObjVal = 0;
      % define size of boundary-matrix and values
      else   
         % lower and upper bound, identical for all n variables        
         ObjVal = repmat([-32.768; 32.768], [1 Dim]);
      end
   % compute values of function
   else
      % function 10, -a*exp(-b*sqrt(1/Nvar*sum(xi^2))-exp(1/Nvar*sum(cos(c*xi)))+a+e
      % for i = 1:Nvar (Nvar = 20)
      % n = Nvar, -32.768 <= xi <= 32.768
      % global minimum at (xi)=(0) ; fmin=0
      a = 20; b = 0.2; c = 2 * pi; e = exp(1);
      ObjVal = -a * exp(-b * sqrt(1/Nvar * sum((Chrom .* Chrom)')'));
      ObjVal =  ObjVal - exp(1/Nvar * sum(cos(c * Chrom)')') + a + e;
   end   


% End of function

GEATbx: Main page  Tutorial  Algorithms  M-functions  Parameter/Options  Example functions  www.geatbx.com 

This document is part of version 3.7 of the GEATbx: Genetic and Evolutionary Algorithm Toolbox for use with Matlab - www.geatbx.com.
The Genetic and Evolutionary Algorithm Toolbox is not public domain.
© 1994-2005 Hartmut Pohlheim, All Rights Reserved, (support@geatbx.com).