tclns2

TCL NS-2 error: 'Error when calling class $cls: $args" $...".'


I have installed NS-2.35 in Ubuntu 22.04.1. I am running a TCL code (which is working fine in my friend's machine) but I am getting the following error:

num_nodes is set 101
INITIALIZE THE LIST xListHead
ns: _o1096 Public: 
    (_o1096 cmd line 1)
    invoked from within
"_o1096 cmd Public"
    invoked from within
"catch "$self cmd $args" ret"
    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 "_o1096" line 2)
    (SplitObject unknown line 2)
    invoked from within
"_o1096 Public"

My main tcl file does not have a Public keyword. However, the main file loads another file, in which I have categorized my nodes in three types: public, private and govt.

$ns at 0.0 "[$n49 set ragent_] Public"
#$ns at 0.0 "[$n38 set ragent_] Private"
$ns at 0.0 "[$n59 set ragent_] Govt"

I have 29 Public nodes:

$ns at 0.0 "[$n1 set ragent_] Public"
$ns at 0.0 "[$n2 set ragent_] Public"
$ns at 0.0 "[$n3 set ragent_] Public"

26 Private ones:

$ns at 0.0 "[$n30 set ragent_] Private"
$ns at 0.0 "[$n31 set ragent_] Private"
$ns at 0.0 "[$n32 set ragent_] Private"

Similarly, 2 Govt. nodes:

$ns at 0.0 "[$n58 set ragent_] Govt"
$ns at 0.0 "[$n59 set ragent_] Govt"

But the error is only in Public type. Why so? How do I resolve this error?


Solution

  • Okay. I have finally found a solution. The problem was with how I was running this code. After updating AODV and common folder files, I had to recompile the source using the following commands:

    > ./configure
    > make clean
    > make
    > sudo make install
    

    This worked for me, I hope it helps other people too.