[ns] side effects of c++ random variables on tcl random variables?
Martina Umlauft
martina.umlauft at vienna.at
Fri Sep 23 11:06:43 PDT 2005
Hi all!
I have a weird question regarding the random generator.
Ok, I tried to check this in the manual and I got more confused than
before -
1. the manual at http://www.isi.edu/nsnam/ns/doc/index.html dated
2005-09-23 is for which version of ns? I assume 2.28 - is this correct?
2. if yes, then lots have changed from ns2.1b9a random generation,
right? We have people here with experience in the old version but it
seems I can't rely on their input.
3. the actual PROBLEM:
-) we use random numbers from C++ and from Tcl - we have physical
layer calculations in C++ and traffic generators written in pure Tcl.
-) I set up the random numbers "like they used to be" in Tcl, eg.
set rng1 [new RNG];
$rng1 seed $seed;
set rtime [RandomVariable/Exponential];
$rtime use-rng $rng1;
$rtime set avg_ 14.1;
...
Apparently this should not be done like this anymore in ns2.28?
-) The objective is to run the same traffic with and without relay
stations - which of course means that the phy calculations differ. For
some reason the generated traffic (yes, I checked at the sender side on
the application layer level) is not the same with and without relay
stations - it seems like someone (I suspect the C++ code) is "eating
away" random numbers from the stream...
So the QUESTION is: can there be side effects from C++ towards the Tcl
random generators? If the C++ code uses more random number values will
this affect the random number values my pure tcl traffic generators get?
If yes (which I strongly suspect now) - how do I avoid it? I have to
admit I don't really understand what the ns manual is trying to tell in
Section 23.1...
Has anybody encountered such a problem before and could provide some
guidance? Thank you very much.
lg,
Martina Umlauft martina.umlauft at vienna.at
-----------------------------------------------------
http://frauenweb.at/~tina
More information about the Ns-users
mailing list