add missed file of pf-ff-mac-scheduler

This commit is contained in:
Marco Miozzo
2011-03-18 08:48:49 +01:00
parent df815155f5
commit 7568d1a032

View File

@@ -0,0 +1,185 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
*
* 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: Marco Miozzo <marco.miozzo@cttc.es>
*/
#ifndef PF_FF_MAC_SCHEDULER_H
#define PF_FF_MAC_SCHEDULER_H
#include <ns3/ff-mac-csched-sap.h>
#include <ns3/ff-mac-sched-sap.h>
#include <ns3/ff-mac-scheduler.h>
#include <vector>
#include <map>
#include <ns3/nstime.h>
namespace ns3 {
struct pfsFlowId_t
{
uint16_t m_rnti;
uint8_t m_lcId;
bool operator<(const pfsFlowId_t& A) const
{ return m_rnti<A.m_rnti; }
};
struct pfsFlowPerf_t
{
Time flowStart;
unsigned long totalBytesTransmitted;
unsigned int lastTtiBytesTrasmitted;
double lastAveragedThroughput;
FfMacSchedSapProvider::SchedDlRlcBufferReqParameters rlcBufferReq;
};
/**
* \ingroup ff-api
* \defgroup FF-API PfFfMacScheduler
*/
/**
* \ingroup PfFfMacScheduler
* \brief Implements the SCHED SAP and CSCHED SAP for a Proportional Fair scheduler
*
* This class implements the interface defined by the FfMacScheduler abstract class
*/
class PfFfMacScheduler : public FfMacScheduler
{
public:
/**
* \brief Constructor
*
* Creates the MAC Scheduler interface implementation
*/
PfFfMacScheduler ();
/**
* Destructor
*/
virtual ~PfFfMacScheduler ();
// inherited from Object
virtual void DoDispose (void);
static TypeId GetTypeId (void);
// inherited from FfMacScheduler
virtual void SetFfMacCschedSapUser (FfMacCschedSapUser* s);
virtual void SetFfMacSchedSapUser (FfMacSchedSapUser* s);
virtual FfMacCschedSapProvider* GetFfMacCschedSapProvider ();
virtual FfMacSchedSapProvider* GetFfMacSchedSapProvider ();
friend class PfSchedulerMemberCschedSapProvider;
friend class PfSchedulerMemberSchedSapProvider;
private:
//
// Implementation of the CSCHED API primitives
// (See 4.1 for description of the primitives)
//
void DoCschedCellConfigReq (const struct FfMacCschedSapProvider::CschedCellConfigReqParameters& params);
void DoCschedUeConfigReq (const struct FfMacCschedSapProvider::CschedUeConfigReqParameters& params);
void DoCschedLcConfigReq (const struct FfMacCschedSapProvider::CschedLcConfigReqParameters& params);
void DoCschedLcReleaseReq (const struct FfMacCschedSapProvider::CschedLcReleaseReqParameters& params);
void DoCschedUeReleaseReq (const struct FfMacCschedSapProvider::CschedUeReleaseReqParameters& params);
//
// Implementation of the SCHED API primitives
// (See 4.2 for description of the primitives)
//
void DoSchedDlRlcBufferReq (const struct FfMacSchedSapProvider::SchedDlRlcBufferReqParameters& params);
void DoSchedDlPagingBufferReq (const struct FfMacSchedSapProvider::SchedDlPagingBufferReqParameters& params);
void DoSchedDlMacBufferReq (const struct FfMacSchedSapProvider::SchedDlMacBufferReqParameters& params);
void DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::SchedDlTriggerReqParameters& params);
void DoSchedDlRachInfoReq (const struct FfMacSchedSapProvider::SchedDlRachInfoReqParameters& params);
void DoSchedDlCqiInfoReq (const struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters& params);
void DoSchedUlTriggerReq (const struct FfMacSchedSapProvider::SchedUlTriggerReqParameters& params);
void DoSchedUlNoiseInterferenceReq (const struct FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters& params);
void DoSchedUlSrInfoReq (const struct FfMacSchedSapProvider::SchedUlSrInfoReqParameters& params);
void DoSchedUlMacCtrlInfoReq (const struct FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters& params);
void DoSchedUlCqiInfoReq (const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters& params);
int GetRbgSize (int dlbandwidth);
/*
* Vectors of UE's RLC info
*/
//std::vector <FfMacSchedSapProvider::SchedDlRlcBufferReqParameters> m_rlcBufferReq;
/*
* Map of UE-LC statistics
*/
std::map <pfsFlowId_t, pfsFlowPerf_t> m_flowStats;
/*
* Map of UE's DL CQI P01 received
*/
std::map <uint16_t,uint8_t> m_p10CqiRxed;
/*
* Map of UE's DL CQI A30 received
*/
std::map <uint16_t,SbMeasResult_s> m_a30CqiRxed;
/*
* Map of UE's buffer status reports received
*/
std::map <uint16_t,uint8_t> m_ceBsrRxed;
// MAC SAPs
FfMacCschedSapUser* m_cschedSapUser;
FfMacSchedSapUser* m_schedSapUser;
FfMacCschedSapProvider* m_cschedSapProvider;
FfMacSchedSapProvider* m_schedSapProvider;
// Internal parameters
FfMacCschedSapProvider::CschedCellConfigReqParameters m_cschedCellConfig;
double m_timeWindow;
};
} // namespace ns3
#endif /* PF_FF_MAC_SCHEDULER_H */