Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # # Random Topology
- # for {set i 0} {$i < $num_node} {incr i} {
- # # set node_($i) [$ns_ node]
- # # $node_($i) random-motion 0
- # # Provide initial (X,Y, for now Z=0) co-ordinates for mobilenodes
- # set x_pos [expr int($grid_x_dim*rand())] ; #random settings
- # set y_pos [expr int($grid_y_dim*rand())] ; #random settings
- # while {$x_pos == 0 ||
- # $x_pos == $grid_x_dim} {
- # set x_pos [expr int($grid_x_dim*rand())]
- # }
- # while {$y_pos == 0 ||
- # $y_pos == $grid_y_dim} {
- # set y_pos [expr int($grid_y_dim*rand())]
- # }
- # $node_($i) set X_ $x_pos;
- # $node_($i) set Y_ $y_pos;
- # $node_($i) set Z_ 0.0
- # puts -nonewline $topo_file "$i x: [$node_($i) set X_] y: [$node_($i) set Y_] \n"
- # }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement