[ns] velocity and direction of mobile nodes
Erico Augusto
ericosign at gmail.com
Mon Mar 16 21:25:52 PDT 2009
The path to one of that generators is:
ns-allinone-2.xxxx/ns-2.xxx/indep-utils/cmu-scen-gen/setdest/setdest
Executing it with:
setdest -v 1 -n 3 -p 5.0 -M 10 -t 100 -x 1000 -y 1000 > 3.scen
yields file 3.scen,with the following content:
#
# nodes: 3, pause: 5.00, max speed: 10.00, max x: 1000.00, max y: 1000.00
#
$node_(0) set X_ 862.976950011031
$node_(0) set Y_ 460.161509856953
$node_(0) set Z_ 0.000000000000
$node_(1) set X_ 421.853660313776
$node_(1) set Y_ 783.424889657734
$node_(1) set Z_ 0.000000000000
$node_(2) set X_ 916.298764196723
$node_(2) set Y_ 904.305358905232
$node_(2) set Z_ 0.000000000000
God set-dist 0 1 16777215
God set-dist 0 2 16777215
God set-dist 1 2 16777215
$ns_ at 5.000000000000 "$node_(0) setdest 832.825739455352 533.597036262086
1.056072784044"
$ns_ at 5.000000000000 "$node_(1) setdest 299.487360122933 126.151246074461
7.073986914798"
$ns_ at 5.000000000000 "$node_(2) setdest 284.691082829550 909.590117911516
9.722812248474"
$ns_ at 69.963693017594 "$node_(2) setdest 284.691082829550 909.590117911516
0.000000000000"
$ns_ at 74.963693017594 "$node_(2) setdest 660.188387920890 14.110909759782
7.769490905584"
$ns_ at 80.169375043206 "$node_(0) setdest 832.825739455352 533.597036262086
0.000000000000"
$ns_ at 85.169375043206 "$node_(0) setdest 485.399663672580 596.230301776878
0.086261529462"
$ns_ at 99.510669546215 "$node_(1) setdest 299.487360122933 126.151246074461
0.000000000000"
at tcl script:
...
set opt(sc) 3.scen ;# node movement file.
...
Erico
2009/3/16 Firdaus Alias <fudgy.geek at gmail.com>
>
> You can control the start/stop of the node via a tcl. The movement of the
> nodes can also be generated by tcl. You may want to look at traffic
> generators for ns-2 if you want to generate more complicated movements.
>
> Firdaus.
>
> On Mon, Mar 16, 2009 at 2:02 PM, Phenix <phenix_yw at hhu.edu.cn> wrote:
>
> >
> > Hi Rainn,
> >
> > I only know how to get the velocity and direction vector, as below:
> >
> > MobileNode * pMNode ;
> > ....
> > speed = pMNode->speed();
> > dx = pMNode->dX();
> > dy = pMNode->dY();
> >
> >
> > I also want to know how to control the movement of mobile nodes, such
> > as, nodes stop moving at a specific time.
> >
> > If anybody know, pls let me know.
> > Thank you!
> >
> >
> > Regards,
> > Phenix
> >
> > --------------------------------------------------
> > From: "Rainn" <rajstha2006 at gmail.com>
> > Sent: Monday, March 16, 2009 12:45 PM
> > To: <ns-users at ISI.EDU>
> > Subject: [ns] velocity and direction of mobile nodes
> >
> > >
> > > Dear all,
> > >
> > > I need to manipulate velocity and direction of mobile nodes in ns-2.
> > Could
> > > anyone please help me out "CODE" to manipulate this.
> > > It's urgent .....
> > > Thanks in advance.
> > > Have a good days always.
> > >
> >
> >
>
More information about the Ns-users
mailing list