[Tinyos-devel] 4bitle LinkEstimatorP.nc
Andreas Köpke
koepke at tkn.tu-berlin.de
Tue Dec 2 11:18:19 PST 2008
> > void updateEETX(neighbor_table_entry_t *ne, uint16_t newEst) {
> > ne->eetx = (ALPHA * ne->eetx + (10 - ALPHA) * newEst + 5)/10;
> > }
>
> Adding 5 will cause the estimate to veer of the historical value
> (eetx) or the new measured value (newEst).
The current operation is:
floor((9*oldEst + newEst)/10)
the new operation is:
round((9*oldEst + newEst)/10)
or with fewer brackets and not correct in integers:
floor(9/10*oldEst + 1/10*newEst + 5/10).
since floor(5/10) = 0, adding 5 just changes the round direction: from floor to
nearest. Ah, the beauty of integer arithmetic.
> In your experience, adding 5 helped?
Yes -- the estimator converges smoother.
> If newEst is a high value enough times this function is called, eetx
> will approach newEst.
Provided that newEst is a multiple of 10. If it is 19, eetx will stay at 10.
> - om_p
More information about the Tinyos-devel
mailing list