Bugzilla – Bug 512
Adding UniformVariable::GetInteger and using it to fix bug in RealRandomStream::GetNext.
Last modified: 2009-03-04 13:14:52 EST
RealRandomStream::GetNext() must return backoff values for DCF in the range [0..CW] with uniform probability distribution. A quick test showed that this is not the case. See counts of some values pulled from GetNext(0,15): 0=4786 1=9297 2=9426 3=9365 4=9283 5=9335 6=9323 7=9365 8=9312 9=9400 10=9165 11=9482 12=9236 13=9178 14=9429 15=4618 16=0 17=0 0 and 15 are only half as probable, because round yields 0 for 0-0.5 and 1 for 0.5-1.5. Created UniformVariable::GetInteger(min,max). The code works if UniformVariable::GetValue(min,max) never returns max. Is this absolutely positively the case? All regressions using DCF are messed up.
Created attachment 389 [details] UniformRandomGetInteger
If you update the patch to work with the tip of ns-3-dev, this patch looks good to me.
Created attachment 390 [details] fixed for tip
ok for me. raj, michele, can you ack this to fix the wifi regressions ?
adding michele as CC
yeah looks good. timo, ping me before you commit.
fixed 4256:cc06d903ca09