function [] = plot_cdf()
%
%###########################################################################
% Failure Trace Archive (FAT) scripts
% Program to plot availability and unavailability intervals from event_trace.tab 
%
% Author: Bahman Javadi
%        School of Computing, Engineering and Mathematics
%        Western Sydney University, Australia 
%        b.javadi@westernsydeny.edu.au
%        http://fta.scem.uws.edu.au/
%
%%###########################################################################

load fta_data.mat;

[fa,xa] = ecdf(event_availability_interval);
[fb,xb] = ecdf(event_unavailability_interval);
figure('units','normalized','position',[0.1 0.1 0.5 0.6]);

set(0,'DefaultLineLineWidth',3)
set(0,'DefaultAxesFontName','Helvetica')
set(0,'DefaultAxesFontSize',18)
set(0,'DefaultTextFontName','Helvetica')
set(0,'DefaultTextFontSize',18)
semilogx(xa,fa,'b');
hold all
semilogx(xb,fb,'r--');
legend({'avai','unavai'},'location','northwest');
xlabel('Intervals (hours)');
ylabel('Cumulative fraction');
grid on
