How can I make CPU
sleep?
You do not have to write code for it (see Lesson 16). It is because TinyOS put CPU in low power state when there is no computation. Hence you can leave CPU power management on TinyOS.
How can I make
transceiver sleep?
The same way you have started it, you could stop it when a node is not required to be a coordinator. (See Lesson-3 and Lesson-16)
How to get Em(x) (maximum Energy of node x)?
You can fix it to some constant value, let say 1000.
How to get Er(x) (remaining Energy of node x)?
Initially set it equal to Em(x). Later, make it dependent on how long a node works. For example, you could record time a node spends as a coordinator and for each one second (not milliseconds) decrement Er(x) by one unit.
Can we suppose that
links are symmetric?
Yes for this exercise please consider that links are symmetric. That means if A can hear B then B can hear A.
We do not understand
eligibility rule properly. Where we should look?
May be looking at HICA paper could help you understand it better. Otherwise, please come and discuss with me.
How to get node id?
You can get it using macro NOS_NODE_ID. For example:
nodeid = NOS_NODE_ID;
Explain how Pe
changes its values?
Initially set it equals to zero (Pe = 0)
When 60% < Er(x)/Em(x) < 80% then Pe = [(0+1) * 100]+0.5 -------- (A)
When 40% < Er(x)/Em(x) < 60% then Pe = [(A+1) * 100]+0.5 -------- (B)
When 20% < Er(x)/Em(x) < 40% then Pe = [(B+1) * 100]+0.5 -------- (C)
When 0% < Er(x)/Em(x) < 20% then Pe = [(C+1) * 100]+0.5
If the implementation
should scale to hundreds of nodes? How we should test it?
Yes it should work with 100s of nodes and you can use TOSSIM to test it.
Send me an email and I will update the document with your
question.