BareHandoverAlgorithm for LTE to simulate absence of handover algorithm

This commit is contained in:
Budiarto Herman
2013-08-07 15:34:24 +03:00
parent d68107aa9d
commit 7fa99399c8
4 changed files with 145 additions and 2 deletions

View File

@@ -150,7 +150,7 @@ TypeId LteHelper::GetTypeId (void)
"The type of handover algorithm to be used for eNBs. "
"The allowed values for this attributes are the type names "
"of any class inheriting from ns3::HandoverAlgorithm.",
StringValue ("ns3::A2RsrqHandoverAlgorithm"),
StringValue ("ns3::BareHandoverAlgorithm"),
MakeStringAccessor (&LteHelper::SetHandoverAlgorithmType),
MakeStringChecker ())
.AddAttribute ("PathlossModel",

View File

@@ -38,7 +38,8 @@ NS_OBJECT_ENSURE_REGISTERED (A2RsrqHandoverAlgorithm);
///////////////////////////////////////////
/**
* \brief Class for forwarding Handover Management SAP Provider functions.
* \brief Class for forwarding Handover Management SAP Provider functions, used
* by ns3::A2RsrqHandoverAlgorithm.
*/
class A2RsrqMemberHandoverManagementSapProvider : public HandoverManagementSapProvider
{

View File

@@ -20,6 +20,7 @@
*/
#include "handover-algorithm.h"
#include <ns3/handover-management-sap.h>
#include <ns3/log.h>
NS_LOG_COMPONENT_DEFINE ("HandoverAlgorithm");
@@ -55,4 +56,106 @@ HandoverAlgorithm::GetTypeId (void)
}
///////////////////////////////////////////
// Handover Management SAP forwarder
///////////////////////////////////////////
NS_OBJECT_ENSURE_REGISTERED (BareHandoverAlgorithm);
/**
* \brief Class for forwarding Handover Management SAP Provider functions, used
* by ns3::BareHandoverAlgorithm.
*/
class BareMemberHandoverManagementSapProvider : public HandoverManagementSapProvider
{
public:
BareMemberHandoverManagementSapProvider (BareHandoverAlgorithm* handoverAlgorithm);
// methods inherited from HandoverManagementSapProvider go here
virtual void ReportUeMeas (uint16_t rnti, LteRrcSap::MeasResults measResults);
private:
BareHandoverAlgorithm* m_handoverAlgorithm;
};
BareMemberHandoverManagementSapProvider::BareMemberHandoverManagementSapProvider (BareHandoverAlgorithm* handoverAlgorithm)
: m_handoverAlgorithm (handoverAlgorithm)
{
}
void
BareMemberHandoverManagementSapProvider::ReportUeMeas (uint16_t rnti,
LteRrcSap::MeasResults measResults)
{
m_handoverAlgorithm->DoReportUeMeas (rnti, measResults);
}
///////////////////////////////////////////
// Bare Handover Algorithm
///////////////////////////////////////////
BareHandoverAlgorithm::BareHandoverAlgorithm ()
: m_handoverManagementSapUser (0)
{
m_handoverManagementSapProvider = new BareMemberHandoverManagementSapProvider (this);
}
BareHandoverAlgorithm::~BareHandoverAlgorithm ()
{
}
void
BareHandoverAlgorithm::DoDispose ()
{
delete m_handoverManagementSapProvider;
}
TypeId
BareHandoverAlgorithm::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::BareHandoverAlgorithm")
.SetParent<HandoverAlgorithm> ()
.AddConstructor<BareHandoverAlgorithm> ()
;
return tid;
}
void
BareHandoverAlgorithm::SetHandoverManagementSapUser (HandoverManagementSapUser* s)
{
m_handoverManagementSapUser = s;
}
HandoverManagementSapProvider*
BareHandoverAlgorithm::GetHandoverManagementSapProvider ()
{
return m_handoverManagementSapProvider;
}
void
BareHandoverAlgorithm::DoInitialize ()
{
HandoverAlgorithm::DoInitialize ();
}
void
BareHandoverAlgorithm::DoReportUeMeas (uint16_t rnti,
LteRrcSap::MeasResults measResults)
{
}
} // end of namespace ns3

View File

@@ -23,6 +23,7 @@
#define HANDOVER_ALGORITHM_H
#include <ns3/object.h>
#include <ns3/lte-rrc-sap.h>
namespace ns3 {
@@ -63,6 +64,44 @@ public:
}; // end of class HandoverAlgorithm
/**
* \brief A sample implementation of the Handover Management SAP which simply
* does nothing.
*/
class BareHandoverAlgorithm : public HandoverAlgorithm
{
public:
BareHandoverAlgorithm ();
virtual ~BareHandoverAlgorithm ();
// inherited from Object
virtual void DoDispose (void);
static TypeId GetTypeId (void);
// inherited from HandoverAlgorithm
virtual void SetHandoverManagementSapUser (HandoverManagementSapUser* s);
virtual HandoverManagementSapProvider* GetHandoverManagementSapProvider ();
friend class BareMemberHandoverManagementSapProvider;
protected:
// inherited from Object
virtual void DoInitialize ();
private:
// Handover Management SAP implementation
void DoReportUeMeas (uint16_t rnti, LteRrcSap::MeasResults measResults);
// Handover Management SAPs
HandoverManagementSapUser* m_handoverManagementSapUser;
HandoverManagementSapProvider* m_handoverManagementSapProvider;
}; // end of class BareHandoverAlgorithm
} // end of namespace ns3