|
Bugzilla – Full Text Bug Listing |
| Summary: | RandomVariable: GetValue ->GenerateValue ? | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Gustavo J. A. M. Carneiro <gjcarneiro> |
| Component: | core | Assignee: | Michele Weigle <mweigle> |
| Status: | RESOLVED WONTFIX | ||
| Severity: | minor | CC: | ns-bugs |
| Priority: | P3 | ||
| Version: | ns-3-dev | ||
| Hardware: | All | ||
| OS: | All | ||
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. 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. |
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...