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

# GaussianNetwork_OfflineHPProtein

## PURPOSE

EXAMPLE 8: Gaussian network for the Offline HP Model continuous function

## SYNOPSIS

This is a script file.

## DESCRIPTION

     EXAMPLE 8:  Gaussian network for  the Offline HP Model continuous function
     For reference on the Offline HP model see:

## CROSS-REFERENCE INFORMATION

This function calls:

- RunEDA [AllStat,Cache]=RunEDA(PopSize,n,F,Card,cache,edaparams)
- CreateFibbInitConf Translates the vector to the positions in the grid
- OffPrintProtein [] = OffPrintProtein(vector)

This function is called by:

## SOURCE CODE

    0001  % EXAMPLE 8:  Gaussian network for  the Offline HP Model continuous function
    0002  % For reference on the Offline HP model see:
    0003
    0004  Fibbonacci_n = 7; % Fibbonacci_n: Value n for the construction of the Fibbonacci sequence. NumbVar = F(n)
    0005  global HPInitConf;
    0006  HPInitConf = CreateFibbInitConf(Fibbonacci_n); % HP Fibbonacci configuration
    0007  NumbVar = size(HPInitConf,2);
    0008  PopSize = 200;
    0009  F = 'EvaluateOffHPProtein';
    0010  cache = [1,1,1,1,1]; Card = [zeros(1,NumbVar);2*pi*ones(1,NumbVar)];
    0011  BN_params(1:6) = {'k2',10,0.05,'pearson','bic','no'};
    0012  edaparams{1} = {'learning_method','LearnGaussianNetwork',BN_params};
    0013  edaparams{2} = {'sampling_method','SampleBN',{PopSize,1}};
    0014  edaparams{3} = {'repairing_method','SetInBounds_repairing',{}};
    0015  edaparams{4} = {'stop_cond_method','max_gen',{50}};
    0016   [AllStat,Cache]=RunEDA(PopSize,NumbVar,F,Card,cache,edaparams);
    0017  % To draw the resulting solution use function OffPrintProtein(vector),
    0018  % where vector is the best solution found.
    0019  OffPrintProtein(AllStat{maxgen,2})