List Info

Thread: error




error
country flaguser name
Canada
2008-02-27 09:34:19

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

Re: error
country flaguser name
United States
2008-02-27 10:31:01
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/cl
ass.html

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

- Tom

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )