Problems creating exponential on off traffic generator

139 views
Skip to first unread message

Peshal Nayak

unread,
Mar 1, 2015, 11:46:09 PM3/1/15
to ns-3-...@googlegroups.com
Hi all,

I want to set the on time and off time as exponential random variables. In order to do that I'm using the following code:
source.SetAttribute ("OnTime", StringValue ("ns3::ExponentialRandomVariable[mean=0.5]"));
source
.SetAttribute ("OffTime",StringValue ("ns3::ExponentialRandomVariable[mean=0.5]"));

However, I get the following error message:
msg="Invalid value for attribute set (OnTime) on ns3::OnOffApplication", file=../src/core/model/object-factory.cc, line=75
terminate called without an active exception

Can anyone tell me how to declare an on off application with exponentially distributed ON time and OFF time.

Please reply as soon as possible.
Thank you.

Tommaso Pecorella

unread,
Mar 2, 2015, 3:05:20 AM3/2/15
to ns-3-...@googlegroups.com
Let me set a reminder in a couple of days.
I mean, what's up with this "asap" trend? Do the users (not only you) think we're paid to help people? We're not, but I can post my paypal account for donations. Mind that to have a premium account with LIMITED hotline hours one can pay a lot of money...
Bah, asap. And it's just a stupid misspelling error.

T.

Peshal Nayak

unread,
Mar 2, 2015, 12:21:19 PM3/2/15
to ns-3-...@googlegroups.com
Hi Tommaso,

Thanks for your reply. What is not spelt right? I checked the spelling for the line of code posted.

Best,
Peshal

Tommaso Pecorella

unread,
Mar 2, 2015, 3:10:18 PM3/2/15
to ns-3-...@googlegroups.com
It's case sensitive....
"mean" isn't equal to "Mean".

T.

Peshal Nayak

unread,
Mar 2, 2015, 5:12:19 PM3/2/15
to ns-3-...@googlegroups.com
Hi Tommaso,

Thanks for your reply.
I used lower case, because in the documentation it specifies "mean". Following is an example:
double ns3::ExponentialRandomVariable::GetValue (double  mean,


double bound

)













whereas under Attributes sections uses "Mean".
Its pretty confusing and mean.

Thanks.

Best,
Peshal

Tommaso Pecorella

unread,
Mar 2, 2015, 5:29:39 PM3/2/15
to ns-3-...@googlegroups.com
That's a function and it's arguments (variables). Their names is just an indication, as you'll call the function in some way such as GetValue (1.0, 100.0).
The Attribute is a string, so it's case-sensitive.

Cheers,

T.

PS: yes, it's average.
Reply all
Reply to author
Forward
0 new messages