[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
otcl syntax question
I would like to access the node id (e.g., "1") from otcl
code associated with an agent that is attached to the node.
In particular:
set n [$ns node]
set l [new Agent/LossMonitor]
$ns attach-agent $n $l
results in
Node _o9(id 1)
...
Agents at node (possibly in order of creation):
_o32 Agent/LossMonitor portID: 0(256)
In tcl/lib/ns-agent.tcl, if I do
Agent/LossMonitor instproc log-loss {} {
puts "log-loss: $self"
}
then $self evaluates to "_o32". How do I print the node id "1"
instead of the agent id "_o32" from that same piece of code?
Thanks very much.
--Ramon