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

Re: Agent Types: the sequel



On Tue, 22 Feb 2000, Robin POSS wrote:

> 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" } 
> 	{

er, doesn't Tcl require \ on line breaks?

As Yuri points out,

       if {[$agent info class "Agent/NBD"]} {
       }

is rather better. Probably still undesirable, but better.

L.

<[email protected]>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>