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

📄 csector.cpp

📁 此程序为wcdma系统当中ftp/video业务模型的c++程序仿真 通过此程序 能得到此两种业务在多种条件下的吞吐量和无码率的性能
💻 CPP
📖 第 1 页 / 共 2 页
字号:
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);

    //扇区最大发射功率减去给HSDSCH预留的功率,得到扇区的可用功率
    
 /*   m_fmeanTxPower=0;                           //先将平均发射功率置为0
  if(SlotNum>INITIALSLOT)                     //如果当前时隙数已大于初始化要求的时隙数
  {                                               
      for(int i=0;i<SlotsNumPerFrame;i++)
       m_fmeanTxPower+=m_fTxPow[i];
      m_fmeanTxPower/=SlotsNumPerFrame;         //得到平均发射功率
  }
    
    if(Power-m_fmeanTxPower>=TempPower)         
	//如果扇区可用功率减去平均发射功率大于移动台向扇区要求的发射功率
    {*/
        float fTxPower=m_fTotalVoicePower+m_fTotalDCHPower+m_fCommonPower+m_fPilotPower;
	    if(Power-fTxPower>=TempPower)
		//如果扇区可用功率减去当前实际发射功率大于移动台向扇区要求的发射功率
		    return true;
		else
			return false;
	//}
 //   else                                        
	//如果扇区可用功率减去平均发射功率小于移动台向扇区要求的发射功率
 //       return false;
}



//////////////////////////////////////////////////////////////////////////
//TITLE:      PowerControlDecision(功控判决函数)				        
//
//PARAMETERS:移动台向扇区要求的发射功率的增量
//
//PURPOSE AND ALGORITHMS:
//            如果扇区的最大发射功率减去扇区实际发射功率大于移动台向扇区
//            要求的发射功率的增量,则做功控;否则不做
//                                               
//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)
		//如果扇区可用功率减去当前实际发射功率大于移动台向扇区要求的发射功率的增量
		    return true;
		else
			return false;
	}
}



////////////////////////////////////////////////////////////////////////////////
//                          以下为接口函数的实现
/////////////////////////////////////////////////////////////////////////////////
//返回扇区标号
int  CSector::GetSectorIndex()
{
	return m_iSectorIndex;
}

//返回父小区标号
CELLID_TYPE	CSector::GetParentCellID()
{
	return  m_stParentCellID;
}

//设置父小区指针
void CSector::SetParentCell(CCell* pParentCell)
{
	m_pParentCell=pParentCell;
}

//返回父小区指针
CCell* CSector::GetParentCell()
{
	return m_pParentCell;
}


//返回扇区朝向 取值范围0-359
int	CSector::GetSectorOrientation()
{
	return m_iSectorOrientation;
}

//设置最大发射功率
void CSector::SetMaxPower(float MaxPower)
{
	m_fMaxPower=MaxPower;
}

//返回最大发射功率
float CSector::GetMaxPower()
{
	return  m_fMaxPower;
}

//设置实际发射功率
void CSector::SetTxPower(float TxPower)
{
	m_fTxPower=TxPower;
}

//返回实际发射功率
float CSector::GetTxPower()
{
	return m_fTxPower;
}

//设置导频功率
void CSector::SetPilotPower(float PilotPower)
{
    m_fPilotPower=PilotPower;
}

//返回导频功率	
float CSector::GetPilotPower()
{
	return m_fPilotPower;
}

//设置公共信道功率
void CSector::SetCommonPower(float CommonPower)
{
	m_fCommonPower=CommonPower;
}

//返回公共信道功率
float CSector::GetCommonPower()
{
	return  m_fCommonPower;
}

//返回分组数据信道的最大功率
float CSector::GetMaxPacketPower(void)
{
	return m_fMaxPacketPower;  
}

//设置分组数据信道的最大功率
void CSector::SetMaxPacketPower(float MPPower)
{
	m_fMaxPacketPower=MPPower;
}

//返回实际的话音业务总功率  
float CSector::GetTotalVoicePower()
{
	return m_fTotalVoicePower;
}

//设置实际的分组数据信道功率
void  CSector::SetPacketPower(float PPower)
{
	m_fPacketPower=PPower;
}

//返回实际的分组数据信道功率
float CSector::GetPacketPower()
{
	return m_fPacketPower;
}

////返回DCH信道可用功率
float CSector::GetDCHAvailablePower()
{
	return m_fDCHAvailablePower;
}

////设置DCH信道可用功率
void CSector::SetDCHAvailablePower(float fPower)
{
	m_fDCHAvailablePower = fPower;
}

////返回DSCH信道可用功率	
float CSector::GetHSDSCHAvailablePower()
{
	return m_fHSDSCHAvailablePower;
}

////设置DSCH信道可用功率
void CSector::SetHSDSCHAvailablePower(float fPower)
{
	m_fHSDSCHAvailablePower = fPower;
}
//设置当前时隙是否正在传送分组
void CSector::SetIsTransmiting(bool IsTrans)
{
	m_bIsTransmiting=IsTrans;
}


//返回当前时隙是否正在传送分组 
bool CSector::IsTransmiting()
{
	return m_bIsTransmiting;
}


//设置是否存在最高优先权分组用户
void CSector::SetIsExistHighestPriority(bool flag)
{
	m_bIsExistHighestPriority=flag;
}

//返回是否存在最高优先权分组用户
bool CSector::IsExistHighestPriority()
{
	return m_bIsExistHighestPriority;
}

