[ns] change variable value at run time

Simone Palmieri palmieri.simo at gmail.com
Thu Jun 28 01:18:31 PDT 2012


Hi all,
I have this problem: I have to modify a variable during simulation. I do:
$ns [new Simulator]
set a 0
$ns at 1 "puts $a"
$ns at 5 "set a 10"
$ns at 5.001 "puts $a"
$ns run

the result is 0 0. Doesn NS allow me to change the value?
Cheers,
Simone


More information about the Ns-users mailing list