core: Add functions to calculate mean for Weibull distribution
This commit is contained in:
committed by
Sébastien Deronne
parent
10f5371ff3
commit
c834704d89
@@ -612,6 +612,20 @@ WeibullRandomVariable::GetBound() const
|
||||
return m_bound;
|
||||
}
|
||||
|
||||
double
|
||||
WeibullRandomVariable::GetMean(double scale, double shape)
|
||||
{
|
||||
NS_LOG_FUNCTION(scale << shape);
|
||||
return scale * std::tgamma(1 + (1 / shape));
|
||||
}
|
||||
|
||||
double
|
||||
WeibullRandomVariable::GetMean() const
|
||||
{
|
||||
NS_LOG_FUNCTION(this);
|
||||
return GetMean(m_scale, m_shape);
|
||||
}
|
||||
|
||||
double
|
||||
WeibullRandomVariable::GetValue(double scale, double shape, double bound)
|
||||
{
|
||||
|
||||
@@ -862,6 +862,19 @@ class WeibullRandomVariable : public RandomVariableStream
|
||||
*/
|
||||
double GetBound() const;
|
||||
|
||||
/**
|
||||
* \brief Returns the mean value for the Weibull distribution returned by this RNG stream.
|
||||
* \return The mean value for the Weibull distribution returned by this RNG stream.
|
||||
*/
|
||||
double GetMean() const;
|
||||
|
||||
/**
|
||||
* \copydoc GetMean()
|
||||
* \param [in] scale Scale parameter for the Weibull distribution.
|
||||
* \param [in] shape Shape parameter for the Weibull distribution.
|
||||
*/
|
||||
static double GetMean(double scale, double shape);
|
||||
|
||||
/**
|
||||
* \copydoc GetValue()
|
||||
* \param [in] scale Scale parameter for the Weibull distribution.
|
||||
|
||||
Reference in New Issue
Block a user