From 7fa99399c8f81ca98df04f623507b97a4e604163 Mon Sep 17 00:00:00 2001 From: Budiarto Herman Date: Wed, 7 Aug 2013 15:34:24 +0300 Subject: [PATCH] BareHandoverAlgorithm for LTE to simulate absence of handover algorithm --- src/lte/helper/lte-helper.cc | 2 +- src/lte/model/a2-rsrq-handover-algorithm.cc | 3 +- src/lte/model/handover-algorithm.cc | 103 ++++++++++++++++++++ src/lte/model/handover-algorithm.h | 39 ++++++++ 4 files changed, 145 insertions(+), 2 deletions(-) diff --git a/src/lte/helper/lte-helper.cc b/src/lte/helper/lte-helper.cc index d08c3cc45..5feacdde0 100644 --- a/src/lte/helper/lte-helper.cc +++ b/src/lte/helper/lte-helper.cc @@ -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", diff --git a/src/lte/model/a2-rsrq-handover-algorithm.cc b/src/lte/model/a2-rsrq-handover-algorithm.cc index bb1aa2853..1e0a9ef75 100644 --- a/src/lte/model/a2-rsrq-handover-algorithm.cc +++ b/src/lte/model/a2-rsrq-handover-algorithm.cc @@ -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 { diff --git a/src/lte/model/handover-algorithm.cc b/src/lte/model/handover-algorithm.cc index 47c6f8c63..15c20e5e1 100644 --- a/src/lte/model/handover-algorithm.cc +++ b/src/lte/model/handover-algorithm.cc @@ -20,6 +20,7 @@ */ #include "handover-algorithm.h" +#include #include 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 () + .AddConstructor () + ; + 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 diff --git a/src/lte/model/handover-algorithm.h b/src/lte/model/handover-algorithm.h index 6263db2d5..8fd0655dd 100644 --- a/src/lte/model/handover-algorithm.h +++ b/src/lte/model/handover-algorithm.h @@ -23,6 +23,7 @@ #define HANDOVER_ALGORITHM_H #include +#include 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