Bug 240

Summary: NormalVariableImpl Copy Constructor
Product: ns-3 Reporter: Joe Kopena <tjkopena>
Component: coreAssignee: ns-bugs <ns-bugs>
Status: RESOLVED FIXED    
Severity: major CC: craigdo
Priority: P1    
Version: pre-release   
Hardware: All   
OS: All   
Attachments: Trivial fix for NormalVariableImpl copy constructor

Description Joe Kopena 2008-06-26 11:17:06 UTC
There is a serious but trivial bug in the copy constructor for NormalVariableImpl.  It does not initialize m_nextValid, causing junk m_next results to be returned.  Beyond being an incorrect distribution then, the results may not obey the bounds.  This came up for me in that NormalVariable was still occasionally creating negative values, causing the scheduler to bail.

Note that m_nextValid should be initialized to false, rather than copying the value, as m_next is not copied (which sounds reasonable to me).

The fix for this is trivial, patch attached.

Thx
Comment 1 Joe Kopena 2008-06-26 11:18:36 UTC
Created attachment 188 [details]
Trivial fix for NormalVariableImpl copy constructor
Comment 2 Rajib Bhattacharjea 2008-06-26 14:18:26 UTC
+1 yes, this is correct.  Good work Joe...let merge this in ASAP.