[Ns-bugs] [Bug 369] New: RandomVariable: GetValue ->GenerateValue ?
bugzilla-daemon@nsnam-www.ece.gatech.edu
bugzilla-daemon at nsnam-www.ece.gatech.edu
Tue Sep 30 07:44:00 PDT 2008
http://www.nsnam.org/bugzilla/show_bug.cgi?id=369
Summary: RandomVariable: GetValue ->GenerateValue ?
Product: ns-3
Version: ns-3-dev
Platform: All
OS/Version: All
Status: NEW
Severity: minor
Priority: P3
Component: simulation core
AssignedTo: ns-bugs at isi.edu
ReportedBy: gjcarneiro at gmail.com
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...
--
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the Ns-bugs
mailing list