Bug 291 - MobilityHelper.SetPositionAllocator (type, args) does not seem to work
MobilityHelper.SetPositionAllocator (type, args) does not seem to work
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: python bindings
pre-release
All All
: P3 normal
Assigned To: Gustavo J. A. M. Carneiro
:
: 374 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-08-18 13:14 UTC by Mathieu Lacage
Modified: 2008-10-12 09:43 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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