On Monday 28 February 2011 20:15:05 hlabishi kobo wrote:
Thanks again for your reply sven, but i think my code might have maybe you a different view of wht i want to do, see below. The idea is to prioritize recently received OGM's thus giving them more weight for the routing decisions. suppose you have sliding window of 10, a link A records = 5 and link B records  = 4, currently this will be used towards the calculation of local TQ. in the proposed method we want to add the indexes on which an OGM was received in that interval. from the example above we would have link A 1+2+3+4+5+6= 21 and link B 7+8+9+10 = 34. this actually what i meant by counting and adding indexes.
I know what you want, but it seems (judging from your "implementation") that you don't know how to write that down. I hope that I gave you enough information to show you why your implementation isn't what you want.
The last part should help you to implement it the right way and to understand what the values represent and how you should operate on them.
Best regards, Sven