SETDEST tool for NS-2

An Overview SETDEST tool for NS-2

SETDEST tool- SETDEST tool is used for  setting nodes’ mobility, pause time  area under which node will move, and finally you will get rid of manually setting of nodes axes X, Y and Z and mobility.

The syntax of the  set dest is
setdest -v <2> -n <nodes> -s <speed type> -m <min speed> -M <max speed>
-t <simulation time> -P <pause type> -p <pause time> -x <max X> -y <max Y>

Example

setdest  -v 2 -n 10 -s 2 -m 1 -M 3 -t 100 -P 1 -p 2 -x 400 -y 500 >  nodes-10

this will produce the following result in  nodes-10 file .
include it adding this line
source nodes-10 
in ns-2 tcl file
for {set i 0} {$i < $opt(nn)} {incr i} {
set node_($i) [$ns_ node]
}
source nodes-10
for {set i 0} {$i < $opt(nn)} {incr i} {
$ns_ initial_node_pos $node_($i) 20
}

0
#
# nodes: 10, speed type: 2, min speed: 1.00, max speed: 3.00
# avg speed: 1.87, pause type: 1, pause: 2.00, max x: 400.00, max y: 500.00
#
$node_(0) set X_ 176.329775405255
$node_(0) set Y_ 31.652446972138
$node_(0) set Z_ 0.000000000000
$node_(1) set X_ 215.452345650198
$node_(1) set Y_ 53.775330932175
$node_(1) set Z_ 0.000000000000
$node_(2) set X_ 191.181314216394
$node_(2) set Y_ 111.507128387103
$node_(2) set Z_ 0.000000000000
$node_(3) set X_ 86.011631761310
$node_(3) set Y_ 277.438327252672
$node_(3) set Z_ 0.000000000000
$node_(4) set X_ 136.263270476544
$node_(4) set Y_ 332.128828294295
$node_(4) set Z_ 0.000000000000
$node_(5) set X_ 352.277264668064
$node_(5) set Y_ 81.022790831686
$node_(5) set Z_ 0.000000000000
$node_(6) set X_ 392.379878092328
$node_(6) set Y_ 115.016205916966
$node_(6) set Z_ 0.000000000000
$node_(7) set X_ 190.587261701503
$node_(7) set Y_ 454.908502316328
$node_(7) set Z_ 0.000000000000
$node_(8) set X_ 269.328885250820
$node_(8) set Y_ 92.181461670842
$node_(8) set Z_ 0.000000000000
$node_(9) set X_ 147.946879820188
$node_(9) set Y_ 23.559352126984
$node_(9) set Z_ 0.000000000000
$ns_ at 0.000000000000 “$node_(0) setdest 59.918950047144 343.801972691624 1.930707292535”
$ns_ at 0.000000000000 “$node_(1) setdest 313.351475162689 450.590376444813 1.565664615403”
$ns_ at 0.000000000000 “$node_(2) setdest 356.694070387717 109.291416530640 2.792064577981”
$ns_ at 0.000000000000 “$node_(3) setdest 393.120105324542 416.529324403522 2.016699501656”
$ns_ at 0.000000000000 “$node_(4) setdest 378.847850579851 200.275835967011 2.292075821374”
$ns_ at 0.000000000000 “$node_(5) setdest 19.514166111813 160.791443182300 2.456597434118”
$ns_ at 0.000000000000 “$node_(6) setdest 76.304054789069 403.907494738875 1.529088362597”
$ns_ at 0.000000000000 “$node_(7) setdest 315.690894719145 266.696088708189 1.246657615366”
$ns_ at 0.000000000000 “$node_(8) setdest 316.605046916252 485.940801695848 1.654010913343”
$ns_ at 0.000000000000 “$node_(9) setdest 388.942510937350 483.117789143813 2.661434208876”
$god_ set-dist 0 1 1
$god_ set-dist 0 2 1
$god_ set-dist 0 3 2
$god_ set-dist 0 4 2
$god_ set-dist 0 5 1
$god_ set-dist 0 6 1
$god_ set-dist 0 7 3
$god_ set-dist 0 8 1
$god_ set-dist 0 9 1
$god_ set-dist 1 2 1
$god_ set-dist 1 3 2
$god_ set-dist 1 4 2
$god_ set-dist 1 5 1
$god_ set-dist 1 6 1
$god_ set-dist 1 7 3
$god_ set-dist 1 8 1
$god_ set-dist 1 9 1
$god_ set-dist 2 3 1
$god_ set-dist 2 4 1
$god_ set-dist 2 5 1
$god_ set-dist 2 6 1
$god_ set-dist 2 7 2
$god_ set-dist 2 8 1
$god_ set-dist 2 9 1
$god_ set-dist 3 4 1
$god_ set-dist 3 5 2
$god_ set-dist 3 6 2
$god_ set-dist 3 7 1
$god_ set-dist 3 8 2
$god_ set-dist 3 9 2
$god_ set-dist 4 5 2
$god_ set-dist 4 6 2
$god_ set-dist 4 7 1
$god_ set-dist 4 8 2
$god_ set-dist 4 9 2
$god_ set-dist 5 6 1
$god_ set-dist 5 7 3
$god_ set-dist 5 8 1
$god_ set-dist 5 9 1
$god_ set-dist 6 7 3
$god_ set-dist 6 8 1
$god_ set-dist 6 9 2
$god_ set-dist 7 8 3
$god_ set-dist 7 9 3
$god_ set-dist 8 9 1
$ns_ at 4.101269801618 “$god_ set-dist 6 9 1”
$ns_ at 6.159357474340 “$god_ set-dist 3 8 1”
$ns_ at 6.159357474340 “$god_ set-dist 7 8 2”
$ns_ at 6.391948289446 “$god_ set-dist 1 3 1”
$ns_ at 6.391948289446 “$god_ set-dist 1 7 2”
$ns_ at 6.863445752311 “$god_ set-dist 0 3 1”
$ns_ at 6.863445752311 “$god_ set-dist 0 7 2”
$ns_ at 6.976260014760 “$god_ set-dist 3 9 1”
$ns_ at 6.976260014760 “$god_ set-dist 7 9 2”
$ns_ at 7.446082473831 “$god_ set-dist 4 8 1”
$ns_ at 13.385134740402 “$god_ set-dist 1 4 1”
$ns_ at 16.970186040203 “$god_ set-dist 4 9 1”
$ns_ at 17.415575590805 “$god_ set-dist 0 4 1”
$ns_ at 20.704003857331 “$god_ set-dist 4 5 1”
$ns_ at 20.704003857331 “$god_ set-dist 5 7 2”
$ns_ at 22.782011940452 “$god_ set-dist 4 6 1”
$ns_ at 22.782011940452 “$god_ set-dist 6 7 2”
$ns_ at 28.769437432914 “$god_ set-dist 3 5 1”
$ns_ at 37.164844389544 “$god_ set-dist 3 6 1”
$ns_ at 42.654534005296 “$god_ set-dist 2 3 2”
$ns_ at 44.495253701810 “$god_ set-dist 7 8 1”
$ns_ at 53.519138005711 “$god_ set-dist 7 9 1”
$ns_ at 54.203077176841 “$god_ set-dist 6 7 1”
$ns_ at 59.105798712138 “$god_ set-dist 1 7 1”
$ns_ at 59.285013545179 “$node_(2) setdest 356.694070387717 109.291416530640 0.000000000000”
$ns_ at 61.285013545179 “$node_(2) setdest 259.206063001152 336.251322864619 2.074306962885”
$ns_ at 69.700853358840 “$god_ set-dist 0 7 1”
$ns_ at 69.759814576268 “$god_ set-dist 2 3 1”
$ns_ at 78.847871336325 “$god_ set-dist 2 7 1”
$ns_ at 91.087712757933 “$god_ set-dist 3 5 2”
#
# Destination Unreachables: 0
#
# Route Changes: 28
#
# Link Changes: 22
#
# Node | Route Changes | Link Changes
#    0 |             4 |            3
#    1 |             4 |            3
#    2 |             3 |            3
#    3 |             9 |            9
#    4 |             6 |            6
#    5 |             4 |            3
#    6 |             5 |            4
#    7 |            12 |            6
#    8 |             4 |            3
#    9 |             5 |            4
#

Leave a Comment

Your email address will not be published. Required fields are marked *

©Postnetwork-All rights reserved.