Skip to main content
. 2016 Mar 30;16(4):451. doi: 10.3390/s16040451
Algorithm 2: The adaptive logging approach
  • 1:

    For each time t Do

  • 2:

     The trust of each node {c1,t, c2,t, c3,t , , cm,t} at time t is computed by the Sink;

  • 3:

     For each node vi Do

  • 4:

     Case ci,t

  • 5:

     [0, cs]: S(vi)=0; // S(vi) is the logging probability of vi

  • 6:

     [cs, cz]: S(vi)=φx; // φ (0,1) is a constant

  • 7:

     [cz, 1]: S(vi)=min(ϕx,1)  //ϕ>1 is a constant

  • 8:

     End For;

  • 9:

     For each packet Bi received by node vi Do;

  • 10:

     node vi logs marking tuples of packets Bi with probability S(vi);

  • 11:

     End For;

  • 12:

     tt+1; //next time t

  • 13:

    End For