Renamed BareHandoverAlgorithm to NoOpHandoverAlgorithm

This commit is contained in:
Budiarto Herman
2013-08-12 19:01:47 +03:00
parent d90a395329
commit 2df5bc99df
6 changed files with 175 additions and 114 deletions

View File

@@ -151,7 +151,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::BareHandoverAlgorithm"),
StringValue ("ns3::NoOpHandoverAlgorithm"),
MakeStringAccessor (&LteHelper::SetHandoverAlgorithmType),
MakeStringChecker ())
.AddAttribute ("PathlossModel",
@@ -783,8 +783,8 @@ DrbActivator::ActivateDrb (uint64_t imsi, uint16_t cellId, uint16_t rnti)
if ((!m_active) && (imsi == m_imsi))
{
Ptr<LteUeRrc> ueRrc = m_ueDevice->GetObject<LteUeNetDevice> ()->GetRrc ();
NS_ASSERT (ueRrc->GetState () == LteUeRrc::CONNECTED_NORMALLY);
uint16_t rnti = ueRrc->GetRnti();
NS_ASSERT (ueRrc->GetState () == LteUeRrc::CONNECTED_NORMALLY);
uint16_t rnti = ueRrc->GetRnti ();
Ptr<LteEnbNetDevice> enbLteDevice = m_ueDevice->GetObject<LteUeNetDevice> ()->GetTargetEnb ();
Ptr<LteEnbRrc> enbRrc = enbLteDevice->GetObject<LteEnbNetDevice> ()->GetRrc ();
NS_ASSERT (ueRrc->GetCellId () == enbLteDevice->GetCellId ());
@@ -800,14 +800,14 @@ DrbActivator::ActivateDrb (uint64_t imsi, uint16_t cellId, uint16_t rnti)
m_active = true;
}
}
void
LteHelper::ActivateDataRadioBearer (Ptr<NetDevice> ueDevice, EpsBearer bearer)
{
NS_LOG_FUNCTION (this << ueDevice);
NS_ASSERT_MSG (m_epcHelper == 0, "this method must not be used when EPC is being used");
NS_ASSERT_MSG (m_epcHelper == 0, "this method must not be used when EPC is being used");
// Normally it is the EPC that takes care of activating DRBs
// when the UE gets connected. When the EPC is not used, we achieve
// the same behavior by hooking a dedicated DRB activation function
@@ -819,7 +819,7 @@ LteHelper::ActivateDataRadioBearer (Ptr<NetDevice> ueDevice, EpsBearer bearer)
std::ostringstream path;
path << "/NodeList/" << enbLteDevice->GetNode ()->GetId ()
<< "/DeviceList/" << enbLteDevice->GetIfIndex ()
<< "/LteEnbRrc/ConnectionEstablished";
<< "/LteEnbRrc/ConnectionEstablished";
Ptr<DrbActivator> arg = Create<DrbActivator> (ueDevice, bearer);
Config::Connect (path.str (), MakeBoundCallback (&DrbActivator::ActivateCallback, arg));
}

View File

@@ -20,7 +20,6 @@
*/
#include "lte-handover-algorithm.h"
#include <ns3/lte-handover-management-sap.h>
#include <ns3/log.h>
NS_LOG_COMPONENT_DEFINE ("LteHandoverAlgorithm");
@@ -56,71 +55,4 @@ LteHandoverAlgorithm::GetTypeId (void)
}
///////////////////////////////////////////
// Bare Handover Algorithm
///////////////////////////////////////////
NS_OBJECT_ENSURE_REGISTERED (BareHandoverAlgorithm);
BareHandoverAlgorithm::BareHandoverAlgorithm ()
: m_handoverManagementSapUser (0)
{
m_handoverManagementSapProvider = new MemberLteHandoverManagementSapProvider<BareHandoverAlgorithm> (this);
}
BareHandoverAlgorithm::~BareHandoverAlgorithm ()
{
}
void
BareHandoverAlgorithm::DoDispose ()
{
delete m_handoverManagementSapProvider;
}
TypeId
BareHandoverAlgorithm::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::BareHandoverAlgorithm")
.SetParent<LteHandoverAlgorithm> ()
.AddConstructor<BareHandoverAlgorithm> ()
;
return tid;
}
void
BareHandoverAlgorithm::SetLteHandoverManagementSapUser (LteHandoverManagementSapUser* s)
{
m_handoverManagementSapUser = s;
}
LteHandoverManagementSapProvider*
BareHandoverAlgorithm::GetLteHandoverManagementSapProvider ()
{
return m_handoverManagementSapProvider;
}
void
BareHandoverAlgorithm::DoInitialize ()
{
LteHandoverAlgorithm::DoInitialize ();
}
void
BareHandoverAlgorithm::DoReportUeMeas (uint16_t rnti,
LteRrcSap::MeasResults measResults)
{
}
} // end of namespace ns3

View File

