0001  
0002  
0003  
0004  
0005  
0006  
0007  
0008  
0009  n = 50; cache = [1,1,1,1,1]; Card = 2*ones(1,n); 
0010  global FunctionTables;
0011  global FunctionStructure;
0012  global FunctionAccCard;
0013  Number_Inst = 50;  k = 4;  nam = 'TestMPE';  NumberVar = 50;
0014  
0015  
0016  [FunctionStructure] =  CreateListFactorsCircularNK(n,4); 
0017  
0018  
0019  
0020  
0021  for i=1:Number_Inst,
0022   filename = [nam,num2str(i),'.txt'];   
0023   [Table] = CreateRandomFunctions(FunctionStructure,Card);
0024   SaveFunctionValues(filename,NumberVar,FunctionStructure,Table);
0025  end,
0026 
0027 
0028 
0029 F = 'SumEvaluateGeneralFunction';  
0030 MaxGen = 100; PopSize = 500; n = 50; cache = [1,1,1,1,1]; Card = 2*ones(1,n); 
0031 
0032 
0033  stop_cond_params = {MaxGen};
0034  BN_params(1:6) = {'k2',10,0.05,'pearson','bic','no'};
0035  selparams(1:2) = {0.5,'ParetoRank_ordering'};
0036  edaparams{1} = {'selection_method','truncation_selection',selparams};
0037  edaparams{2} = {'replacement_method','best_elitism',{'ParetoRank_ordering'}};
0038  edaparams{3} = {'learning_method','LearnBN',BN_params};
0039  edaparams{4} = {'stop_cond_method','max_gen',stop_cond_params};
0040  
0041 
0042 
0043 
0044 InitPop = fix(2*rand(Number_Inst*PopSize,n));
0045 nruns = 30;  
0046 
0047 
0048 
0049 
0050 for i=1:Number_Inst,
0051    edaparams{6} = {'seeding_pop_method','seed_thispop',{InitPop((i-1)*PopSize+1:i*PopSize,:)}};   
0052    filename = [nam,num2str(i),'.txt'];
0053   [FunctionTables] = ReadFunctionsFromData(filename,FunctionStructure,Card); 
0054   [FunctionAccCard] = FindListCard(FunctionStructure,Card); 
0055  
0056   for j=1:2,
0057     if j==1
0058       edaparams{5} = {'sampling_method','SampleBN',{PopSize}};
0059     else
0060       edaparams{5} = {'sampling_method',' SampleMPE_BN',{PopSize}};
0061     end
0062     for k=1:nruns,
0063      [i,j,k] 
0064      [AllStat,Cache]=RunEDA(PopSize,n,F,Card,cache,edaparams);
0065      ResultsTestsAllStat{i,j,k} = AllStat;
0066      ResultsTestsCache{i,j,k} = AllStat;
0067      save ResultsTest.mat InitPop ResultsTestsAllStat ResultsTestsCache
0068     end
0069   end, 
0070 end