Bug 369 - RandomVariable: GetValue ->GenerateValue ?
: RandomVariable: GetValue ->GenerateValue ?
Status: RESOLVED WONTFIX
: ns-3
simulation core
: ns-3-dev
: All All
: P3 minor
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2008-09-30 10:43 EDT by
Modified: 2008-10-09 11:09 EDT (History)


Attachments


Note

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


Description From 2008-09-30 10:43:58 EDT
Real story.  I was teaching a colleague to use random variables for scheduling,
with code like this:

Time t = Seconds (0);
ExponentialVariable rng (5.14);
for (n = 0; n < 10000; n++)
{
    Schedule (t, ...);
    t += rng.GetValue ();
}

He asks, "shouldn't the 'ExponentialVariable rng (5.14)' part be inside the for
loop?".  I had to explain to him that rng.GetValue () actually generates a new
value each time it is called.  We came to the conclusion that perhaps
GenerateValue () would be a better method name.

So I leave here that thought for your consideration...
------- Comment #1 From 2008-10-01 18:43:12 EDT -------
You might be happy to hear that I think that we are way past this kind of
function name changes. I like your proposal though.
------- Comment #2 From 2008-10-09 11:09:36 EDT -------
I agree that although the name GenerateValue might be slightly more intuitive,
we've gone a while with GetValue, so we'll just leave it as it is.