本文整理汇总了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];
//.........这里部分代码省略.........
示例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;
}
}
示例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();
}