Research Article
Fault Detection Modelling and Analysis in a Wireless Sensor Network
Algorithm 1
: The pseudocode of low-energy-consumption distributed fault detection algorithm.
(1) Begin | (2) for each node in WSN | /* The following method is adopted to establish Q*/ | (3) for each k times before time t (including time t) | (4) if | (5) | (6) else | (7) | (8) end if | (9) end for | /* Generate test */ | (10) if | (11) | (12) else | (13) | (14) end if | /*Correct */ | (15) if and | (16) , // | (17) else if and | (18) , // | (19) end if | /* Generate a state value based on the value of */ | (20) if | (21) | (22) else | (23) | (24) end if | /* For the nodes with status value , test each member of their neighbors to generate test by adopting the following way*/ | (25) if | (26) | (27) else | (28) | (29) end if | /* Make the final decision of the nodes’ state */ | (29) if | (30) | (31) else | (32) | (33) end if | (34) end for | Process end |
|