⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 forceinfo.cpp

📁 Bubble Oscillation Algorithm. It is used to implement balancing load traffic, which is similar to wh
💻 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
//
//////////////////////////////////////////////////////////////////////

// ForceInfo.cpp: implementation of the ForceInfo class.
//
//////////////////////////////////////////////////////////////////////

#include "ForceInfo.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
ForceInfo::ForceInfo() {
}

ForceInfo::~ForceInfo() {
}

//////////////////////////////////////////////////////////////////////
// Get the utility value = |repulsion| + Attraction's projection onto the radial repulsion
//////////////////////////////////////////////////////////////////////
double ForceInfo::getResultant() {
	double ang = repulsion.angle() - attraction.angle();  
	double projection = attraction.magnitude() * cos(Point::deg2Rad(ang));

	return repulsion.magnitude() + projection;
}

//////////////////////////////////////////////////////////////////////
// update the repulsion force whenever the environment changes
//////////////////////////////////////////////////////////////////////
void ForceInfo::setRepulsion(const Point &repForce) {
	repulsion.set( repForce );
}

//////////////////////////////////////////////////////////////////////
// set the attraction force.
//////////////////////////////////////////////////////////////////////
void ForceInfo::setAttraction(const Point &newAttForce) {
	attraction.set( newAttForce );
}

//////////////////////////////////////////////////////////////////////
// add one more attraction force to traffic info.
//////////////////////////////////////////////////////////////////////
void ForceInfo::addAttraction(const Point &attForce) {
	attraction += attForce;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -