[Ns-developers] [code omitted because of length] error

Tom Henderson tomh at tomh.org
Wed Feb 27 08:31:01 PST 2008


Islam Hegazy wrote:
> 
> Hi all
> I added a new agent in ns and modified the ns-agent.tcl file with the following code:
> Agent/IMultiHop instproc init args {
> 
> $self next $args
> 
> }
> 
> Agent/IMultiHop set sport_ 0
> 
> Agent/IMultiHop set dport_ 0
> 
> when I try to run my Tcl file with ns I get the following error:
> 
> [code omitted because of length]
> : invalid command name "Agent/IMultiHop"
>     while executing
> "Agent/IMultiHop instproc init args {
> $self next $args
> 
> }"
> 
> I searched FAQ and the internet but I didn't find an answer to this error. Can anyone tell me what is wrong?
> 
> Regards
> Islam Hegazy

Islam,

This error is due to a missing superclass declaration; try adding the 
following line above your instproc definition:

Class Agent/IMultiHop -superclass Agent

Here is some OTcl documentation on this:
http://bmrc.berkeley.edu/research/cmt/cmtdoc/otcl/class.html

However, the ns-manual doesn't seem to document this statement at the 
moment.

- Tom


More information about the Ns-developers mailing list