Bug 291

Summary: MobilityHelper.SetPositionAllocator (type, args) does not seem to work
Product: ns-3 Reporter: Mathieu Lacage <mathieu.lacage>
Component: python bindingsAssignee: Gustavo J. A. M. Carneiro <gjcarneiro>
Status: RESOLVED FIXED    
Severity: normal CC: gjcarneiro, ns-bugs
Priority: P3    
Version: pre-release   
Hardware: All   
OS: All   

Description Mathieu Lacage 2008-08-18 13:14:51 UTC
I tried calling this method as follows:
    mobility = MobilityHelper ()
    mobility.SetPositionAllocator ('ns3::RandomRectanglePositionAllocator',
                                   n1 = 'X', v1 = RandomVariableValue (UniformVariable (-5.0, 5.0)),
                                   n2 = 'Y', v2 = RandomVariableValue (UniformVariable (-5.0, 5.0)))

But I get this error:
mathieu@ns-test:~/code/ns-3-sigcomm$ python ./examples/sigcomm.py 
Traceback (most recent call last):
  File "./examples/sigcomm.py", line 168, in <module>
    main(sys.argv)
  File "./examples/sigcomm.py", line 75, in main
    n2 = 'Y', v2 = RandomVariableValue (UniformVariable (-5.0, 5.0)))
TypeError: argument 1 must be ns3.PositionAllocator, not str

which shows that the python bindings seem to expect me to call the overloaded version of that method which takes a Ptr<PositionAllocator> argument.
Comment 1 Mathieu Lacage 2008-10-10 05:26:02 UTC
*** Bug 374 has been marked as a duplicate of this bug. ***
Comment 2 Gustavo J. A. M. Carneiro 2008-10-12 09:43:42 UTC
3742:3fd36a505c0e