Skip to main content
. 2020 Apr 29;20(9):2513. doi: 10.3390/s20092513
Algorithm 3 findSensorClusters.
   Input: Fks,cks,λs,(Δ1h,Δ2h,Δh^h),(Δ1s,Δ2s,Δns)      Output: cks,c^ks
  • 1:

    clusterID=max(cks)+1

  • 2:

    o^clusterIDs=clusterID

  • 3:

    fori1 to n do

  • 4:

      updateCluster=false

  • 5:

      if ois=0 then

  • 6:

        for j1 to n do

  • 7:

          for a1 to h^ do

  • 8:

            compute Ys(i,j) as in Equation (9)

  • 9:

            if (1Ys(i,j)<0.5ojs=0) then

  • 10:

              ojs=clusterID //assign i and j to the same cluster

  • 11:

              updateCluster=true

  • 12:

            end if

  • 13:

          end for

  • 14:

        end for

  • 15:

        if (updateCluster) then

  • 16:

          clusterID=clusterID+1

  • 17:

          o^clusterIDs=clusterID

  • 18:

        end if

  • 19:

      end if

  • 20:

    end for