|
Algorithm 1. A pseudo-code description of BBS cleaning algorithm. |
|
| Algorithm BBS |
|
|
Require:
Tags = set of all observed tag Ids
|
| TS = the trainings set, the upper limit of |TS| is 2m+1
|
|
for (tag in Tags) do
|
| while (GetNextEpoch()) do
|
| pi=0 |
| if (
) then
|
| pi←Smoothing(w0, w1, n) |
// Equation 4
|
| K←CurrentSlope (TS) |
// Equation 5
|
| if (pi>pc && K>0 && pi-1==0) then
|
| // check whether it is necessary to switch on ROFM or not |
| t0=ti
|
| GetEpoch(ti+T) |
| while (ti≥t0 ‖ (ti<t0 && pi==0 && Readrate(K, B, pia, tia, ti)>0)) do
|
| if (pi==0) then
|
| pi←Readrate(K, B, pia, tia, ti) |
// Equation 3
|
| end if
|
| end while
|
| GetEpoch(t0+T) |
| end if
|
| else if (pi-1!=0) then
|
| K←CurrentSlope (TS) |
// Equation 5
|
| pi←Readrate(K, B, pia, tia, ti) |
// Equation 3
|
| else if (pi-1==0) then
|
| pi←Readrate(K, B, pia, tia, ti) |
// Equation 3
|
| end if
|
| end while
|
| end for |
|