[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Agent Types: the sequel
Hello.
This mail follows the one I sent 2 days ago, in which I wondered how to
get an agent's type only from the variable "$agent".
Lloyd Wood proposed me to use if {[$agent info class]=="Agent/NBD" }
{...}, so I coded it like follows: (in ns/tcl/lib/ns-lib.tcl this time)
Simulator instproc attach-agent { node agent}
if {[$agent info class]=="Agent/NBD" }
{
puts "attach-agent:this guy is an NBD>>"
}
else
{
puts "attach-agent: this guy is not an nbd"
}
$node attach $agent
}
I get an error (see hereafter). Does anyone have a clue of what is wrong
there?
Thanks!
--
Robin POSS
[root@station2 ex]# ns zzwrlsnbd.tcl
wrong # args: no script following "{[$agent info class]" argument
while compiling
"if {[$agent info class]=="Agent/NBD" } "
(compiling body of proc "_o3", line 4)
(Simulator attach-agent line 4)
invoked from within
"$ns_ attach-agent $node_($i) $nbdagent_($i)"
(file "zzwrlsnbd.tcl" line 155)
[root@station2 ex]#