Bug 512 - Adding UniformVariable::GetInteger and using it to fix bug in RealRandomStream::GetNext.
: Adding UniformVariable::GetInteger and using it to fix bug in RealRandomStrea...
Status: RESOLVED FIXED
: ns-3
simulation core
: ns-3-dev
: All All
: P1 normal
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2009-02-25 07:37 EDT by
Modified: 2009-03-04 13:14 EDT (History)


Attachments
UniformRandomGetInteger (2.40 KB, patch)
2009-02-25 07:37 EDT, TimoB
Details | Diff
fixed (1.89 KB, patch)
2009-02-25 07:43 EDT, TimoB
Details | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2009-02-25 07:37:11 EDT
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.
------- Comment #1 From 2009-02-25 07:37:48 EDT -------
Created an attachment (id=389) [details]
UniformRandomGetInteger
------- Comment #2 From 2009-02-25 07:39:37 EDT -------
If you update the patch to work with the tip of ns-3-dev, this patch looks good
to me.
------- Comment #3 From 2009-02-25 07:43:53 EDT -------
Created an attachment (id=390) [details]
fixed

for tip
------- Comment #4 From 2009-02-25 07:45:47 EDT -------
ok for me. raj, michele, can you ack this to fix the wifi regressions ?
------- Comment #5 From 2009-02-25 07:46:49 EDT -------
adding michele as CC
------- Comment #6 From 2009-02-26 12:48:45 EDT -------
yeah looks good.  timo, ping me before you commit.
------- Comment #7 From 2009-03-04 13:14:52 EDT -------
fixed 4256:cc06d903ca09