for {set i 0} {$i < $val(nn) } { incr i } {
set n($i) [$ns node]
}
for {set i 1} {$i < $val(nn) } { incr i } {
$n($i) set X_ [ expr {$val(x) * rand()} ]
$n($i) set Y_ [ expr {$val(y) * rand()} ]
$n($i) set Z_ 0
}
#Lable the sink node
$n(0) set X_ [expr {$val(x)/2} ]
$n(0) set Y_ [expr {$val(y)/2} ]
$n(0) set Z_ 0
$ns at 0.0 "$n(0) NodeLabel Sink"
# defines the node size in nam
for {set i 0} {$i < $val(nn)} {incr i} {
$ns initial_node_pos $n($i) 10
}
沒有留言:
張貼留言