Bug 369 - RandomVariable: GetValue ->GenerateValue ?
RandomVariable: GetValue ->GenerateValue ?
Status: RESOLVED WONTFIX
Product: ns-3
Classification: Unclassified
Component: core
ns-3-dev
All All
: P3 minor
Assigned To: Michele Weigle
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-30 10:43 UTC by Gustavo J. A. M. Carneiro
Modified: 2008-10-09 11:09 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo J. A. M. Carneiro 2008-09-30 10:43:58 UTC
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 Mathieu Lacage 2008-10-01 18:43:12 UTC
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 Michele Weigle 2008-10-09 11:09:36 UTC
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.