[Ns-bugs] [Bug 473] [contribution] Alternative ns-2 trace reader

code@nsnam.ece.gatech.edu code at nsnam.ece.gatech.edu
Mon Jan 19 02:24:14 PST 2009


http://www.nsnam.org/bugzilla/show_bug.cgi?id=473





--- Comment #2 from Francesco Malandrino <francesco.malandrino at gmail.com>  2009-01-19 05:24:14 EDT ---
I have written a variant of the Ns2MobilityHelper, suitable to read ns-2
mobility traces like the following one (generated by the Random Trip
implementation, see http://lrcwww.epfl.ch/RandomTrip/ and
http://www.cs.rice.edu/~santa/research/mobility/).

$node_(0) set X_ 28.675920486450
$node_(0) set Y_ 13.803303718567
$node_(0) set Z_ 0.000000000000
$ns_ at 4.634906291962 "$node_(0) set X_ 28.675920486450"
$ns_ at 4.634906291962 "$node_(0) set Y_ 13.803303718567"
$ns_ at 4.634906291962 "$node_(0) set Z_ 0.000000000000"
$ns_ at 4.634906291962 "$node_(0) setdest 44.610576629639
52.860397338867 0.917085826397"
[omissis, full test trace attached]

It assumes the semantic of setdest to be "setdest dest_x, dest_y,
speed", i.e. it only applies to 2d model. However, it can read a wider
set of formats respect to the original ones, namely:

$node_(1) set X_ 50 #initial position
$ns_ at 4.634906291962 "$node_(0) set Y_ 13.803303718567" #schedule position
$ns_ at 55.137107849121 "$node_(0) setdest 65.125175476074
80.098602294922 1.097754716873" #schedule setdest

Additionally, it can skip the comments and the parsing seems to me
somewhat more robust than the original one.

I attach it here as it may be useful for someone else (put the files in
src/helper/, and remember to edit src/helper/wscript). Unfortunately, I
could not follow the ns-3 coding style (e.g. the properties should
become attributes, I guess). 


-- 
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Ns-bugs mailing list