12.01.2015 Views

Download - Academy Publisher

Download - Academy Publisher

Download - Academy Publisher

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

nodes will be formed one cluster, their messages will be<br />

stored in NT[] of the fixed nodes.<br />

The referred fixed nodes will choose greater energy<br />

than the average energy, and the nearest node to the<br />

cluster-head from the NT[].<br />

Compute k value, and call the optimal schedule<br />

algorithm inter-scheduling(), select k working nodes.<br />

The third step: data gathering, duration TD<br />

while carry out data collection, call TDMAscheduling()<br />

algorithm to inner-cluster nodes with TDMA, allocate the<br />

initial work time with parallel division approach to k<br />

inner-cluster working nodes;<br />

the members of inner-cluster can receive Hello_Msg<br />

within own slot from the cluster-head, then transmit the<br />

sensing data to cluster-head. The cluster-head will<br />

aggregate these data and forward them to fixed nodes.<br />

B. EDG algorithm pseudo-code description<br />

EDG()<br />

{while( the time (Tc) is not expired) /* Tc stage<br />

clustering begin */<br />

{ if ( Nd.state = ’Y’) /*only for the fixed nodes*/<br />

{ Broadcast(Fixednode_Msg); /*transmit the<br />

message containing its own ID and time stamp */<br />

}<br />

if (Nd.state ≠’Y’) /*only for mobile node*/<br />

{ Receive(Fixednode_Msg); /*receive up to 4<br />

Fixednode_Msg message */<br />

Δtij=|ti1-t0|; /* compute the distance from different<br />

fixed nodes, approximately replace with delay time*/<br />

Mrp_ID=Choose min( Δ tij); /* select the nearest<br />

fixed node as the referred fixed node*/<br />

}<br />

}/* Tc stage end*/<br />

while(the time (TH) is not expired) /* selecting<br />

cluster-head TH stage begin*/<br />

{ if(Nd.state ≠ ’Y’) Broadcast(Mobilenode_Msg) to<br />

Mrp_ID;<br />

/*all mobile nodes broadcast messages to round fixed<br />

nodes, including its own ID, Mrp_ID, remaining energy<br />

Er, Δti */<br />

if(Nd.state=’Y’) /*the referred fixed node selects<br />

cluster-head*/<br />

{ Receive(Mobilenode_Msg); /* continuous receive<br />

the messages from round mobile nodes, which satisfy the<br />

condition (Nd.ID be equal to Mrp_ID of message ). And<br />

these messages are stored in its own NT[].*/<br />

k=INT(lg(1-ϕ )/lg((rc*rc+2*rc*rs)/(rc+rs)(rc+rs))+0.5);<br />

The array NT[] order from small to large by dt<br />

properties, the previous k records will be stored in NT[].<br />

Compute the average remaining energy Ea in NT[]. In<br />

the conditions of Er≥ Ea, select the nearest mobile node<br />

from itself as the cluster-head, to KeyFixed_Msg.Cid.<br />

KeyFixed_Msg.MidLIst[1..k]=NT[1..k]; /*store the<br />

previous k nodes in NT[] to ID list of mobile member<br />

nodes in KeyFixed_Msg message.*/<br />

Broadcast(KeyFixed_Msg); /*broadcast the messages<br />

to inner-cluster members, including its own ID and the ID<br />

list of inner-cluster mobile member nodes*/<br />

}<br />

if (Nd.state≠’Y’) /*only for mobile nodes*/<br />

{ Receive(KeyFixed_Msg);<br />

if (Nd.ID∈KeyFixed_Msg.MidList[1..k])<br />

{ if(Nd.ID= KeyFixed_Msg.Cid) /*if it’s cluster-head */<br />

{ Nd.state=’B’; /*store the KeyFixed_Msg<br />

message into NT[] of the cluster-head */<br />

}<br />

else Nd.state=’G’; /*the k selected inner-cluster nodes*/<br />

}else sleep; /*nodes not be selected in cluster */<br />

}<br />

}/* selecting cluster-head TH stage end*/<br />

while( the time (TD) is not expired)<br />

/*collecting data TD stage begin*/<br />

{ for(i=1;i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!