[ns] Initializing a MobileNode object

fhg07@c3sl.ufpr.br fhg07 at c3sl.ufpr.br
Mon Feb 2 10:49:21 PST 2009


Well.. It is just as it says, how do I declare and initialize a MobileNode
object? I tried doing it just the same way as I saw in other codes, but it
simply does not work. Not even the node->X() function does return the
right X position of my node.

Here is how I am initializing it:
C++ Code:
162     if (strcasecmp(argv[1], "node") == 0) {
163       node = (MobileNode*) tcl.lookup(argv[2]);
167       return TCL_OK;
168     }

ns-lib.tcl:
2318 Simulator instproc create-myunequal-agent { node } {
2319    set ragent [new Agent/MyUnequal]
2320    set addr [$node node-addr]
2321    $ragent addr $addr
2322    $ragent node $node
2323    $node set ragent_ $ragent
2324    $self at 0.0 "$ragent start-myunequal" ;# start the agent
2325    return $ragent
2326 }

Any ideas of how could I solve this problem?



Thanks in advance,
-- 
Fernando Henrique Gielow - UFPR - NR2
Computer Science graduation student.



More information about the Ns-users mailing list