@@ -24,10 +24,14 @@
#include <ns3/object.h>
#include <ns3/lte-rrc-sap.h>
#include <ns3/lte-handover-management-sap.h>
namespace ns3 {
class LteHandoverManagementSapUser;
class LteHandoverManagementSapProvider;
/**
* \brief This abstract base class identifies the interface by means of which
* the helper object can plug on the eNodeB RRC a handover algorithm
@@ -61,44 +65,6 @@ public:
}; // end of class LteHandoverAlgorithm
/**
* \brief A sample implementation of the Handover Management SAP which simply
* does nothing.
*/
class BareHandoverAlgorithm : public LteHandoverAlgorithm
{
public:
BareHandoverAlgorithm ();
virtual ~BareHandoverAlgorithm ();
// inherited from Object
virtual void DoDispose (void);
static TypeId GetTypeId (void);
// inherited from LteHandoverAlgorithm
virtual void SetLteHandoverManagementSapUser (LteHandoverManagementSapUser* s);
virtual LteHandoverManagementSapProvider* GetLteHandoverManagementSapProvider ();
friend class MemberLteHandoverManagementSapProvider<BareHandoverAlgorithm>;
protected:
// inherited from Object
virtual void DoInitialize ();
private:
// Handover Management SAP implementation
void DoReportUeMeas (uint16_t rnti, LteRrcSap::MeasResults measResults);
// Handover Management SAPs
LteHandoverManagementSapUser* m_handoverManagementSapUser;
LteHandoverManagementSapProvider* m_handoverManagementSapProvider;
}; // end of class BareHandoverAlgorithm
} // end of namespace ns3

View File

@@ -0,0 +1,90 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2013 University of Jyvaskyla
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Budiarto Herman <buherman@student.jyu.fi>
*
*/
#include "no-op-handover-algorithm.h"
#include <ns3/log.h>
NS_LOG_COMPONENT_DEFINE ("NoOpHandoverAlgorithm");
namespace ns3 {
NS_OBJECT_ENSURE_REGISTERED (NoOpHandoverAlgorithm);
NoOpHandoverAlgorithm::NoOpHandoverAlgorithm ()
: m_handoverManagementSapUser (0)
{
m_handoverManagementSapProvider = new MemberLteHandoverManagementSapProvider<NoOpHandoverAlgorithm> (this);
}
NoOpHandoverAlgorithm::~NoOpHandoverAlgorithm ()
{
}
void
NoOpHandoverAlgorithm::DoDispose ()
{
delete m_handoverManagementSapProvider;
}
TypeId
NoOpHandoverAlgorithm::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::NoOpHandoverAlgorithm")
.SetParent<LteHandoverAlgorithm> ()
.AddConstructor<NoOpHandoverAlgorithm> ()
;
return tid;
}
void
NoOpHandoverAlgorithm::SetLteHandoverManagementSapUser (LteHandoverManagementSapUser* s)
{
m_handoverManagementSapUser = s;
}
LteHandoverManagementSapProvider*
NoOpHandoverAlgorithm::GetLteHandoverManagementSapProvider ()
{
return m_handoverManagementSapProvider;
}
void
NoOpHandoverAlgorithm::DoInitialize ()
{
LteHandoverAlgorithm::DoInitialize ();
}
void
NoOpHandoverAlgorithm::DoReportUeMeas (uint16_t rnti,
LteRrcSap::MeasResults measResults)
{
}
} // end of namespace ns3

View File

@@ -0,0 +1,71 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2013 University of Jyvaskyla
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Budiarto Herman <buherman@student.jyu.fi>
*
*/
#ifndef NO_OP_HANDOVER_ALGORITHM_H
#define NO_OP_HANDOVER_ALGORITHM_H
#include <ns3/lte-handover-algorithm.h>
#include <ns3/lte-handover-management-sap.h>
#include <ns3/lte-rrc-sap.h>
namespace ns3 {
/**
* \brief A sample implementation of the Handover Management SAP which simply
* does nothing.
*/
class NoOpHandoverAlgorithm : public LteHandoverAlgorithm
{
public:
NoOpHandoverAlgorithm ();
virtual ~NoOpHandoverAlgorithm ();
// inherited from Object
virtual void DoDispose (void);
static TypeId GetTypeId (void);
// inherited from LteHandoverAlgorithm
virtual void SetLteHandoverManagementSapUser (LteHandoverManagementSapUser* s);
virtual LteHandoverManagementSapProvider* GetLteHandoverManagementSapProvider ();
friend class MemberLteHandoverManagementSapProvider<NoOpHandoverAlgorithm>;
protected:
// inherited from Object
virtual void DoInitialize ();
private:
// Handover Management SAP implementation
void DoReportUeMeas (uint16_t rnti, LteRrcSap::MeasResults measResults);
// Handover Management SAPs
LteHandoverManagementSapUser* m_handoverManagementSapUser;
LteHandoverManagementSapProvider* m_handoverManagementSapProvider;
}; // end of class NoOpHandoverAlgorithm
} // end of namespace ns3
#endif /* NO_OP_HANDOVER_ALGORITHM_H */

View File

@@ -101,6 +101,7 @@ def build(bld):
'model/lte-handover-management-sap.cc',
'model/lte-handover-algorithm.cc',
'model/a2-rsrq-handover-algorithm.cc',
'model/no-op-handover-algorithm.cc',
'model/lte-anr-sap.cc',
'model/lte-anr.cc',
]
@@ -251,6 +252,7 @@ def build(bld):
'model/lte-handover-management-sap.h',
'model/lte-handover-algorithm.h',
'model/a2-rsrq-handover-algorithm.h',
'model/no-op-handover-algorithm.h',
'model/lte-anr-sap.h',
'model/lte-anr.h',
]