

clear

clc

%inceput must be greater or equal to 2

inceput = 2;

sfarsit = 10;

numarSimulari=20;


timpiProbabilisti = [];



for i=inceput:sfarsit
    
    for j=inceput:sfarsit
        
  
        partialTimes = [];
        
        
        contor = 0;
        
        while contor < numarSimulari
            
            taskSet = generateRandomTaskSetFunction(i, j, 100);
            
            if maxUtilization(taskSet) < 2 && maxUtilization(taskSet) > 1
                
                contor = contor+1;
                
               
                
                tic;
                probRespTime = probabilisticWorstCaseResponseTime(taskSet, 1);
                
                partialTimes(contor) = toc;
                
                
            end
            
        end
        format short;
        timpiProbabilisti(i-inceput+1, j-inceput+1) = mean(partialTimes)
        
      
    end
    
end


format short;
disp('finished')
disp('The probabilistic Analysis lasts:')

timpiProbabilisti


