Guest User

Untitled

a guest
Apr 4th, 2012
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 0.44 KB | None | 0 0
  1. for {set i 1} {$i < 21} {incr i} {
  2.  
  3.     set udpAgent($i) [new Agent/UDP]
  4.     $ns attach-agent $W1 $udpAgent($i)
  5.     set udpSink($i) [new Agent/Null]
  6.     $ns attach-agent $node($i) $udpSink($i)
  7.     $ns connect $udpAgent($i) $udpSink($i)
  8.     set cbr($i) [new Application/Traffic/CBR]
  9.     $cbr($i) set packetSize_ 500
  10.     $cbr($i) set interval_ 0.005
  11.     $cbr($i) attach-agent $udpAgent($i)
  12. }
  13. #code for the end
  14. for {set i 1} {$i < 21} {incr i} {
  15.     $ns at 5.0 "$cbr($i)
  16. }
Advertisement
Add Comment
Please, Sign In to add comment