[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] Setting bound variables during simulation



If I run this script instead of getting :
loss rate set to 0
loss rate set to 0.01
loss rate set to 0.02
.....
loss rate set to 0.25

as an output, I just get
loss rate set to 0
loss rate set to 0
loss rate set to 0
loss rate set to 0
.....

I could not solve this problem.
 If I use 25 different loss modules previously created instead and use the
instructions :

set loss_module($j) [new ErrorModel]
$loss_module($j) unit pkt
$loss_module($j) ranvar [new RandomVariable/Uniform]
$loss_module($j) drop-target [new Agent/Null]
$loss_module($j) set rate_ [expr 0.01*$j]
$ns at [expr $j] "$ns lossmodel $loss_module($j) $n0 $n1"

instead of
$ns at [expr $j] "$loss_module set rate_ [expr 0.01*$j]"

now it works and I get the correct output but I still don't understand why
the previous loop did not work.
Thanks for your help

BP

----- Original Message -----
From: "Debojyoti Dutta" <[email protected]>
To: "Benoit Pinguet" <[email protected]>
Cc: <[email protected]>
Sent: Thursday, May 31, 2001 2:07 AM
Subject: Re: [ns] Setting bound variables during simulation


> Please let us know the errors you are getting.
>
> Debo
>