?? csector.cpp
字號(hào):
bool CSector::AdmissionControl(int SlotNum,float TempPower)
{
float Power;
//Power=m_fMaxPower; //use this when run voice only!
Power=float(m_fMaxPower-FractionOfHSDSCHChannel*m_fMaxPower);
//扇區(qū)最大發(fā)射功率減去給HSDSCH預(yù)留的功率,得到扇區(qū)的可用功率
/* m_fmeanTxPower=0; //先將平均發(fā)射功率置為0
if(SlotNum>INITIALSLOT) //如果當(dāng)前時(shí)隙數(shù)已大于初始化要求的時(shí)隙數(shù)
{
for(int i=0;i<SlotsNumPerFrame;i++)
m_fmeanTxPower+=m_fTxPow[i];
m_fmeanTxPower/=SlotsNumPerFrame; //得到平均發(fā)射功率
}
if(Power-m_fmeanTxPower>=TempPower)
//如果扇區(qū)可用功率減去平均發(fā)射功率大于移動(dòng)臺(tái)向扇區(qū)要求的發(fā)射功率
{*/
float fTxPower=m_fTotalVoicePower+m_fTotalDCHPower+m_fCommonPower+m_fPilotPower;
if(Power-fTxPower>=TempPower)
//如果扇區(qū)可用功率減去當(dāng)前實(shí)際發(fā)射功率大于移動(dòng)臺(tái)向扇區(qū)要求的發(fā)射功率
return true;
else
return false;
//}
// else
//如果扇區(qū)可用功率減去平均發(fā)射功率小于移動(dòng)臺(tái)向扇區(qū)要求的發(fā)射功率
// return false;
}
//////////////////////////////////////////////////////////////////////////
//TITLE: PowerControlDecision(功控判決函數(shù))
//
//PARAMETERS:移動(dòng)臺(tái)向扇區(qū)要求的發(fā)射功率的增量
//
//PURPOSE AND ALGORITHMS:
// 如果扇區(qū)的最大發(fā)射功率減去扇區(qū)實(shí)際發(fā)射功率大于移動(dòng)臺(tái)向扇區(qū)
// 要求的發(fā)射功率的增量,則做功控;否則不做
//
//AUTHOR: Li Jing
//
//CALLING FUNCTIONS:
// NULL
//
//////////////////////////////////////////////////////////////////////////
bool CSector::PowerControlDecision(float PowerIncrement)
{
float Power;
Power=float(m_fMaxPower-FractionOfHSDSCHChannel*m_fMaxPower);
//Power=float(m_fMaxPower*(1-PowerControlReserved));
float fTxPower=m_fTotalVoicePower+m_fTotalDCHPower+m_fCommonPower+m_fPilotPower;
if(PowerIncrement<0)
return true;
else
{
if(Power-fTxPower>=PowerIncrement)
//如果扇區(qū)可用功率減去當(dāng)前實(shí)際發(fā)射功率大于移動(dòng)臺(tái)向扇區(qū)要求的發(fā)射功率的增量
return true;
else
return false;
}
}
////////////////////////////////////////////////////////////////////////////////
// 以下為接口函數(shù)的實(shí)現(xiàn)
/////////////////////////////////////////////////////////////////////////////////
//返回扇區(qū)標(biāo)號(hào)
int CSector::GetSectorIndex()
{
return m_iSectorIndex;
}
//返回父小區(qū)標(biāo)號(hào)
CELLID_TYPE CSector::GetParentCellID()
{
return m_stParentCellID;
}
//設(shè)置父小區(qū)指針
void CSector::SetParentCell(CCell* pParentCell)
{
m_pParentCell=pParentCell;
}
//返回父小區(qū)指針
CCell* CSector::GetParentCell()
{
return m_pParentCell;
}
//返回扇區(qū)朝向 取值范圍0-359
int CSector::GetSectorOrientation()
{
return m_iSectorOrientation;
}
//設(shè)置最大發(fā)射功率
void CSector::SetMaxPower(float MaxPower)
{
m_fMaxPower=MaxPower;
}
//返回最大發(fā)射功率
float CSector::GetMaxPower()
{
return m_fMaxPower;
}
//設(shè)置實(shí)際發(fā)射功率
void CSector::SetTxPower(float TxPower)
{
m_fTxPower=TxPower;
}
//返回實(shí)際發(fā)射功率
float CSector::GetTxPower()
{
return m_fTxPower;
}
//設(shè)置導(dǎo)頻功率
void CSector::SetPilotPower(float PilotPower)
{
m_fPilotPower=PilotPower;
}
//返回導(dǎo)頻功率
float CSector::GetPilotPower()
{
return m_fPilotPower;
}
//設(shè)置公共信道功率
void CSector::SetCommonPower(float CommonPower)
{
m_fCommonPower=CommonPower;
}
//返回公共信道功率
float CSector::GetCommonPower()
{
return m_fCommonPower;
}
//返回分組數(shù)據(jù)信道的最大功率
float CSector::GetMaxPacketPower(void)
{
return m_fMaxPacketPower;
}
//設(shè)置分組數(shù)據(jù)信道的最大功率
void CSector::SetMaxPacketPower(float MPPower)
{
m_fMaxPacketPower=MPPower;
}
//返回實(shí)際的話音業(yè)務(wù)總功率
float CSector::GetTotalVoicePower()
{
return m_fTotalVoicePower;
}
//設(shè)置實(shí)際的分組數(shù)據(jù)信道功率
void CSector::SetPacketPower(float PPower)
{
m_fPacketPower=PPower;
}
//返回實(shí)際的分組數(shù)據(jù)信道功率
float CSector::GetPacketPower()
{
return m_fPacketPower;
}
////返回DCH信道可用功率
float CSector::GetDCHAvailablePower()
{
return m_fDCHAvailablePower;
}
////設(shè)置DCH信道可用功率
void CSector::SetDCHAvailablePower(float fPower)
{
m_fDCHAvailablePower = fPower;
}
////返回DSCH信道可用功率
float CSector::GetHSDSCHAvailablePower()
{
return m_fHSDSCHAvailablePower;
}
////設(shè)置DSCH信道可用功率
void CSector::SetHSDSCHAvailablePower(float fPower)
{
m_fHSDSCHAvailablePower = fPower;
}
//設(shè)置當(dāng)前時(shí)隙是否正在傳送分組
void CSector::SetIsTransmiting(bool IsTrans)
{
m_bIsTransmiting=IsTrans;
}
//返回當(dāng)前時(shí)隙是否正在傳送分組
bool CSector::IsTransmiting()
{
return m_bIsTransmiting;
}
//設(shè)置是否存在最高優(yōu)先權(quán)分組用戶
void CSector::SetIsExistHighestPriority(bool flag)
{
m_bIsExistHighestPriority=flag;
}
//返回是否存在最高優(yōu)先權(quán)分組用戶
bool CSector::IsExistHighestPriority()
{
return m_bIsExistHighestPriority;
}
/* //by zl
//設(shè)置當(dāng)前分組數(shù)據(jù)用戶的指針
void CSector::SetCurrentHSDSCHMs(CDataMs* DataMs)
{
m_pCurrentHSDSCHMs=DataMs;
}
//返回當(dāng)前分組數(shù)據(jù)用戶的指針
CDataMs* CSector::GetCurrentHSDSCHMs()
{
return m_pCurrentHSDSCHMs;
}
*/
////設(shè)置當(dāng)前的最佳用戶的優(yōu)先級(jí)指標(biāo)
void CSector::SetPriorityFactor(float PFactor)
{
m_iPriorityFactor=PFactor;
}
////返回當(dāng)前的最佳用戶的優(yōu)先級(jí)指標(biāo)
float CSector::GetPriorityFactor()
{
return m_iPriorityFactor;
}
////返回扇區(qū)等待調(diào)度的最高優(yōu)先級(jí)的DSCH用戶
CDataMs* CSector::GetHighestPriorityDataMs()
{
return m_pHighestPriorityDataMs;
}
////設(shè)定扇區(qū)等待調(diào)度的最高優(yōu)先級(jí)DSCH用戶
void CSector::SetHighestPriorityDataMs(CDataMs* pDataMs)
{
m_pHighestPriorityDataMs = pDataMs;
}
////設(shè)置本扇區(qū)總分組用戶數(shù)
void CSector::SetTotalDataMsNum(int Num)
{
m_iTotalDataMsNum=Num;
}
////返回本扇區(qū)總分組用戶數(shù)
int CSector::GetTotalDataMsNum()
{
return m_iTotalDataMsNum;
}
////設(shè)置本扇區(qū)到目前為止成功傳輸bit數(shù)
void CSector::SetGoodBitNum(long Num)
{
m_lGoodBitNum=Num;
}
////返回本扇區(qū)到目前為止成功傳輸bit數(shù)
long CSector::GetGoodBitNum()
{
return m_lGoodBitNum;
}
////設(shè)置扇區(qū)成功傳輸傳輸塊數(shù)
void CSector::SetSectorSucfulBLNum(int iBLNum)
{
m_iSectorSucfulBLNum = iBLNum;
}
////返回扇區(qū)成功傳輸分組塊數(shù)
int CSector::GetSectorSucfulBLNum(void)
{
return m_iSectorSucfulBLNum;
}
////設(shè)置扇區(qū)傳輸失敗傳輸塊數(shù)
void CSector::SetSectorFailedBLNum(int iBLNum)
{
m_iSectorFailedBLNum = iBLNum;
}
////返回扇區(qū)傳輸失敗傳輸塊數(shù)
int CSector::GetSectorFailedBLNum(void)
{
return m_iSectorFailedBLNum;
}
////設(shè)置扇區(qū)傳輸分組數(shù)目
void CSector::SetPacketNum(int iPacketNum)
{
m_iSectorPacketNum = iPacketNum;
}
////返回扇區(qū)傳輸分組數(shù)目
int CSector::GetPacketNum(void)
{
return m_iSectorPacketNum;
}
////設(shè)置扇區(qū)成功傳輸分組數(shù)
void CSector::SetSectorSucfulPacketNum(int iPacketNum)
{
m_iSectorSucfulPacketNum = iPacketNum;
}
////返回扇區(qū)成功傳輸分組數(shù)
int CSector::GetSectorSucfulPacketNum(void)
{
return m_iSectorSucfulPacketNum;
}
////設(shè)置扇區(qū)傳輸失敗分組數(shù)
void CSector::SetSectorFailedPacketNum(int iPacketNum)
{
m_iSectorFailedPacketNum = iPacketNum;
}
////返回扇區(qū)傳輸失敗分組數(shù)
int CSector::GetSectorFailedPacketNum(void)
{
return m_iSectorFailedPacketNum;
}
////設(shè)置扇區(qū)分組時(shí)延總和
void CSector::SetPacketDelay(int iPacketDelay)
{
m_iSectorPacketDelay = iPacketDelay;
}
////返回扇區(qū)分組時(shí)延總和
int CSector::GetPacketDelay(void)
{
return m_iSectorPacketDelay;
}
////設(shè)置扇區(qū)傳輸分組呼叫數(shù)目
void CSector::SetPacketCallNum(int iPacketCallNum)
{
m_iSectorPCNum = iPacketCallNum;
}
////返回扇區(qū)傳輸分組呼叫數(shù)目
int CSector::GetPacketCallNum(void)
{
return m_iSectorPCNum;
}
////設(shè)置扇區(qū)分組呼叫時(shí)延總和
void CSector::SetPacketCallDelay(int iPacketCallDelay)
{
m_iSectorPCDelay = iPacketCallDelay;
}
////返回扇區(qū)分組呼叫時(shí)延總和
int CSector::GetPacketCallDelay(void)
{
return m_iSectorPCDelay;
}
////返回扇區(qū)平均分組時(shí)延
float CSector::GetAveragePDelay(void)
{
return m_fSectorAveragePacketDelay;
}
////設(shè)置扇區(qū)傳輸分組呼叫比特?cái)?shù)總和
void CSector::SetPacketCallBitNum(long lPCBitNum)
{
m_lSectorPacketCallBitNum = lPCBitNum;
}
////返回扇區(qū)傳輸分組呼叫比特?cái)?shù)總和
long CSector::GetPacketCallBitNum(void)
{
return m_lSectorPacketCallBitNum;
}
////////////////////以下為新增的接口函數(shù)的實(shí)現(xiàn)/////////////////////
//返回實(shí)際的DCH總功率
float CSector::GetTotalDCHPower()
{
return m_fTotalDCHPower;
}
//設(shè)置DCH數(shù)據(jù)用戶的總功率
void CSector::SetTotalDCHPower(float ftempTotalDCHPower)
{
m_fTotalDCHPower = ftempTotalDCHPower;
}
//設(shè)置實(shí)際分配的HSDSCH分組數(shù)據(jù)信道功率
void CSector::SetHSDSCHPower(float PPower)
{
m_fHSDSCHPower=PPower;
}
//返回實(shí)際分配的HSDSCH分組數(shù)據(jù)信道功率
float CSector::GetHSDSCHPower()
{
return m_fHSDSCHPower;
}
//end of the file CSector.CPP
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -