[Tinyos-devel] 4bitle LinkEstimatorP.nc

Omprakash Gnawali gnawali at usc.edu
Tue Dec 2 17:08:27 PST 2008


On Tue, Dec 2, 2008 at 11:18 AM, Andreas Köpke <koepke at tkn.tu-berlin.de> wrote:
>> > 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.
>

I was aware of truncation but not aware of eetx fluctuation due to
this truncation in my experiments, even looking through the eetx trace
of the neighbors. But I will commit your change because rounding is
the right thing to do here.

Thanks.

- om_p



More information about the Tinyos-devel mailing list