当前位置: 首页>>代码示例>>C++>>正文


C++ NetworkNode::GetIDNetworkNode方法代码示例

本文整理汇总了C++中NetworkNode::GetIDNetworkNode方法的典型用法代码示例。如果您正苦于以下问题:C++ NetworkNode::GetIDNetworkNode方法的具体用法?C++ NetworkNode::GetIDNetworkNode怎么用?C++ NetworkNode::GetIDNetworkNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NetworkNode的用法示例。


在下文中一共展示了NetworkNode::GetIDNetworkNode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: pow

bool
PowerBasedHoManager::CheckHandoverNeed (UserEquipment* ue)
{
	/*//test RX cqi success?
	  std::cout<<"PBHM: UE "<<ue->GetIDNetworkNode();
		ENodeB *testenb=nm->GetENodeBByID(ue->GetTargetNode()->GetIDNetworkNode());
		std::vector<int> testtemp=testenb->GetUserEquipmentRecord(ue->GetIDNetworkNode())->GetCQI();
		int testj=0;
		for(std::vector<int>::iterator testit=testtemp.begin();testit!=testtemp.end();testit++,testj++){
			std::cout<<"cqi="<<testtemp.at(testj)<<std::endl;
		}*/
	return false;
	//std::cout<<"power based ho"<<std::endl;//test
	/*
  NetworkNode *targetNode = ue->GetTargetNode ();

  double TXpower = 10 * log10 (
		  pow (10., (targetNode->GetPhy()->GetTxPower() - 30)/10)
		  /
		  targetNode->GetPhy()->GetBandwidthManager()->GetDlSubChannels().size () );
  double pathLoss = ComputePathLossForInterference(targetNode, ue);

  double targetRXpower = TXpower - pathLoss;
  double RXpower;


  std::vector<ENodeB*> *listOfNodes = NetworkManager::Init ()->GetENodeBContainer ();
  std::vector<ENodeB*>::iterator it;
  for (it = listOfNodes->begin (); it != listOfNodes->end (); it++)
    {
	  if ((*it)->GetIDNetworkNode () != targetNode->GetIDNetworkNode () )
	    {

	      NetworkNode *probableNewTargetNode = (*it);

	      TXpower = 10 * log10 (
				  pow (10., (probableNewTargetNode->GetPhy()->GetTxPower() - 30)/10)
				  /
				  probableNewTargetNode->GetPhy()->GetBandwidthManager()->GetDlSubChannels().size () );
	      pathLoss = ComputePathLossForInterference(probableNewTargetNode, ue);

	      RXpower = TXpower - pathLoss;

	      if (RXpower > targetRXpower)
	        {
	    	  if (NetworkManager::Init()->CheckHandoverPermissions(probableNewTargetNode,ue))
	    	  {
		    	  targetRXpower = RXpower;
			      targetNode = probableNewTargetNode;
	    	  }
	        }
	    }
    }

  std::vector<HeNodeB*> *listOfNodes2 = NetworkManager::Init ()->GetHomeENodeBContainer();
  std::vector<HeNodeB*>::iterator it2;
  for (it2 = listOfNodes2->begin (); it2 != listOfNodes2->end (); it2++)
    {
	  if ((*it2)->GetIDNetworkNode () != targetNode->GetIDNetworkNode () )
	    {

	      NetworkNode *probableNewTargetNode = (*it2);

	      TXpower =   10 * log10 (
				  pow (10., (probableNewTargetNode->GetPhy()->GetTxPower() - 30)/10)
				  /
				  probableNewTargetNode->GetPhy()->GetBandwidthManager()->GetDlSubChannels().size () );

	      pathLoss = ComputePathLossForInterference(probableNewTargetNode, ue);

	      RXpower = TXpower - pathLoss;

	      if (RXpower > targetRXpower)
	        {
	    	  if (NetworkManager::Init()->CheckHandoverPermissions(probableNewTargetNode,ue))
	    	  {
		    	  targetRXpower = RXpower;
			      targetNode = probableNewTargetNode;
	    	  }
	        }
	    }
    }

  if (ue->GetTargetNode ()->GetIDNetworkNode () != targetNode->GetIDNetworkNode ())
    {
	  m_target = targetNode;
	  return true;
    }
  else
    {
	  return false;
    }*/
	//mouan
	//NetworkNode *targetNode = ue->GetTargetNode ();
	NetworkNode *targetNode;

	//if(targetNode->GetNodeType()==NetworkNode::TYPE_ENODEB){
	std::cout<<"enb vs ue"<<std::endl;//test
	ENodeB *targetenb;
		int compare[2];
//.........这里部分代码省略.........
开发者ID:superhawk236,项目名称:Lte,代码行数:101,代码来源:power-based-ho-manager.cpp

示例2: GetAbsolutePosition

bool
PositionBasedHoManager::CheckHandoverNeed (UserEquipment* ue)
{
    NetworkNode *targetNode = ue->GetTargetNode ();

    CartesianCoordinates *uePosition = ue->GetMobilityModel ()->GetAbsolutePosition ();
    CartesianCoordinates *targetPosition;

    targetPosition = targetNode->GetMobilityModel ()->GetAbsolutePosition ();
    double targetDistance = uePosition->GetDistance (targetPosition);

    /*
    if (targetDistance <= (ue->GetCell ()->GetRadius () * 0.8))
      {
      return false;
      }
    */

    std::vector<ENodeB*> *listOfNodes = NetworkManager::Init ()->GetENodeBContainer ();
    std::vector<ENodeB*>::iterator it;
    for (it = listOfNodes->begin (); it != listOfNodes->end (); it++)
    {
        if ((*it)->GetIDNetworkNode () != targetNode->GetIDNetworkNode () )
        {

            NetworkNode *probableNewTargetNode = (*it);


            double distance = probableNewTargetNode->GetMobilityModel ()->
                              GetAbsolutePosition ()->GetDistance (uePosition);

            if (distance < targetDistance)
            {
                if (NetworkManager::Init()->CheckHandoverPermissions(probableNewTargetNode,ue))
                {
                    targetDistance = distance;
                    targetNode = probableNewTargetNode;
                }
            }
        }
    }
    std::vector<HeNodeB*> *listOfNodes2 = NetworkManager::Init ()->GetHomeENodeBContainer();
    std::vector<HeNodeB*>::iterator it2;
    for (it2 = listOfNodes2->begin (); it2 != listOfNodes2->end (); it2++)
    {
        if ((*it2)->GetIDNetworkNode () != targetNode->GetIDNetworkNode () )
        {

            NetworkNode *probableNewTargetNode = (*it2);


            double distance = probableNewTargetNode->GetMobilityModel ()->
                              GetAbsolutePosition ()->GetDistance (uePosition);

            if (distance < targetDistance)
            {
                if (NetworkManager::Init()->CheckHandoverPermissions(probableNewTargetNode,ue))
                {
                    targetDistance = distance;
                    targetNode = probableNewTargetNode;
                }
            }
        }
    }

    if (ue->GetTargetNode ()->GetIDNetworkNode () != targetNode->GetIDNetworkNode ())
    {
        m_target = targetNode;
        return true;
    }
    else
    {
        return false;
    }
}
开发者ID:bestplay9384,项目名称:LTE-Sim-Simulator,代码行数:75,代码来源:position-based-ho-manager.cpp

示例3: GetUserEquipmentContainer

void
NetworkManager::UpdateUserPosition (double time)
{
  std::vector<UserEquipment*> *records = GetUserEquipmentContainer ();
  std::vector<UserEquipment*>::iterator iter;
  UserEquipment *record;

#ifdef MOBILITY_DEBUG
  std::cout << "MOBILITY_DEBUG: UPDATE POSITION, "
      "number of UE = " << records->size () <<
      " time = " << time << std::endl;
#endif

  for (iter = records->begin(); iter != records->end(); iter++)
    {
      record = *iter;

#ifdef MOBILITY_DEBUG
    std::cout << "\t USER  " << record->GetIDNetworkNode ()
	              << std::endl;
#endif

      record->UpdateUserPosition (time);
      record->SetIndoorFlag( CheckIndoorUsers(record) );

#ifdef AMC_MAPPING
  std::cout << "time: " << time << "\n\t position: "
		  << record->GetMobilityModel ()->GetAbsolutePosition ()->GetCoordinateX () <<
		  " " << record->GetMobilityModel ()->GetAbsolutePosition ()->GetCoordinateY ()
		  << std::endl;
#endif
#ifdef MOBILITY_DEBUG
  std::cout << "time: " << time << "\t position: "
		  << record->GetMobilityModel ()->GetAbsolutePosition ()->GetCoordinateX () <<
		  " " << record->GetMobilityModel ()->GetAbsolutePosition ()->GetCoordinateY ()
		  << std::endl;
#endif


      if (record->GetMobilityModel ()->GetHandover () == true)
        {
    	  NetworkNode* targetNode = record->GetTargetNode ();

          if (targetNode->GetProtocolStack ()->GetRrcEntity ()->
        		  GetHandoverEntity ()->CheckHandoverNeed (record))
            {
        	  NetworkNode* newTagertNode = targetNode->GetProtocolStack ()
        			  ->GetRrcEntity ()->GetHandoverEntity ()->GetHoManager ()->m_target;

#ifdef HANDOVER_DEBUG
              std::cout << "** HO ** \t time: " << time << " user " <<  record->GetIDNetworkNode () <<
            		  " old eNB " << targetNode->GetIDNetworkNode () <<
            		  " new eNB " << newTagertNode->GetIDNetworkNode () << std::endl;
#endif
              HandoverProcedure(time, record, targetNode, newTagertNode);
            }
        }
    }

  //PrintUEsForEachCell();
}
开发者ID:AbubakarAuwal,项目名称:lte-sim,代码行数:61,代码来源:NetworkManager.cpp


注:本文中的NetworkNode::GetIDNetworkNode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。