Home > Mateda2.0 > functions > generators > CreateNKFunctions.m

# CreateNKFunctions

## PURPOSE

[Table] = CreateNKFunctions(ListFactors)

## SYNOPSIS

function [Table] = CreateNKFunctions(ListFactors)

## DESCRIPTION

     [Table] = CreateNKFunctions(ListFactors)
     CreateNKFunctions:    Generates random values for the table entries of the NK landscape
     INPUTS
     ListFactors: Each  row i stores the numb variables in the factor (k+1), the
                  current variable (i), and its k neighbors
     OUTPUTS
     Tables{i}: Contains the values for each of the 2^k configurations of
                factor

     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 [Table] = CreateNKFunctions(ListFactors)
    0002 % [Table] = CreateNKFunctions(ListFactors)
    0003 % CreateNKFunctions:    Generates random values for the table entries of the NK landscape
    0004 % INPUTS
    0005 % ListFactors: Each  row i stores the numb variables in the factor (k+1), the
    0006 %              current variable (i), and its k neighbors
    0007 % OUTPUTS
    0008 % Tables{i}: Contains the values for each of the 2^k configurations of
    0009 %            factor
    0010 %
    0011 % Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es)
    0012
    0013 totfactors = size(ListFactors,1);
    0014
    0015 for i=1:totfactors
    0016  Table{i} = rand(1,2^ListFactors(i,1)); %We assume variables have binary cardinality
    0017 end,