% SG 060417, revised 110917, 090518

clear
diary GGCCDvAP-KMIPvEM.txt

load('shoppingTest0p2.mat')
fprintf('\n')

fprintf('\nTest set: shoppingTest0.2\n')

fprintf('\nExhaustive Defuzzification\n')
exhaustiveGen(shoppingTest0p2, 'centroid', 'centroid');

fprintf('\nalpha-planes / Karnik-Mendel Iterative Procedure')
alphaPlanesKMIP2017(shoppingTest0p2, 101);
fprintf('Timing for 1000 repetitions: \n')
repeats = 1000;
times = zeros(1, repeats);
for n = 1:repeats
    tic;
    alphaPlanesKMIP2017timing(shoppingTest0p2, 101);
    times(n) = toc;
end
fprintf('Mean = %10.7f\t\t',mean(times))
fprintf('Standard Deviation = %10.7f\n',std(times))

fprintf('\nGeneralised Greenfield-Chiclana Collapsing Defuzzifier')
GGCCD(shoppingTest0p2, 'centroid');
fprintf('Timing for 1000 repetitions: \n')
repeats = 1000;
times = zeros(1, repeats);
for n = 1:repeats
    tic;
    GGCCDtiming(shoppingTest0p2, 'centroid');
    times(n) = toc;
end
fprintf('Mean = %10.7f\t\t',mean(times))
fprintf('Standard Deviation = %10.7f\n',std(times))

clear

diary off