Strange problem in ns2

View: New views
1 Messages — Rating Filter:   Alert me  

Strange problem in ns2

by Shimmey :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I want to simulate a two rows of 14 nodes in a wireless environment.
The topology is:

(0)-(1)-(2)-(3)-(4)-(5)-(6)
(7)-(8)-(9)-(10)-(11)-(12)-(13)

And I set the nodes by:
set $val(nn) 14
set half_nn [expr $val(nn)/2]
for {set i 0} {$i<$val(nn)} {incr i} {
        if {$i<$half_nn} {
            set node_($i) [$ns node]
                $node_($i) set X_ [expr $i*250]----------------[1]
                $node_($i) set Y_ 200.0
                $node_($i) set Z_ 0.0
        } else {
            set node_($i) [$ns node]
                $node_($i) set X_ [expr ($i-7)*250]
                $node_($i) set Y_ 100.0
                $node_($i) set Z_ 0.0
        }
}
I've used these codes for only one line last time, it worked very well.

But for the above codes, the data never be sent out except I modified the distance of [1] to 100.
The trace file is empty...

In the nam, I could see nothing. It said: node 0 did not defined...
Is there anyone has idea about it?