otcl

Unable to change the value of the variable

I'm using a discrete event simulator called ns-2 that was built using Tcl and C++. I was trying to write some code in TCL: set ns [new Simulator] set state 0 $ns at 0.0 "puts \"At 0.0 value of state is: $state\"" $ns at 1.0 "changeVal" $ns at 2.0 "puts \"At 2.0 values of state is: $state\"" proc changeVal {} { global state gl...

NS2, Otcl: using a variable of an owned instance within a class

Hello all, I'm using NS2 to create some new classes in C++ and then link them to otcl. The linkage and everything works, but when I try to use the otcl variables in an object, I'm having a trouble. For example, suppose I have a class "Node" with the variable X. In the code I want to set this value and later on use it in some if-stateme...