Research Article
Self-Learning-Based Data Aggregation Scheduling Policy in Wireless Sensor Networks
Algorithm 1
Node behaviour on time slot scheduling.
Data: | NR, SRc, , , SRh | 1 whilea new frame starts to executedo | 2 for i = 1; i ≤ NR; i + + do | 3 for k = 1; ; k + + do | 4 .disable (SRc(k)); | 5 end | 6 tR = Δε – greedy ; | 7 SRc .add(tR); | 8 end | 9 SRh.add(SRc); | 10 STc = Δε - greedy; | 11 if SRh.comparison() is not stablethen | 12 Set the state of all slots as ACTIVE; | 13 else | 14 Set tk as ACTIVE where , and set other slot as SLEEP | 15 end | 16 for j = 1; j ≤ F; j + + do | 17 ifthe state of tj is ACTIVEthen | 18 if STc == tj then | 19 send packet and wait for ACK; | 20 ifACK is receivedthen | 21 Update (tj) with rewards; | 22 else | 23 Update (tj) with punishment; | 24 end | 25 else ifreceive from ith upstream nodethen | 26 Update (tj) with rewards; | 27 end | 28 else if SRc (i) == tj and not receive any packet from ith upstream nodethen | 29 Update (tj) with punishment; | 30 Set tj+1 to tj+p as ACTIVE; | 31 end | 32 end | 31 end | 32 end |
|