% SG 060417, revised 110917, 090518

clear
diary GGCCDvAP-KMIPvEM.txt

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

fprintf('\nTest set: powderTest0.05\n')

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

fprintf('\nalpha-planes / Karnik-Mendel Iterative Procedure')
alphaPlanesKMIP2017(powderTest0p05, 101);
fprintf('Timing for 1000 repetitions: \n')
repeats = 1000;
times = zeros(1, repeats);
for n = 1:repeats
    tic;
    alphaPlanesKMIP2017timing(powderTest0p05, 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(powderTest0p05, 'centroid');
fprintf('Timing for 1000 repetitions: \n')
repeats = 1000;
times = zeros(1, repeats);
for n = 1:repeats
    tic;
    GGCCDtiming(powderTest0p05, 'centroid');
    times(n) = toc;
end
fprintf('Mean = %10.7f\t\t',mean(times))
fprintf('Standard Deviation = %10.7f\n',std(times))

clear

diary off