資源簡介
比較了集中能量模型的能耗,包括能量多路徑算法,leach算法,LDEE-DGA算法的能量模型
代碼片段和文件信息
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%?Mainframe?of?Comparision?of?LDEE-DGA?LEACH?and?Multi-path?energy?aware
%?routing?algorithm.
%Author:?SunHongyu
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%PARAMETERS%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%?We?assume?that?the?three?algorithm?are?in?the?same?situatuons:
%?rx?and?ry?represents?the?distribution?region?of?sensor?nodes;
%?R?represents?the?Radius?of?each?sensor?node
%?Einit?represents?the?initial?energy?of?each?sensor?nodes?
%?Eelect?represents?the?energy?consumption?of?/bit/m;
%?EDA?represents?the?energy?consumotion?of?data?aggregation;
%?Etx?and?Erx?represent?the?energy?consumption?of?kbit?packets
%?Eamp?represents?the?energy?consumption?of?kbit*average?hops?of?routing
%?algorithm.
%?N?represents?the?number?of?the?nodes?in?the?whole?distributuon.
%?Ecal?represents?the?energy?consumption?of?calculation.
clear?all;
rx=100;
ry=100;
R=20;
Einit=0.5;
Eelect=0.00000001;
EDA=0.0000000000001;
k=1024;
A_hops=rx/R;
Etx=k*Eelect;
Erx=k*Eelect;
Eamp=k*A_hops*Eelect;
Ecal=Eelect/30;?%?3000Ecal=100Eelect
N=100;
Rate=0.1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%PARAMETERS%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Distributions%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%?This?part?discribe?the?simulation?of?the?distribution?of?the?three
%?algorithm
%?Figure(1)?represents?the?network?model?of?Multi-path?energy?aware?routing
%?algorithm.Thusthe?plant?network?model?with?only?one?model
%?Figure(2)?reprensents?the?network?model?of?leach?algorithm?Thusthe
%?hierarchy?network?model.
%?LDEE-DGA?this?paper?proposed?focus?on?the?plant?network?model?thus?the
%?LDEE-DGA?is?under?the?sutuations?as?shown?in?figure?1
%%%%%%%%%%%%%%%%%%%%%%%%%%Distribution%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure(1);
Sink.x=0.5*rx;
Sink.y=0.5*ry;
plot(Sink.xSink.y‘r*‘);
hold?on;
for?i=1:1:N
????Sensor(i).x=rand(11)*rx;
????Sensor(i).y=rand(11)*ry;
????plot(Sensor(i).xSensor(i).y‘bo‘);
????hold?on;
end
figure(2);
Sink.x=0.5*rx;
Sink.y=0.5*ry;
plot(Sink.xSink.y‘r*‘);
hold?on;
for?i=1:1:N
????Sensor(i).x=rand(11)*rx;
????Sensor(i).y=rand(11)*ry;
????Sensor(i).E=Einit;
end?
for?i=1:1:N*Rate;
????plot(Sensor(i).xSensor(i).y‘b*‘);
????hold?on;
end
for?i=N*Rate+1:1:N
????plot(Sensor(i).xSensor(i).y‘bo‘);
????hold?on;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%EnergyComparision%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%?This?part‘s?function?is?to?prove?the?energy?consumption?of?LDEE-DGA-a?is
%?lower?than?Multi-path?energy?a
- 上一篇:圖像處理 人臉識別皮膚提取 經典matlab源碼
- 下一篇:MATLAB AGC
評論
共有 條評論