[Ns-bugs] [Bug 181] Normal Variable Infinite Value & Bounds
bugzilla-daemon@nsnam-www.ece.gatech.edu
bugzilla-daemon at nsnam-www.ece.gatech.edu
Wed Jun 18 12:23:32 PDT 2008
http://www.nsnam.org/bugzilla/show_bug.cgi?id=181
------- Comment #11 from mathieu.lacage at sophia.inria.fr 2008-06-18 15:23 -------
(In reply to comment #10)
> Hi all,
>
> The fix for the bounds that was applied is incorrect, or I am seriously
> confused. It currently, quite frequently, generates values outside the bounds.
> I am not sure if the original code had this behavior or not. The below
> snippet will bomb pretty much every run. I suspect that the readjustment of
> m_static_next if found out-of-bounds is incorrect, but have not investigated
> further.
>
> Thx
>
>
> bool bomb = 0;
> double mean = 1.0, variance = 0.2, bound = 0.75;
> for (int x = 0; x < 50; x++) {
> double x = NormalVariable::GetSingleValue(mean,variance,bound);
> if (x < mean-bound || x > mean+bound) {
> bomb = true;
> std::cout << "** ";
> }
> std::cout << x << std::endl;
> }
> if (bomb)
> std::cout << std::endl << "BOMBED" << std::endl;
The previous patch did modify GetValue but not GetSingleValue.
>
--
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