Skip to main content
. 2021 Sep 28;21(19):6489. doi: 10.3390/s21196489
Algorithm 2. Low-power Failure Detector.
Input: d1, SM1
Output: suspectlist[]
1.  Node q: /*monitoring node*/
2.  Task 1:
3.    if psuspectlist[] and did not receive heartbeat within freshpoint τ
4.      then add p to suspectlist[];
5.    end if
6.  Task 2:
7.    upon receiving heartbeat message mj from p;
8.      if j>snl
9.        if psuspectlist[]
10.         then remove p from suspectlist[];
11.           ε=ε+1;
12.         else
13.           ε=1;
14.         end if
15.         dj=(TnowTpre)/Nl;
16.         EAj+1=IDjηj+dj;
17.         d^j+1=kd^j+(1k)dj;
18.         SMj+1=ε|d^j+1dj|;
19.         τj+1=EAj+1+SMj+1;
20.     end if
21. Node p: /*detected node*/
22.  for all i>1 do
23.    at time ηi: (the i-th detection period);
24.    send heartbeat message mi to node q;
25.    ηi+1Algorithm 1;
26.  end for