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

[ns] using rtmodel-at from a function



Hi,

maybe someone can fill me in on the following:

when I manually disable and enable links using: '$ns rtmodel-at 0.1 down
$n1 $n2'
the link between n1 and n2 goes down at time 0.1.

when I include the above command in a function such as:

proc disable-link { n1 n2 }{
    global ns n1 n2  ;# ns and the 2 nodes are available
    $ns rtmodel-at 0.1 down $n1 $n2
}

and call this function like:

$ns at 0.05 "disable link $n1 $n2"

the link does not go down.

It doesn't have anything to do with back-in-time scheduling (as you can
see).  When I look at
the file 'tcl/rtglib/dynamics.tcl'  and trace the methods that are
called when 'Simulator rtmodel-at' is called I find that in de 2nd case,
'rtModel set-event-exact .. ' is not called and thus the 'link down'
event is not scheduled..

Does anybody know why this does not happen and how I can solve it. I
really need to call the 'Simulator rtmodel-at ...' method from any place
other then the 'top-level' in the simulation script.

regards, Sjoerd Janssen.