Skip to main content
. 2014 Nov 10;14(11):21174–21194. doi: 10.3390/s141121174

Algorithm 5. PDACAS_Sensor_Aggregate.

Input:
Dj; BITj; biti; Sj; raw data di; keyed values ekij, 1 ≤ jq
Output:
 Altered Dj and BITj
Method:
 1. ci = ci + 1;
 2. if ci = 3
  transmit Dj to the cell header CHj;
  return
 3. if ci = 1
  3.1 for (int k = 1; k <= p; k++)
    if both the kth bit of BITj and biti are 1s
      di=diekij
     Set the kth bit of BITj to be 0;
    else if the kth bit of biti is 1
      di=di+ekij
     Set the kth bit of BITj to be 1;
  3.2 Dj = Dj + di;
  3.3 transmits Dj and BITj to the successor;
  3.4 return
 4. if ci = 2
  4.1 for (int k = 1; k <= p; k++)
    if both the kth bit of BITj and biti are 1s
     Dj = Dj −  ekij;
     Set the kth bit of BITj to be 0;
  4.2 transmits Dj and BITj to the successor;
  4.3 return