Advertisement
AnindyaBiswas

TCL 2nd class

Apr 22nd, 2022
1,436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 0.35 KB | None | 0 0
  1. set ns [new Simulator]
  2. set f [open out.tr w]
  3. set nf [open output.nam w]
  4. $ns namtrace-all $nf
  5. $ns trace-all $f
  6. $ns color 1 Blue
  7. $ns color 2 Red
  8. proc finish { } {
  9.     global ns f
  10.     $ns flush-trace
  11.     close $f
  12.     exec nam output.nam &
  13.     exit 0
  14.     }
  15. set n0 [$ns node]
  16. set n1 [$ns node]
  17. $ns duplex-link $n0 $n1 1mb 10ms DropTail
  18.  
  19. $ns at 5.0 "finish"
  20. $ns run
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement