load risk_rate.dat

tic;

best_vaf = 0.0;
store_vaf = zeros(1000,1);

for i = 1:1000
    
    [outpermone,outpermtwo,coordone,coordtwo,fitone,fittwo,addconone,...
        addcontwo,vaf,monprox] = ms_bimonscalqa(risk_rate,targlin(18),targlin(18), ...
        randperm(18),randperm(18),3,1);
    
    store_vaf(i) = vaf;
    
    if (vaf > best_vaf)
        
        best_vaf = vaf;
        best_outpermone = outpermone;
        best_outpermtwo = outpermtwo;
        best_coordone = coordone;
        best_coordtwo = coordtwo;
        best_fitone = fitone;
        best_fittwo = fittwo;
        best_addconone = addconone;
        best_addcontwo = addcontwo;
        best_monprox = monprox;
        
    end
    
end

sorted_vafs = sort(store_vaf');

sorted_vafs;

        best_vaf
        best_outpermone 
        best_outpermtwo
        best_coordone
        best_coordtwo
        best_fitone
        best_fittwo
        best_addconone
        best_addcontwo 
        best_monprox
        
         axes = zeros(18,2);
        
        for i = 1:18
            
            axes(best_outpermone(i),1) = best_coordone(i);
            axes(best_outpermtwo(i),2) = best_coordtwo(i);
        end
        
        plot(axes(1:18,1),axes(1:18,2),'ko')
        
        hold on
        
        for i = 1:18
            
            objectlabels{i,1} = int2str(i);
            
        end
        
        text(axes(1:18,1),axes(1:18,2),objectlabels,'fontsize',10,'verticalalignment','bottom')
        
        

toc;
