% mreCenter1 = [];
% mreCenter2 = [];
% mreCenter5 = [];
% 
% for i = 1:20
%     myTempGac = mreGac2(i,:);
%     tempTestInstanceType = testInstanceType(i,:);
%     mreCenter1 = [mreCenter1;myTempGac(find(tempTestInstanceType == 1))];
%     mreCenter2 = [mreCenter2;myTempGac(find(tempTestInstanceType == 2))];
%     mreCenter5 = [mreCenter5;myTempGac(find(tempTestInstanceType == 5))];
% end

% below is to test individual center runs
load('NASA93CenterExperiments\mreCenter1.csv');
load('NASA93CenterExperiments\mreCenter2.csv');
load('NASA93CenterExperiments\mreCenter5.csv');
load('NASA93CenterExperiments\mreCenter1CC.csv');
load('NASA93CenterExperiments\mreCenter2CC.csv');
load('NASA93CenterExperiments\mreCenter5CC.csv');;

mre21 = mreCenter1;
mre22 = mreCenter1CC;

win = zeros(2,1);
tie = zeros(2,1);
loss = zeros(2,1);

% start calculating win tie loss values
for i = 1:2
    
    for j = 1:2
        
        if i ~= j   % if i and j are different
            
            for k = 1:size(mre21,1)
                eval(['[P, H] = ranksum(mre2',num2str(i),'(',num2str(k),',:),mre2',num2str(j),'(',num2str(k),',:));']);
                if H == 0   % if they are the same
                    eval(['tie(',num2str(i),') = tie(',num2str(i),') +1;']);
                    eval(['tie(',num2str(j),') = tie(',num2str(j),') +1;']);
                else
                    % calculate median values
                    eval(['medi = mean(mre2',num2str(i),'(',num2str(k),',:));']);
                    eval(['medj = mean(mre2',num2str(j),'(',num2str(k),',:));']);
                    if medi < medj
                        eval(['win(',num2str(i),') = win(',num2str(i),') +1;']);
                        eval(['loss(',num2str(j),') = loss(',num2str(j),') +1;']);
                    else
                        eval(['win(',num2str(j),') = win(',num2str(j),') +1;']);
                        eval(['loss(',num2str(i),') = loss(',num2str(i),') +1;']);
                    end
                end
            end
            
        end
    end
end

win = win./2
tie= tie./2
loss = loss./2

