Home > Mateda2.0 > ScriptsMateda > OptimizationScripts > DefaultEDA_NKRandom.m

# DefaultEDA_NKRandom

## PURPOSE

EXAMPLE 9: Bayesian tree for a multiobjective function of the NK random

## SYNOPSIS

This is a script file.

## DESCRIPTION

     EXAMPLE 9:  Bayesian tree for a multiobjective function of the NK random
     landscape (cicular neighbors)

## CROSS-REFERENCE INFORMATION

This function calls:

- RunEDA [AllStat,Cache]=RunEDA(PopSize,n,F,Card,cache,edaparams)
- CreateListFactorsCircularNK [ListFactors] = CreateListFactorsCircularNK(NumberVar,k)
- ReadFunctionsFromData [Tables] = ReadFunctionsFromData(filename,ListFactors,Card)
- FindListCard [ListFactorsCard] = FindListCard(ListFactors,Card)

This function is called by:

## SOURCE CODE

    0001  % EXAMPLE 9:  Bayesian tree for a multiobjective function of the NK random
    0002  % landscape (cicular neighbors)
    0003  PopSize = 500; n = 50; cache = [1,1,1,1,1]; Card = 2*ones(1,n);
    0004  global FunctionTables;
    0005  global FunctionStructure;
    0006  global FunctionAccCard;
    0007
    0008  %[FunctionStructure]    = ReadFactorGraphFromData('testNK_str_N50_k4Inst_1.txt');
    0009  [FunctionStructure] =  CreateListFactorsCircularNK(n,4); % The circular structure is created
    0010  [FunctionTables] = ReadFunctionsFromData('testNK_fnt_N50_k4Inst_1.txt',FunctionStructure,Card); % Values are read from a file
    0011  [FunctionAccCard] = FindListCard(FunctionStructure,Card); % Auxiliary structure for function evaluation
    0012  F = 'EvaluateGeneralFunction';  % General function that uses global variables FunctionTables, FunctionStructure and FunctionAccCard.
    0013  selparams(1:2) = {0.5,'ParetoRank_ordering'};
    0014  edaparams{1} = {'selection_method','truncation_selection',selparams};
    0015  edaparams{2} = {'replacement_method','best_elitism',{'ParetoRank_ordering'}};
    0016  edaparams{3} = {'stop_cond_method','max_gen',{5}};
    0017  [AllStat,Cache]=RunEDA(PopSize,n,F,Card,cache,edaparams);