[Ns-developers] bug 441 and DataRates

Raj Bhattacharjea raj.b at gatech.edu
Wed Dec 10 09:49:50 PST 2008


Bug 441 (http://www.nsnam.org/bugzilla/show_bug.cgi?id=441) makes me wonder
about the internal representation of the DataRate class, and our mostly off
list discussion from from March 2007 (starting 3/13/2007).

My initial thoughts on that class were to make its internal bps figure be of
type TimeUnit<-1>, so that such calculations could naturally work with
multiplication and division, assuming the DataRate operators pass through to
the TimeUnit operators.  In this case, what would happen internally:

TimeUnit<-1> bps;
TimeUnit<1> delta;
Scalar bits = (bps*delta);
bits.GetDouble() ...

But at the time I thought of this, as I recall the HighPrecision class
division was very slow (for things like txtime = bits/bps), and I'm not sure
if this has changed.  So doubles were proposed for the internal
representation, followed by integers which were settled upon.  I am starting
to think however, that we should revisit the TimeUnit idea.

-- 
Raj Bhattacharjea
Georgia Institute of Technology
School of Electrical and Computer Engineering
Ph.D. Candidate
Systems Analyst
404.894.2955


More information about the Ns-developers mailing list