RandomDiscPositionAllocator Error setting Theta and Rho

52 views
Skip to first unread message

Masood Abbasi

unread,
Dec 15, 2018, 12:28:32 AM12/15/18
to ns-3-users
Hi All
I am getting errors on setting "Theta"  or "Rho" or both attributes only able to set "X" and "Y" parameter
msg="Invalid value for attribute set (Theta) on ns3::RandomDiscPositionAllocator", file=../src/core/model/object-factory.cc  or
msg="Invalid value for attribute set (Rho) on ns3::RandomDiscPositionAllocator", file=../src/core/model/object-factory.cc

MobilityHelper mobility;
  mobility.SetPositionAllocator ("ns3::RandomDiscPositionAllocator", "Theta", RandomVariableValue(UniformVariable (0.0, 6.2830)), "Rho", RandomVariableValue(UniformVariable (0.0, 0.0)), "X", DoubleValue (0.0),          "Y", DoubleValue (0.0));

ma.m...@gmail.com

unread,
Dec 15, 2018, 7:35:18 AM12/15/18
to ns-3-users
Hi Masood,
The syntax is wrong.
mobility.SetPositionAllocator ("ns3::RandomDiscPositionAllocator", "Theta", StringValue ("ns3::UniformRandomVariable[Min=0.0|Max=6.2830]")
                                                                 
, "Rho", StringValue ("ns3::UniformRandomVariable[Min=0.0|Max=200.0]"))
                                                                 
, "X", DoubleValue (0.0)
                                                                 
, "Y", DoubleValue (0.0));
good luck

Masood Abbasi

unread,
Dec 16, 2018, 2:50:18 AM12/16/18
to ns-3-users
Thanks Max It worked. Just remove [Min=0.0|Max=200.0]")) <- extra bracket
Reply all
Reply to author
Forward
0 new messages