clear
%%%%%%%%%%%%%%%%%%%%%%%%%%%system parameters%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
dSimulationTime = 20; % TTI
dKmCiteToCiteDistance = 0.5; % Km 站间距
nNumOfRuns = 100;
dKmMinDistance = 0.035;%Km
nNumofCell = 19;
nNumofSector = nNumofCell*3; %one cell only
nNumofUserPerSector = 10; %每个小区的用户数
dwBsTransmitPower = 20; % w发射功率
ddBBsNoisefigure = 5; % dB
ddBMsNoisefigure = 9; % dB
dBmThermalNoise = -174;
dKHzSubcarrierBandWidth = 15;
dMHzCarrierFrequency = 2000;
dUserVelocity = 3; % Km/h
dMIMOScheme = 0; % 0:V_BLAST 1:STBC 2:BF
ddBShadowFadingStd = 8;
ddBTransmitAntennaGain = 15;
ddBReceiveAntennaGain = -1;
dShadowFadowCorrelation = 0.5;
ddBOtherLoss = 20;
ddBSNRTarget = 20;
dwPerSubcarrierWhiteNodise = 10^((dBmThermalNoise-30)/10)*dKHzSubcarrierBandWidth*1000;
nNumofTrafficClass = 5;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%OFDM parameters %%%%%%%%%%%%%%%%%%%%%%%%%%
nNumofSubcarrier = 600; %子载波数量
nNumofSubchannel = 24; %子信道数
nFFTSize = 1024;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MIMO parameters %%%%%%%%%%%%%%%%%%%%%%%%%
nTxAntenna = 1;%发射天线数量
nRxAntenna = 1;%接收天线数量
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Transmit parameters %%%%%%%%%%%%%%%%%%%%%%%%%
nPowerControlFlag = 2; % 1:LargeScalePowerControl 2:equal power allocation 0: adaptive power allocation
LargeScalePowerControl = 1;
EqualPowerAllocation = 2;
nSchedulerFlag = 1; % 1:RR 2:TPF 3:MPF 4:other
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Traffic parameters %%%%%%%%%%%%%%%%%%%%%%%%%
MaxBSBufferSizeInPacket = 200; %Max number of packets in BS per UE
%%%%%%%%%%%%%%%%%%%%%%%%%%%% OVER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% %%%%% %%%%% %%%%
%%%%%%%%%%%%%%%%% variables definition begin%%%%%%%%%%%%%%%%%%%%%%%%
dUEPosition=zeros(nNumofSector,nNumofUserPerSector);%用户位置(扇区号,扇区内的用户数量)
nUEPathLoss = zeros(nNumofSector,nNumofSector*nNumofUserPerSector); %用户路损(扇区号,扇区号*扇内的用户数量)
nUEShadowFading = zeros(nNumofSector,nNumofSector*nNumofUserPerSector);
nUEAntennaGain = zeros(nNumofSector,nNumofSector*nNumofUserPerSector);
nUETotalPathLoss=zeros(nNumofSector,nNumofSector*nNumofUserPerSector);
dwUEPowerAllocated=zeros(1,nNumofSector*nNumofUserPerSector);
dwSubcarrierPowerAllcation=zeros(nNumofSector,nNumofSubcarrier);
nBSScheduler=struct( 'dwChannelPowerAllcation',repmat({zeros(1,nNumofSubchannel)},nNumofSector,1),...
'dChannelAllocation',repmat({zeros(1,nNumofSubchannel)},nNumofSector,1)...
);
nUEScheduler=struct( 'dCostfunction',repmat({zeros(1,nNumofSubchannel)},nNumofSector,nNumofUserPerSector),...
'dInstantThroughput',repmat({0},nNumofSector,nNumofUserPerSector),...
'dAverageThroughput',repmat({1},nNumofSector,nNumofUserPerSector),...
'dTotalThroughput',repmat({0},nNumofSector,nNumofUserPerSector),...
'dTotalThroughputInbps',repmat({0},nNumofSector,nNumofUserPerSector),...
'dDelta',repmat({0},nNumofSector,nNumofUserPerSector),...
'dHOL',repmat({0},nNumofSector,nNumofUserPerSector),...
'dT',repmat({0},nNumofSector,nNumofUserPerSector),...
'dTotalPacketDelay',repmat({0},nNumofSector,nNumofUserPerSector)...
);
nTrafficBufferAtBS=struct( 'CurrentBufferSizeInBit',repmat({0},nNumofSector,nNumofUserPerSector),...
'PacketBufferBeginIndex',repmat({0},nNumofSector,nNumofUserPerSector),...
'PacketBufferEndIndex',repmat({0},nNumofSector,nNumofUserPerSector),...
'CurrentTotalDelay',repmat({0},nNumofSector,nNumofUserPerSector),...
'CurrentPacketIndex',repmat({0},nNumofSector,nNumofUserPerSector),...
'DropedPacketNum', repmat({0},nNumofSector,nNumofUserPerSector),...
'TransferedPacketNum',repmat({0},nNumofSector,nNumofUserPerSector),...
'PacketSize',repmat({zeros(1,MaxBSBufferSizeInPacket)},nNumofSector,nNumofUserPerSector),...
'PacketIndex',repmat({zeros(1,MaxBSBufferSizeInPacket)},nNumofSector,nNumofUserPerSector),...
'PacketType',repmat({zeros(1,MaxBSBufferSizeInPacket)},nNumofSector,nNumofUserPerSector),...
'PacketArrivalTime',repmat({zeros(1,MaxBSBufferSizeInPacket)},nNumofSector,nNumofUserPerSector),...
'PacketLeaveTime',repmat({zeros(1,MaxBSBufferSizeInPacket)},nNumofSector,nNumofUserPerSector),...
'PacketDelay',repmat({zeros(1,MaxBSBufferSizeInPacket)},nNumofSector,nNumofUserPerSector)...
);
nTrafficQoSParameter=struct( 'Delta',repmat({0.01},1,nNumofTrafficClass),...
'MaxLatencyTime',repmat({3000},1,nNumofTrafficClass),...
'PLR',repmat({0},1,nNumofTrafficClass),...
'MinThroughput',repmat({0},1,nNumofTrafficClass)...
);
nVideoTraffic=struct( 'NxtFrmArvlSlot',repmat({0},nNumofSector,nNumofUserPerSector),...
'CurrentFrameIndex',repmat({0},nNumofSector,nNumofUserPerSector),...
'FrameBeginIndex',repmat({0},nNumofSector,nNumofUserPerSector),...
'FrameEndIndex',repmat({0},nNumofSector,nNumofUserPerSector),...
'NxtPcktArvlSlot',repmat({0},nNumofSector,nNumofUserPerSector),...
'CurrentPacketIndexInFrame',repmat({0},nNumofSector,nNumofUserPerSector),...
'DropedFrameNum',repmat({0},nNumofSector,nNumofUserPerSector),...
'TransferedFrameNum',repmat({0},nNumofSector,nNumofUserPerSector),...
'dueTimeSlot',repmat({zeros(1,50)},nNumofSector,nNumofUserPerSector),...
'FrameIndex',repmat({zeros(1,50)},nNumofSector,nNumofUserPerSector),...
'EndPacketIndexOfFrame',repmat({zeros(1,50)},nNumofSector,nNumofUserPerSector)...
);
nVoIPTraffic=struct( 'ATOffset',repmat({0},nNumofSector,nNumofUserPerSector),...
'NxtPcktArvlSlot',repmat({0},nNumofSector,nNumofUserPerSector),...
'SrcFileLineIndex',repmat({0},nNumofSector,nNumofUserPerSector)...
);
nARQTransmitProcess=struct( 'PacketIndex',repmat({-1},nNumofSector,nNumofUserPerSector),...
'PacketSize',repmat({-1},nNumofSector,nNumofUserPerSector),...
'PacketArrivalTime',repmat({-1},nNumofSector,nNumofUserPerSector),...
'PacketLeaveTime',repmat({-1},nNumofSector,nNumofUserPerSector),...
'PacketDelay',repmat({-1},nNumofSector,nNumofUserPerSector),...
'TransmitFlag',repmat({-1},nNumofSector,nNumofUserPerSector)...
);
nStatistics=struct( 'AvrgPktDelay',repmat({0},nNumofSector,nNumofUserPerSector),...
'TotalPktDelay',repmat({0},nNumofSector,nNumofUserPerSector),...
'PacketLossRate',repmat({0},nNumofSector,nNumofUserPerSector),...
'AvrgThroughput',repmat({0},nNumofSector,nNumofUserPerSector)...
);
nUECQIReport=ones(nNumofSector,nNumofUserPerSector,nNumofSubchannel);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%读取语音数据文件%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SCFid=fopen('SrcConfigFile_VTMix6AT','r');
% SrcCnfgrFile=fscanf(SCFid,'%d',[5,171])';
% fclose(SCFid);
aSFid=fopen('audio Source File.bin','r');
%NumLines=fscanf(aSFid,'%d',1);
%NumSlots=fscanf(aSFid,'%d',1);
% status=fseek(aSFid,16,'bof');
% nVoIPSourceFile=fscanf(aSFid,'%d',[3,58019])';
% fclose(aSFid);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%业务QoS参数%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%% VoIP %%%%%%%%%%%%%%%%%%%
nTrafficQoSParameter(1).Delta=0.03;
nTrafficQoSParameter(1).MaxLatencyTime=20;
%%%%%%%%%%%%%%%%%%%% rtVideo %%%%%%%%%%%%%%%%%%%
nTrafficQoSParameter(2).Delta=0.01;
nTrafficQoSParameter(2).MaxLatencyTime=5;
%%%%%%%%%%%%%%%%%%%% nrtVideo %%%%%%%%%%%%%%%%%%%
nTrafficQoSParameter(3).Delta=0.01;
nTrafficQoSParameter(3).MaxLatencyTime=2000;
nTrafficQoSParameter(3).MinThroughput=9600;
%%%%%%%%%%%%%%%%%%%%Full Buffer%%%%%%%%%%%%%%%%%%%
nTrafficQoSParameter(4).MinThroughput=9600;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%% variables definition end%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% %%%%% %%%%% %%%%
seed = 1:400;
close all
Cell_Wrap_Num= [ [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18];[1,8,9,2,0,6,7,13,12,16,15,10,11,3,4,5,17,18,14];
[2,9,10,11,3,0,1,8,16,15,14,18,17,12,13,4,5,6,7];[3,2,11,12,13,4,0,1,9,10,18,17,16,8,7,14,15,5,6];
[4,0,3,13,14,15,5,6,1,2,11,12,8,7,18,10,9,16,17];[5,6,0,4,15,16,17,18,7,1,2,3,13,14,10,9,8,12,11];
[6,7,1,0,5,17,18,14,13,8,9,2,3,4,15,16,12,11,10];[7,13,8,1,6,18,14,4,3,12,16,9,2,0,5,17,11,10,15];
[8,12,16,9,1,7,13,3,11,17,5,15,10,2,0,6,18,14,4];[9,16,15,10,2,1,8,12,17,5,4,14,18,11,3,0,6,7,13];
[10,15,14,18,11,2,9,16,5,4,13,7,6,17,12,3,0,1,8];[11,10,18,17,12,3,2,9,15,14,7,6,5,16,8,13,4,0,1];
[12,11,17,16,8,13,3,2,10,18,6,5,15,9,1,7,14,4,0];[13,3,12,8,7,14,4,0,2,11,17,16,9,1,6,18,10,15,5];
[14,4,13,7,18,10,15,5,0,3,12,8,1,6,17,11,2,9,16];[15,5,4,14,10,9,16,17,6,0,3,13,7,18,11,2,1,8,12];
[16,17,5,15,9,8,12,11,18,6,0,4,14,10,2,1,7,13,3];[17,18,6,5,16,12,11,10,14,7,1,0,4,15,9,8,13,3,2];
[18,14,7,6,17,11,10,15,4,13,8,1,0,5,16,12,3,2,9]
];
throughputofue_Before=struct( 'throughputofue_before',repmat({0},nNumOfRuns,dSimulationTime));
throughputofue_After=struct( 'throughputofue_after',repmat({0},nNumOfRuns,dSimulationTime));
for nRun=1:nNumOfRuns
rand('seed',seed(nRun));
randn('seed',seed(nRun));
%%%%%%%%% initialization %%%%%%%%%%
%%***********************%%
%in this function, all UE's position and cell position is determined,
%%***********************%%
[Sector_Wrap_Num,dUEPosition,dBSPosition,ServingSector,nUEPathLoss,nUEShadowFading,nUEAntennaGain,nUETotalPathLoss]=...
intialize(dKmCiteToCiteDistance,nNumofCell,nNumofSector,nNumofUserPerSector,ddBShadowFadingStd,ddBTransmitAntennaGain,ddBReceiveAntennaGain);
for i=1:nNumofSector*nNumofUserPerSector
signal=0;
interf=0;
for k=1:nNumofSector
if k==ServingSector(i)
signal=dwBsTransmitPower*nUETotalPathLoss(k,i);
else interf=interf+dwBsTransmitPower*nUETotalPathLoss(k,i);
end
end
SINR_original(i)= signal/(interf+10^((dBmThermalNoise-30)/10)*dMHzCarrierFrequency*1000000);
end
SINR_original_db=10*log10(SINR_original);
% figure
% cdfplot(SINR_original_db)%最初没有选择用户时的cdf曲线
%********************仿真每个时间点的业务和关闭情况,应该把上面的用户数量分配移动到这块,否则,就得设置用户速率变化,这样会导致后面计算吞吐量的变化,因此,最简单的情况还是
%用户的数量随时间变化,速率需求不变。**************
for t_index = 1:dSimulationTime
% for t_index = 8
t_index
%%*****************抽取用户,设2,3,5号小区是hotspot,每个小区30个用户,其他小区每个扇区随机,总的用户数为250,设计一个new用户与原来用户的对比表*************************%%
%前90号新用户是原来的2、3、5号小区的用户,这是某一时刻的,若随时间变化的话,直接改UETOTALNUM就可以了。
UETOTALNUM=90+(t_index+2)*16;%定义用户的总数
%UETOTALNUM=250;%定义用户的总数
newue=[];
% newue(1:90)=[31:90,121:150];
% newue(1:90)=[1:90];%集中分布
newue(1:90)=[31:60,91:120,151:180];%均匀分布热点区域
for i=91:UETOTALNUM
ueid=randi([1,570]);
isety=isempty(find(newue==ueid));
while isety~=1%找到了重复的
ueid=randi([1,570]);
isety=isempty(find(newue==ueid));
end
newue(i)=ueid;
end
%检查一下生成的new矩阵里是否有重复的数
anewue=unique(newue);
isrepeat=length(anewue)==length(newue);
if isrepeat~=1
break;
end
%******************定义用户的结构体,包括每个用户的位置、服务扇区************%
%dUEPosition是一个57*10的矩阵,要先将其转换成一个1行570列的矩阵
for i=1:nNumofSector*nNumofUserPerSector
dUEPosition1(i)=dUEPosition(i)+dBSPosition(ServingSector(i));
end
dUEPosition2=reshape(dUEPosition1.',1,nNumofSector*nNumofUserPerSector);
for i=1:UETOTALNUM
UEInfoposition(i)=dUEPosition2(newue(i));
UEInfoservingbs(i)=ServingSector(newue(i));
end
%定义新的用户到扇区的Pathloss
for i=1:UETOTALNUM
newPathloss(:,i)=nUETotalPathLoss(:,newue(i));
end
%*********计算每个用户到各自扇区的SINR**************%
for i=1:UETOTALNUM
for k=1:nNumofSector
sinr(k,i)=dwBsTransmitPower*newPathloss(k,i)/(dwBsTransmitPower*(sum(newPathloss(:,i))-newPathloss(k,i))+ 10^((dBmThermalNoise-30)/10)*dMHzCarrierFrequency*1000000);
%sinrdb1(k,i)=10*log10(dwBsTransmitPower)+
end
end
%换算成db值
sinrdb=10*log10(sinr);
%*************************************计算关闭扇区之前的各项指标,包括每个扇区的用户数量、每个用户接收的SINR、每个用户的吞吐量及中断率*************%
[uenumofbs,ueNoofbs]=ueperbs( UEInfoservingbs,UETOTALNUM,nNumofSector); %计算每个扇区的连接的用户个数
dCellRadius = dKmCiteToCiteDistance/sqrt(3);%小区半径
%PositionPlot(UETOTALNUM,UEInfoposition,dBSPosition,dCellRadius,nNumofCell,UEInfoservingbs,nNumofSector,uenumofbs);
bwofue=bwperue(UEInfoservingbs,UETOTALNUM,nNumofSector,dMHzCarrierFrequency,uenumofbs); %计算每个用户的带宽
for i=1:UETOTALNUM
SINR1(i)=sinr(UEInfoservingbs(i),i);%用户对服务扇区的sinr
end
SINR1_db=10*log10(SINR1);
% figure
% cdfplot(SINR1_db)%按照位置选择用户的cdf曲线
blockr=blockrate( SINR1_db,UETOTALNUM);
Power_consumption_A=powervarytraffic(uenumofbs,nNumofSector);
bs_state=BS_state(uenumofbs,nNumofSector);
empty_cell_num=nNumofSector-sum(bs_state);
ThrPutPerUE=struct( 'throughputofue',repmat({0},1,UETOTALNUM));
throughputofue=throughputperue(bwofue,SINR1,UETOTALNUM);%计算每个用户的吞吐量
throughputblock=throughputblockrate( throughputofue,UETOTALNUM);
sumthroughput=sum(throughputofue);%求和计算总的吞吐量
uerate=ones(1,UETOTALNUM);%用户速率,这个条件以后再说
loadofbs=zeros(1,nNumofSector);
for i=1:nNumofSector
for k=1: uenumofbs(i)
loadofbs(i)= loadofbs(i)+uerate(ueNoofbs(i,k));%计算每个小区的负载量
end
end
%方案三:对于每个用户,只能选择以它所在的小区(不是扇区)为中心的6个小区等7个连接点,根据sinr和负载量来决定
%计算每个用户所在的小区号
for i=1:UETOTALNUM
servingcell(i)=ceil(UEInfoservingbs(i)/3);
end
%计算每个用户可以选择的小区序列
Cell_Wrap_Num1=Cell_Wrap_Num+1;%将扇区号转化到1-19
for i=1:UETOTALNUM
selectcellmatrix(i,:)=Cell_Wrap_Num1(servingcell(i),1:7);
end
%计算每个用户可以选择的扇区序列
for i=1:UETOTALNUM
selectsectormatrix(i,:)=Sector_Wrap_Num(servingcell(i),1:21);
end
%W2=W;%用来做分析的,首先保护W,这是用户连接扇区的权重矩阵
%sinr和load归一化
maxi_sinr=repmat(max(sinr),nNumofSector,1);
Nor_sinr=sinr./maxi_sinr;
maxload=max(loadofbs);
for i=1:nNumofSector
Nor_load(i)=loadofbs(i)/maxload;
end
%画出α和β的不同比值下用户的中断率和系统能耗的关系,这里设置20次
%for testnum=1:21
%计算每个用户到基站的权值
aerfa3=0.35; beita3=1-aerfa3;
%aerfa3=(testnum-1)*0.05; beita3=1-aerfa3;
W2=[];
for i=1:nNumofSector
% for k=1:UETOTALNUM
W2(i,:)=aerfa3* Nor_sinr(i,:)+beita3*Nor_load(i);
% end
end
%选出了用户连接的最好的扇区
for i=1:UETOTALNUM
maxw2(i)=max(W2(selectsectormatrix(i,1:21),i));
[r4,c4]=find(W2(selectsectormatrix(i,1:21),i)==maxw2(i));
r4=r4(1);
d4=selectsectormatrix(i,r4);
servingbs4(i)= d4;
end
%*******************************统计各项性能:激活小区的个数、中断率、功耗***********************%
[uenumofbs4,ueNoofbs4]=ueperbs(servingbs4,UETOTALNUM,nNumofSector); %计算每个扇区的连接的用户个数
%扇区基站状态
bs_state4=BS_state(uenumofbs4,nNumofSector);
numofactivebs4=sum(bs_state4);%激活小区的个数,相当于固定功耗
empty_cell_num4=nNumofSector-sum(bs_state4);
Power_consumption_A4=powervarytraffic(uenumofbs4,nNumofSector);
%PositionPlot(UETOTALNUM,UEInfoposition,dBSPosition,dCellRadius,nNumofCell,servingbs4,nNumofSector,uenumofbs4);
%计算当前用户到其服务基站的SINR 1*250
SINR4=sinr_compute(dwBsTransmitPower,dBmThermalNoise,dMHzCarrierFrequency,newPathloss,UETOTALNUM,nNumofSector,bs_state4,servingbs4);
SINR4_db=10*log10(SINR4);
%计算吞吐量
bwofue4=bwperue(servingbs4,UETOTALNUM,nNumofSector,dMHzCarrierFrequency,uenumofbs4); %计算每个用户的带宽
blockr4=blockrate( SINR4_db,UETOTALNUM);
throughputofue4=throughputperue(bwofue4,SINR4,UETOTALNUM);%计算每个用户的吞吐量
throughputblock4=throughputblockrate( throughputofue4,UETOTALNUM);%计算由于每个用户的吞吐量而引起的中断
sumthroughput4=sum(throughputofue4);%求和计算总的吞吐量
% %统计权值因子信息
% x_lable(nRun,testnum)=aerfa3;
% powerconsumption(nRun,testnum)=numofactivebs4;
% powerconsumption_A(nRun,testnum)=Power_consumption_A4;
% %blocksinr(testnum)=blockr4;
% blockthroughput(nRun,testnum)=throughputblock4;
%统计信息,每个时间段随着业务的增加统计吞吐量、中断率、能耗等因素
%小区内的总用户数
traffic_num(nRun,t_index)=UETOTALNUM;
%空小区数量前后对比
empty_cell_before(nRun,t_index)=empty_cell_num;
empty_cell_after(nRun,t_index)=empty_cell_num4;
%固定功耗对比
power_con_fix_before(nRun,t_index)=(57-empty_cell_num)*20;
power_con_fix_after(nRun,t_index)=(57-empty_cell_num4)*20;
%可变功耗对比
power_con_vary_before(nRun,t_index)=Power_consumption_A;
power_con_vary_after(nRun,t_index)=Power_consumption_A4;
%中断率对比
block_before(nRun,t_index)=throughputblock;
block_after(nRun,t_index)=throughputblock4;
%固定能效对比
fix_ee_before(nRun,t_index)=sumthroughput*1000/power_con_fix_before(nRun,t_index);
fix_ee_after(nRun,t_index)=sumthroughput4*1000/power_con_fix_after(nRun,t_index);
%可变能效对比
vary_ee_before(nRun,t_index)=sumthroughput*1000/power_con_vary_before(nRun,t_index);
vary_ee_after(nRun,t_index)=sumthroughput4*1000/power_con_vary_after(nRun,t_index);
% %用户吞吐量对比
% throughputofue_before(nRun,t_index)=throughputofue;
% throughputofue_after(nRun,t_index)=throughputofue4;
%总吞吐量对比
sumthroughput_before(nRun,t_index)=sumthroughput;
sumthroughput_after(nRun,t_index)=sumthroughput4;
end
end
%%%%%%%%%%%%%%%%%%统计在特定UserTotalNum情况下的各种变量情况%%%%%%%%%%%%%%%%%%%%%%
x=mean(traffic_num);%用户总数的变化
x1=1:24;
y1=-(max(x)-min(x))/2*cos(pi*x1/12)+(max(x)+min(x))/2;
% plot(x1,y1,'r-*');%画出业务随时间的变化
y2=mean(power_con_fix_before);
y3=mean(power_con_fix_after);
% figure
% plot(x,y2,'r-*',x,y3,'b-*');%画出ON-OFF模型评估下的能耗曲线
y6=mean(power_con_vary_before);
y7=mean(power_con_vary_after);
% figure
% plot(x,y2,'r-*',x,y3,'b-*',x,y6,'r-o',x,y7,'b-o');%画出ON-OFF模型即LINEAR模型评估下的能耗曲线
y8=mean(block_before);
y9=mean(block_after);
% figure
% plot(x,y8,'r-*',x,y9,'b-*');%中断率
%
y10=mean(fix_ee_before);
y11=mean(fix_ee_after);
% plot(x,y10,'r-*',x,y11,'b-*');
y13=mean(vary_ee_before);
y14=mean(vary_ee_after);
% figure
% plot(x,y10,'r-*',x,y11,'b-*',x,y13,'r-o',x,y14,'b-o');%能效曲线
y15=mean(sumthroughput_before);
y16=mean(sumthroughput_after);
figure
plot(x,y15,'r-*',x,y16,'b-*');%总吞吐量曲线
% y17=mean(throughputofue_before);
% y18=mean(throughputofue_after);
figure
% plot(x,y17,'r-*',x,y18,'b-*');%用户吞吐量吞吐量曲线
% cdfplot(y17)
% cdfplot(y18)
% %测试权值因子的影响
% x=1:101;
% x1=mean(x_lable);