Home > Mateda2.0 > functions > PartialEvaluateGeneralFunction.m

PartialEvaluateGeneralFunction

PURPOSE ^

[val] = PartialEvaluateGeneralFunction(vector):

SYNOPSIS ^

function[val] = PartialEvaluateGeneralFunction(vector)

DESCRIPTION ^

 [val] = PartialEvaluateGeneralFunction(vector):
          Evaluates a vector on a multimodal function whose structure and
          values are respectively defined as global variables
          But only a subset of the objectives are evaluated 
 INPUT:
 vector: Solution to be evaluated
 FunctionStructure: A global variable. FunctionStructure{i} is a vector of
                    those variables indices where the function i depends on.
 FunctionTables: A global variable. FunctionTables{i}(j) is the value
                 given by the objective i to the configuration indexed by j.
 FunctionAccCard: A global variable. FunctionAccCard{i} stores the
                  accumulated cardinality of variables that belong to objective i.
 SelectedObjectives: A global variable. Specifies with objectives will be
                     evaluated
 OUTPUT 
 val: A vector of with the same size that SelectedObjectives

 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[val] = PartialEvaluateGeneralFunction(vector)
0002 % [val] = PartialEvaluateGeneralFunction(vector):
0003 %          Evaluates a vector on a multimodal function whose structure and
0004 %          values are respectively defined as global variables
0005 %          But only a subset of the objectives are evaluated
0006 % INPUT:
0007 % vector: Solution to be evaluated
0008 % FunctionStructure: A global variable. FunctionStructure{i} is a vector of
0009 %                    those variables indices where the function i depends on.
0010 % FunctionTables: A global variable. FunctionTables{i}(j) is the value
0011 %                 given by the objective i to the configuration indexed by j.
0012 % FunctionAccCard: A global variable. FunctionAccCard{i} stores the
0013 %                  accumulated cardinality of variables that belong to objective i.
0014 % SelectedObjectives: A global variable. Specifies with objectives will be
0015 %                     evaluated
0016 % OUTPUT
0017 % val: A vector of with the same size that SelectedObjectives
0018 %
0019 % Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es)
0020 
0021  global FunctionTables;
0022  global FunctionStructure;
0023  global FunctionAccCard;
0024  global SelectedObjectives;
0025 
0026  nfactors = size(SelectedObjectives,2);
0027  val = zeros(1,nfactors);
0028  for k=1:nfactors,
0029    i = SelectedObjectives(k);
0030    length = size(FunctionStructure{i},2);
0031    j = NumconvertCard(vector(FunctionStructure{i}),length,FunctionAccCard{i})+1;
0032    val(k) = val(k) + FunctionTables{i}(j); 
0033  end
0034  
0035  
0036  
0037  
0038

Generated on Fri 04-Dec-2009 13:38:29 by m2html © 2003