Skip to main content
. 2020 Jan 14;20(2):461. doi: 10.3390/s20020461
Algorithm 1 Calculating the AMoF, fitted slope, confidence intervals, and detection threshold
1: Input: CCI(DSm)1,………,CCI(DSm)N, ∀ m ∈n
2: Output: AMoF, fitted slope (β), detection threshold (δ)
3: At the super node
4: ∀ node∈NUT where the number of elements in NUT = l
5: Receive CCI(Sn)1,………, CCI(Sn)N S.T CCI(NUT)is N×n
6: Initialize Temp(Sj), Norm_Temp(Sj)i, AMoF(Sj)i
7: For i = 1 to N do
8: For j = 1 to n do
9: TEMPi(Sj)←|CCIi+1(Sj)−CCIi(Sj)|+TEMPi−1(Sj)
101: Norm_TEMPi(Sj)← TEMPi(Sj)/100
11: End for
12: AMoFi(Sj)← Norm_TEMPi(Sj)/n+ AMoFi(Sj)
13: End for
14: Receive AMoF(NUT)1,..,AMoF(NUT)N−1 S.T AMoF(NUT) is  l×(N−1)
15: For k = 1 to N−1 do
16: For j = 1 to l do
17: If k ≥ 2 then
18: Find βk by solving (1)
19: Find Ck by solving (2)
20: Find time varying threshold δk = (max(Ck)−min(Ck)2)+min(Ck)
21: @k=3
22: δ←δk
23: If δk>δ
24: Node is normal
25: Else
26: Node is malicious
27: End for
28: End for