Hello everybody,

I implemented a new agent Clustering in application layer. I put  my .cc,
.h, and .tcl files in my own directory ("mohsen") under the ns directory.
Then I added the new packet type in 'packet.h' under packet_t{} and p_info
{}. Also I did necessary changes in ns-default.tcl, ns-packet.tcl, and
Makefile. Then I did 'make clean', 'make depend', and 'make'. Everything
was fine. In my tcl script when I make an object of my new agent and I try
to attach it to a node, NS returns the following Error.

*Here is a piece of my tcl script:*

-------------------------------------------------------------------

#Create a node

set n0 [$ns node]

set c0 [new Agent/Clustering]

$ns attach-agent $n0 $c0

-------------------------------------------------------------------





*NS returns the following errors:*



-------------------------------------------------------------------



can't read "debug_": no such variable

    (Object set line 1)

    invoked from within

"Classifier/Port set debug_"

    invoked from within

"catch "$c set $var" val"

    invoked from within

"if [catch "$self cmd $args" ret] {

set cls [$self info class]

global errorInfo

set savedInfo $errorInfo

error "error when calling class $cls: $args" $..."

    (procedure "_o59" line 2)

    (SplitObject unknown line 2)

    invoked from within

"$agent target [[$self node] entry]"

    (procedure "_o11" line 2)

    (RtModule attach line 2)

    invoked from within

"$m attach $agent $port"

    (procedure "_o10" line 4)

    (Node add-target line 4)

    invoked from within

"$self add-target $agent $port"

    (procedure "_o10" line 15)

    (Node attach line 15)

    invoked from within

"$node attach $agent"

    (procedure "_o3" line 2)

    (Simulator attach-agent line 2)

    invoked from within

"$ns attach-agent $n0 $p0"

    (file "clustering.tcl" line 29)

root@qq-desktop:~/ns-allinone-2.30/ns-2.30/mohsen#



-------------------------------------------------------------------



Even I can reach the data members (variables) of my newly defined agent.
When I add the code

"$ns attach-agent $n0 $c0"

NS returns the above mentioned error.



Does anybody know the cause of this error? Is this because of something I
didn't do or something I did wrong? I am very puzzled by this problem.  Any
help would be very much appreciated.



Thanks in advance,

Mohsen Sasani

Information Technoology, Computer Networks Engineering

Shiraz University of Technology

mohn....@gmail.com

Reply via email to