View full-text article in PMC Sensors (Basel). 2020 Jul 23;20(15):4095. doi: 10.3390/s20154095 Search in PMC Search in PubMed View in NLM Catalog Add to search Copyright and License information © 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/). PMC Copyright notice Algorithm 2: EERS pseudo-code for reference scheduling selection (except sink node). Initial:cnt ←0,SeqN ←0 1. ◼ Upon receiving Scheduling Message 2. if (Received SeqN>SeqN) Then 3. SeqN ←Received SeqN 4. for (cnt ←0 to length(RefNodes))do 5. if (NodeID==RefNodes(cnt)) Then 6. mySchsSlot← SchSlots(cnt); 7. end if 8. if (RefNodes(cnt)==SenderID) Then 9. SchSlotSrcID← SchSlots(cnt) 10. end if 11. end for 12. WaitingTime ←( mySchSlot−SchSlotSrcID) 13. Setup waiting timer WT(WaitingTime) 14. end if 15. ◼ Upon WT expires 16. forward refernces scheduling message <RefNodes,SchSlots, SeqN. >