Hi I am a little bit confused, first of all my total number of nodes is 100. I want to add an extra node beside $mnode_(10) in order to optimize my stats(I don't have any dropped packets) for instance $mnode_(20) can somebody help me modify the code below with this new add.
for {set i 0} {$i < $val(nn) } { incr i } { set mnode_($i) [$ns node] } for {set i 1} {$i < $val(nn) } { incr i } { $mnode_($i) set X_ [ expr {$val(x) * rand()} ] $mnode_($i) set Y_ [ expr {$val(y) * rand()} ] $mnode_($i) set Z_ 0 } # Position of Sink $mnode_(10) set X_ [ expr {$val(x)/2 + 1} ] $mnode_(10) set Y_ [ expr {$val(y)/4 + 1} ] $mnode_(10) set Z_ 0.0 $mnode_(0) set X_ [ expr {$val(x)/2} ] $mnode_(0) set Y_ [ expr {$val(y)/4} ] $mnode_(0) set Z_ 0.0 $mnode_(0) label "Sink" for {set i 0} {$i < $val(nn)} { incr i } { $ns initial_node_pos $mnode_($i) 10 } #Setup a UDP connection set udp [new Agent/UDP] $ns attach-agent $mnode_(10) $udp set sink [new Agent/Null] $ns attach-agent $mnode_(0) $sink $ns connect $udp $sink $udp set fid_ 2 Thanks alot MIKE -- View this message in context: http://old.nabble.com/add-new-node-to-my-tcl-code-tp31397795p31397795.html Sent from the ns-users mailing list archive at Nabble.com.