📄 baserndgen.cpp
字号:
//////////////////////////////////////////////////////////////////////
// Title: Geographic Load Balancing for Cellular Networks
// by emulating the behavior of air bubbles
//
// Description: This project is for dynamically balancing the traffic load
// over a cellular network with fully adaptive antennas by
// emulating the behaviours of a bubble array. Since
// we assume fully adaptive base station antenna in this
// version, antenna agent and simulator are not needed.
//
// Copyright: Copyright (c) 2003
// Company: Elec. Eng. Dept., Queen Mary, University of London
// @author Lin Du (lin.du@elec.qmul.ac.uk)
// @version 1.0
//
//////////////////////////////////////////////////////////////////////
// BaseRndGen.cpp: implementation of the BaseRndGen class.
//
//////////////////////////////////////////////////////////////////////
#include "BaseRndGen.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
BaseRndGen::BaseRndGen() {
}
BaseRndGen::~BaseRndGen() {
}
// Get the random value yields the PDF distribution, by internal uniform random generator or external one
double BaseRndGen::getRnd() {
return getRnd(getRandom());
}
double BaseRndGen::getRnd(double uniformRnd) { // uniformRnd must be in [0 - 1.0]
return invIntegralPDF(uniformRnd);
}
// Return a random value between 0 to 1.0
double BaseRndGen::getRandom() {
return ((double) BSD_random()) / ((double)RANDOM_MAX + 1.0);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -