%-----------------------graphical analysis-----------------------------
%UEs_generator
nue= ceil(numel(UEs(:,1))/20);
%------------------------------
ullstc_satis1=[];miotstc_satis1=[];hdtvstc_satis1=[];uebstc_satis1=[];
glbeff_stc1=[];sysdelay_stc1=[];syssatis_stc1=[];
%------------------------------
ullstc_satis2=[];miotstc_satis2=[];hdtvstc_satis2=[];uebstc_satis2=[];
glbeff_stc2=[];sysdelay_stc2=[];syssatis_stc2=[];
%------------------------------
ullnu_satis1=[];miotnu_satis1=[];hdtvnu_satis1=[];uebnu_satis1=[];
glbeff_nu1=[];sysdelay_nu1=[];syssatis_nu1=[];
%------------------------------
ullnu_satis2=[];miotnu_satis2=[];hdtvnu_satis2=[];uebnu_satis2=[];
glbeff_nu2=[];sysdelay_nu2=[];syssatis_nu2=[];
%------------------------------------------------------------------------
DH_ullsat=[];DL_ullsat=[];SH_ullsat=[];SL_ullsat=[];
DH_miotsat=[];DL_miotsat=[];SH_miotsat=[];SL_miotsat=[];
DH_hdtvsat=[];DL_hdtvsat=[];SH_hdtvsat=[];SL_hdtvsat=[];
DH_uebsat=[];DL_uebsat=[];SH_uebsat=[];SL_uebsat=[];
DH_syssat=[];DL_syssat=[];SH_syssat=[];SL_syssat=[];
DH_sysdel=[];DL_sysdel=[];SH_sysdel=[];SL_sysdel=[];
DH_syseff=[];DL_syseff=[];SH_syseff=[];SL_syseff=[];
for avg=1:5
seba=avg
for chk=1:2
result_test1
% ====== satisfactions ==== and == delay ratio =====
glbull_totnu=[];glbmiot_totnu=[];glbhdtv_totnu=[];glbueb_totnu=[];
glbull_donenu=[];glbmiot_donenu=[];glbhdtv_donenu=[];glbueb_donenu=[];
glbull_notnu=[];glbmiot_notnu=[];glbhdtv_notnu=[];glbueb_notnu=[];
glbull_totstc=[];glbmiot_totstc=[];glbhdtv_totstc=[];glbueb_totstc=[];
glbull_donestc=[];glbmiot_donestc=[];glbhdtv_donestc=[];glbueb_donestc=[];
glbull_notstc=[];glbmiot_notstc=[];glbhdtv_notstc=[];glbueb_notstc=[];
glbull_totmix=[];glbmiot_totmix=[];glbhdtv_totmix=[];glbueb_totmix=[];
glbull_donemix=[];glbmiot_donemix=[];glbhdtv_donemix=[];glbueb_donemix=[];
glbull_notmix=[];glbmiot_notmix=[];glbhdtv_notmix=[];glbueb_notmix=[];
for pr=1:9
%---------------------nu algo ----------------------------------------
glbull_totnu = [glbull_totnu ,(sum(glbrej_ULLnu(:,pr)))+ (sum(glbdone_ULLnu(:,pr)))+(sum(glbnot_ULLnu(:,pr)))];% glb sum usr in nu
glbull_donenu = [glbull_donenu,(sum(glbdone_ULLnu(:,pr)))];
glbull_notnu = [glbull_notnu,(sum(glbnot_ULLnu(:,pr)))];
glbmiot_totnu = [glbmiot_totnu ,(sum(glbrej_MIoTnu(:,pr)))+ (sum(glbdone_MIoTnu(:,pr)))+(sum(glbnot_MIoTnu(:,pr)))];% glb sum usr in nu
glbmiot_donenu = [glbmiot_donenu,(sum(glbdone_MIoTnu(:,pr)))];
glbmiot_notnu = [glbmiot_notnu,(sum(glbnot_MIoTnu(:,pr)))];
glbhdtv_totnu = [glbhdtv_totnu ,(sum(glbrej_Hdtvnu(:,pr)))+ (sum(glbdone_Hdtvnu(:,pr)))+(sum(glbnot_Hdtvnu(:,pr)))];% glb sum usr in nu
glbhdtv_donenu = [glbhdtv_donenu,(sum(glbdone_Hdtvnu(:,pr)))];
glbhdtv_notnu = [glbhdtv_notnu,(sum(glbnot_Hdtvnu(:,pr)))];
glbueb_totnu = [glbueb_totnu ,(sum(glbrej_UEbnu(:,pr)))+ (sum(glbdone_UEbnu(:,pr)))+(sum(glbnot_UEbnu(:,pr)))];% glb sum usr in nu
glbueb_donenu = [glbueb_donenu,(sum(glbdone_UEbnu(:,pr)))];
glbueb_notnu = [glbueb_notnu,(sum(glbnot_UEbnu(:,pr)))];
%------------------------------------- stc algo------------- -----------------
glbull_totstc = [glbull_totstc ,(sum(glbrej_ULLstc(:,pr)))+ (sum(glbdone_ULLstc(:,pr)))+(sum(glbnot_ULLstc(:,pr)))];% glb sum usr in nu
glbull_donestc = [glbull_donestc,(sum(glbdone_ULLstc(:,pr)))];
glbull_notstc = [glbull_notstc,(sum(glbnot_ULLstc(:,pr)))];
glbmiot_totstc = [glbmiot_totstc ,(sum(glbrej_MIoTstc(:,pr)))+ (sum(glbdone_MIoTstc(:,pr)))+(sum(glbnot_MIoTstc(:,pr)))];% glb sum usr in nu
glbmiot_donestc = [glbmiot_donestc,(sum(glbdone_MIoTstc(:,pr)))];
glbmiot_notstc = [glbmiot_notstc,(sum(glbnot_MIoTstc(:,pr)))];
glbhdtv_totstc = [glbhdtv_totstc ,(sum(glbrej_Hdtvstc(:,pr)))+ (sum(glbdone_Hdtvstc(:,pr)))+(sum(glbnot_Hdtvstc(:,pr)))];% glb sum usr in nu
glbhdtv_donestc = [glbhdtv_donestc,(sum(glbdone_Hdtvstc(:,pr)))];
glbhdtv_notstc = [glbhdtv_notstc,(sum(glbnot_Hdtvstc(:,pr)))];
glbueb_totstc = [glbueb_totstc ,(sum(glbrej_UEbstc(:,pr)))+ (sum(glbdone_UEbstc(:,pr)))+(sum(glbnot_UEbstc(:,pr)))];% glb sum usr in nu
glbueb_donestc = [glbueb_donestc,(sum(glbdone_UEbstc(:,pr)))];
glbueb_notstc = [glbueb_notstc,(sum(glbnot_UEbstc(:,pr)))];
%------------------------------------- mix algo------------- -----------------
glbull_totmix = [glbull_totmix ,(sum(glbrej_ULLmix(:,pr)))+ (sum(glbdone_ULLmix(:,pr)))+(sum(glbnot_ULLmix(:,pr)))];% glb sum usr in nu
glbull_donemix = [glbull_donemix,(sum(glbdone_ULLmix(:,pr)))];
glbull_notmix = [glbull_notmix,(sum(glbnot_ULLmix(:,pr)))];
glbmiot_totmix = [glbmiot_totmix ,(sum(glbrej_MIoTmix(:,pr)))+ (sum(glbdone_MIoTmix(:,pr)))+(sum(glbnot_MIoTmix(:,pr)))];% glb sum usr in nu
glbmiot_donemix = [glbmiot_donemix,(sum(glbdone_MIoTmix(:,pr)))];
glbmiot_notmix = [glbmiot_notmix,(sum(glbnot_MIoTmix(:,pr)))];
glbhdtv_totmix = [glbhdtv_totmix ,(sum(glbrej_Hdtvmix(:,pr)))+ (sum(glbdone_Hdtvmix(:,pr)))+(sum(glbnot_Hdtvmix(:,pr)))];% glb sum usr in nu
glbhdtv_donemix = [glbhdtv_donemix,(sum(glbdone_Hdtvmix(:,pr)))];
glbhdtv_notmix = [glbhdtv_notmix,(sum(glbnot_Hdtvmix(:,pr)))];
glbueb_totmix = [glbueb_totmix ,(sum(glbrej_UEbmix(:,pr)))+ (sum(glbdone_UEbmix(:,pr)))+(sum(glbnot_UEbmix(:,pr)))];% glb sum usr in nu
glbueb_donemix = [glbueb_donemix,(sum(glbdone_UEbmix(:,pr)))];
glbueb_notmix = [glbueb_notmix,(sum(glbnot_UEbmix(:,pr)))];
end
%=============================================================
%----------------- nu----------------------------
ullnu_satis = (glbull_donenu ./ glbull_totnu);
ullnu_delay = ((glbull_notnu)./glbull_totnu);
miotnu_satis = (glbmiot_donenu ./ glbmiot_totnu);
miotnu_delay = ((glbmiot_notnu)./glbmiot_totnu);
hdtvnu_satis = (glbhdtv_donenu ./ glbhdtv_totnu);
hdtvnu_delay = ((glbhdtv_notnu)./glbhdtv_totnu);
uebnu_satis = (glbueb_donenu ./ glbueb_totnu);
uebnu_delay = ((glbueb_notnu)./glbueb_totnu);
%----------------stc----------------------------------
ullstc_satis = (glbull_donestc ./ glbull_totstc);
ullstc_delay = ((glbull_notstc)./glbull_totstc);
miotstc_satis = (glbmiot_donestc ./ glbmiot_totstc);
miotstc_delay = ((glbmiot_notstc)./glbmiot_totstc);
hdtvstc_satis = (glbhdtv_donestc ./ glbhdtv_totstc);
hdtvstc_delay = ((glbhdtv_notstc)./glbhdtv_totstc);
uebstc_satis = (glbueb_donestc ./ glbueb_totstc);
uebstc_delay = ((glbueb_notstc)./glbueb_totstc);
%----------------mix----------------------------------
ullmix_satis = (glbull_donemix ./ glbull_totmix);
ullmix_delay = ((glbull_notmix)./glbull_totmix);
miotmix_satis = (glbmiot_donemix ./ glbmiot_totmix);
miotmix_delay = ((glbmiot_notmix)./glbmiot_totmix);
hdtvmix_satis = (glbhdtv_donemix ./ glbhdtv_totmix);
hdtvmix_delay = ((glbhdtv_notmix)./glbhdtv_totmix);
uebmix_satis = (glbueb_donemix ./ glbueb_totmix);
uebmix_delay = ((glbueb_notmix)./glbueb_totmix);
%----------------system satis in 3 algogo----------------------------------
syssatis_nu= (ullnu_satis + miotnu_satis + hdtvnu_satis + uebnu_satis)./4;
syssatis_stc = (ullstc_satis + miotstc_satis + hdtvstc_satis + uebstc_satis)./4;
syssatis_mix = (ullmix_satis + miotmix_satis + hdtvmix_satis + uebmix_satis)./4;
%----------------system delay in 3 algogo----------------------------------
sysdelay_nu= (ullnu_delay + miotnu_delay + hdtvnu_delay + uebnu_delay)./4;
sysdelay_stc = (ullstc_delay + miotstc_delay + hdtvstc_delay + uebstc_delay)./4;
sysdelay_mix = (ullmix_delay + miotmix_delay + hdtvmix_delay + uebmix_delay)./4;
%===========================================end============================
%----------------------combine light and heavy loaded------------------
if chk==1
% --------------------stc---------------
% --------------------stc---------------
uebstc_satis1 = [uebstc_satis1 ; uebstc_satis];
hdtvstc_satis1= [hdtvstc_satis1;hdtvstc_satis];
miotstc_satis1=[miotstc_satis1;miotstc_satis];
ullstc_satis1=[ullstc_satis1;ullstc_satis];
sys