/*  //by zl
//设置当前分组数据用户的指针
void CSector::SetCurrentHSDSCHMs(CDataMs* DataMs)
{
	m_pCurrentHSDSCHMs=DataMs;
}

//返回当前分组数据用户的指针
CDataMs* CSector::GetCurrentHSDSCHMs()
{
	return m_pCurrentHSDSCHMs;
}
*/
////设置当前的最佳用户的优先级指标 
void CSector::SetPriorityFactor(float PFactor)
{
	m_iPriorityFactor=PFactor;
}

////返回当前的最佳用户的优先级指标
float CSector::GetPriorityFactor()
{
	return m_iPriorityFactor;
}

////返回扇区等待调度的最高优先级的DSCH用户
CDataMs* CSector::GetHighestPriorityDataMs()
{
	return m_pHighestPriorityDataMs;
}

////设定扇区等待调度的最高优先级DSCH用户	
void CSector::SetHighestPriorityDataMs(CDataMs* pDataMs)
{
	m_pHighestPriorityDataMs = pDataMs;
}


////设置本扇区总分组用户数
void CSector::SetTotalDataMsNum(int Num)
{
	m_iTotalDataMsNum=Num;
}


////返回本扇区总分组用户数
int CSector::GetTotalDataMsNum()
{
	return m_iTotalDataMsNum;
}

////设置本扇区到目前为止成功传输bit数
void CSector::SetGoodBitNum(long Num)
{
	m_lGoodBitNum=Num;
}

////返回本扇区到目前为止成功传输bit数
long CSector::GetGoodBitNum()
{
	return m_lGoodBitNum;
}

////设置扇区成功传输传输块数
void CSector::SetSectorSucfulBLNum(int iBLNum)
{
	m_iSectorSucfulBLNum = iBLNum;
}

////返回扇区成功传输分组块数
int CSector::GetSectorSucfulBLNum(void)
{
	return m_iSectorSucfulBLNum;
}

////设置扇区传输失败传输块数
void CSector::SetSectorFailedBLNum(int iBLNum)
{
	m_iSectorFailedBLNum = iBLNum;
}

////返回扇区传输失败传输块数
int CSector::GetSectorFailedBLNum(void)
{
	return m_iSectorFailedBLNum;
}

////设置扇区传输分组数目
void CSector::SetPacketNum(int iPacketNum)
{
	m_iSectorPacketNum = iPacketNum;
}

////返回扇区传输分组数目
int CSector::GetPacketNum(void)
{
	return m_iSectorPacketNum;
}

////设置扇区成功传输分组数
void CSector::SetSectorSucfulPacketNum(int iPacketNum)
{
	m_iSectorSucfulPacketNum = iPacketNum;
}		 

////返回扇区成功传输分组数
int CSector::GetSectorSucfulPacketNum(void)
{
	return m_iSectorSucfulPacketNum;
}		 

////设置扇区传输失败分组数
void CSector::SetSectorFailedPacketNum(int iPacketNum)
{
	m_iSectorFailedPacketNum = iPacketNum;
}		 

////返回扇区传输失败分组数
int CSector::GetSectorFailedPacketNum(void)
{
	return m_iSectorFailedPacketNum;
}	

////设置扇区分组时延总和
void CSector::SetPacketDelay(int iPacketDelay) 
{
	m_iSectorPacketDelay = iPacketDelay;
}

////返回扇区分组时延总和
int CSector::GetPacketDelay(void)
{
	return m_iSectorPacketDelay;
}

////设置扇区传输分组呼叫数目
void CSector::SetPacketCallNum(int iPacketCallNum)
{
	m_iSectorPCNum = iPacketCallNum;
}

////返回扇区传输分组呼叫数目
int CSector::GetPacketCallNum(void)
{
	return m_iSectorPCNum;
}

////设置扇区分组呼叫时延总和
void CSector::SetPacketCallDelay(int iPacketCallDelay)
{
	m_iSectorPCDelay = iPacketCallDelay;
}

////返回扇区分组呼叫时延总和
int CSector::GetPacketCallDelay(void)
{
	return m_iSectorPCDelay;
}

////返回扇区平均分组时延
float CSector::GetAveragePDelay(void)
{
	return m_fSectorAveragePacketDelay;
}

////设置扇区传输分组呼叫比特数总和
void CSector::SetPacketCallBitNum(long lPCBitNum)
{
	m_lSectorPacketCallBitNum = lPCBitNum;
}

////返回扇区传输分组呼叫比特数总和
long CSector::GetPacketCallBitNum(void)
{
	return m_lSectorPacketCallBitNum;
}

////////////////////以下为新增的接口函数的实现/////////////////////        
//返回实际的DCH总功率
float CSector::GetTotalDCHPower()
{
        return m_fTotalDCHPower;
}

//设置DCH数据用户的总功率
void CSector::SetTotalDCHPower(float ftempTotalDCHPower)
{
        m_fTotalDCHPower = ftempTotalDCHPower;
}


//设置实际分配的HSDSCH分组数据信道功率  	             
void CSector::SetHSDSCHPower(float PPower)
{
	m_fHSDSCHPower=PPower;
}	             

//返回实际分配的HSDSCH分组数据信道功率 
float CSector::GetHSDSCHPower()
{
        return m_fHSDSCHPower;
}



//end of the file CSector.CPP   	                       

⌨️ 快捷键说明

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