SUBANGKAR

Random Topology

Jan 1st, 2019
739
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # # Random Topology
  2. # for {set i 0} {$i < $num_node} {incr i} {
  3. #   # set node_($i) [$ns_ node]
  4. #   # $node_($i) random-motion 0
  5.  
  6. #   # Provide initial (X,Y, for now Z=0) co-ordinates for mobilenodes
  7. #   set x_pos [expr int($grid_x_dim*rand())] ; #random settings
  8. #   set y_pos [expr int($grid_y_dim*rand())] ; #random settings
  9.  
  10. #   while {$x_pos == 0 ||
  11. #           $x_pos == $grid_x_dim} {
  12. #       set x_pos [expr int($grid_x_dim*rand())]
  13. #   }
  14.  
  15. #   while {$y_pos == 0 ||
  16. #           $y_pos == $grid_y_dim} {
  17. #       set y_pos [expr int($grid_y_dim*rand())]
  18. #   }
  19.  
  20. #   $node_($i) set X_ $x_pos;
  21. #   $node_($i) set Y_ $y_pos;
  22. #   $node_($i) set Z_ 0.0
  23.  
  24. #   puts -nonewline $topo_file "$i x: [$node_($i) set X_] y: [$node_($i) set Y_] \n"
  25. # }
RAW Paste Data