Bug 369

Summary: RandomVariable: GetValue ->GenerateValue ?
Product: ns-3 Reporter: Gustavo J. A. M. Carneiro <gjcarneiro>
Component: coreAssignee: Michele Weigle <mweigle>
Status: RESOLVED WONTFIX    
Severity: minor CC: ns-bugs
Priority: P3    
Version: ns-3-dev   
Hardware: All   
OS: All   

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.