Help "OnOffHelper"

571 views
Skip to first unread message

Jaeyounj

unread,
Nov 15, 2008, 2:42:32 PM11/15/08
to ns-3-users
Hello,

I am testing a ns-3 example "wifi-adhoc.cc" but I can't find where the
definition of OnOffHelper is in Doxygen.

OnOffHelper onoff ("ns3::PacketSocketFactory", Address
(socketAddress));
onoff.SetAttribute ("OnTime", RandomVariableValue(ConstantVariable
(250)));
onoff.SetAttribute ("OffTime", RandomVariableValue(ConstantVariable
(0)));
onoff.SetAttribute ("DataRate", DataRateValue(DataRate(60000000)));
onoff.SetAttribute ("PacketSize", UintegerValue(2000));

Could anybody explain RandomVariableValue(...) in "OnTime" and
"OffTime"?

Even though I change the value in "OnTime", it works. Is it normal?
ex) onoff.SetAttribute ("OnTime", RandomVariableValue(ConstantVariable
(0)));

Thank you,
Jaeyoung

Tom Henderson

unread,
Nov 15, 2008, 7:16:19 PM11/15/08
to ns-3-...@googlegroups.com
Jaeyounj wrote:
> Hello,
>
> I am testing a ns-3 example "wifi-adhoc.cc" but I can't find where the
> definition of OnOffHelper is in Doxygen.
>
> OnOffHelper onoff ("ns3::PacketSocketFactory", Address
> (socketAddress));
> onoff.SetAttribute ("OnTime", RandomVariableValue(ConstantVariable
> (250)));
> onoff.SetAttribute ("OffTime", RandomVariableValue(ConstantVariable
> (0)));
> onoff.SetAttribute ("DataRate", DataRateValue(DataRate(60000000)));
> onoff.SetAttribute ("PacketSize", UintegerValue(2000));

I think you found two bugs. I do not know why Doxygen is not picking up
the doxygen comments in src/helper/on-off-helper.h

http://www.nsnam.org/bugzilla/show_bug.cgi?id=410

>
> Could anybody explain RandomVariableValue(...) in "OnTime" and
> "OffTime"?
>
> Even though I change the value in "OnTime", it works. Is it normal?
> ex) onoff.SetAttribute ("OnTime", RandomVariableValue(ConstantVariable
> (0)));

This one is now logged as:

http://www.nsnam.org/bugzilla/show_bug.cgi?id=411

We'll try to fix this as soon as possible.

Tom

Reply all
Reply to author
Forward
0 new messages