[Ns-developers] ns-3.4 : Random Variables
Timo Bingmann
timo.bingmann at student.kit.edu
Wed Feb 25 11:15:19 PST 2009
Hello,
I'm somewhat confused on how to use/change the new RandomVariables:
This was previously the core part of the Nakagami propagation loss model:
resultPowerW = GammaVariable::GetSingleValue(m, powerW / m);
GammaVariable is an extension by me, but ExponentialVariable and others work likewise, this is only about the class interface. Obviously powerW changes for each call. So I cannot make a
GammaVariable m_rndvar(m, ...);
and pull a value each time.
Only way that works with the current API of just one GetValue() would be
resultPowerW = GammaVariable(m, powerW / m).GetValue();
however that creates a new RngStream() inside for each GammaVariable created. Also not what I want for propagation loss modelling.
So what do I do? I created a second GammaVariable::GetValue(alpha, beta) similar to the UniformVariable::GetValue(min,max). However the GetValue(a,b) code doesn't feel good, because I use the class-internal m_rngStream but ignore class-internal variables m_alpha, m_beta; so why have them in the first place?
Shouldn't this be done for all other RandomVariables as well? None other than Uniform has this.
Greetings
Timo
More information about the Ns-developers
mailing list