baserndgen.cpp

来自「Bubble Oscillation Algorithm. It is used」· C++ 代码 · 共 47 行

CPP
47
字号
//////////////////////////////////////////////////////////////////////
//  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 + =
减小字号Ctrl + -
显示快捷键?