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

Re: question about agent type



Or use the info command:
  if {[$agent info class] == "Agent/NBD"} {...}

 -Yuri

Tarik Alj <aljtarik@ozias.inrs-telecom.uquebec.ca> writes:

> >From the base class agent write an instproc is-nbd? that always return 0; from 
> your nbd agent class write an intsproc is-nbd? that always return 1. It should 
> do the trick...
> 
> > 
> > Hello,
> > 
> > I would like to develop an agent for ad-hoc network which runs a 
> > neighbor discovery protocol, and just that.
> > As the aodv routing protocol does neighbor discovery, my code-writing 
> > strategy has been to steal as much as I could into the aodv code.
> > But, I want my new agent, call it nbd, to be a normal agent, not a 
> > routing one like aodv. However, I would like nbd to send its packets  
> > (hello messages in fact) direclty to the ll layer.
> > To do so, I think I should add to the add-target-New procedure in ns/tcl
> > /lib/ns-node.tcl the following:
> > 
> > 	#
> > 	# Send Target
> > 	#
> > 
> > If the agent is a nbd
> > 	$agent target [$self set ll_(0)]
> > else
> > 	$agent target [$self entry]
> > 	
> > 	#
> > 	# Recv Target
> > 	#
> > 	...
> > 
> > How could I code the "agent is a nbd" part?
> > How could I get the type of an agent when the only thing I know about it
> >  is "$agent"?
> > 
> > any suggestions about how I could do what I want to do?
> > 
> > Cheers,
> > --
> > Robin POSS
> 
> Tarik