src/lte/model/pf-ff-mac-scheduler.cc
author mmiozzo
Wed, 06 Apr 2011 14:41:21 +0200
changeset 7948 7a7b4ad007b0
parent 7947 4ed7cfac199d
child 7953 1db2126cb7c9
permissions -rw-r--r--
UL-CQI and AMC in RrFfMacScheduler
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     2
/*
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     3
 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     4
 *
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     8
 *
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    12
 * GNU General Public License for more details.
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    13
 *
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    17
 *
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    18
 * Author: Marco Miozzo <marco.miozzo@cttc.es>
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    19
 */
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    20
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    21
#include <ns3/log.h>
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    22
#include <ns3/pointer.h>
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    23
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    24
#include <ns3/simulator.h>
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    25
#include <ns3/lte-amc.h>
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    26
#include <ns3/pf-ff-mac-scheduler.h>
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    27
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    28
NS_LOG_COMPONENT_DEFINE ("PfFfMacScheduler");
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    29
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    30
namespace ns3 {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    31
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    32
int PfType0AllocationRbg[4] = {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    33
  10,       // RGB size 1
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    34
  26,       // RGB size 2
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    35
  63,       // RGB size 3
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    36
  110       // RGB size 4
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    37
};  // see table 7.1.6.1-1 of 36.213
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    38
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    39
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    40
NS_OBJECT_ENSURE_REGISTERED (PfFfMacScheduler);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    41
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    42
7936
2c531eab14f1 Move inline code in pf-ff-mac-schedluer to cc file
mmiozzo
parents: 7912
diff changeset
    43
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    44
class PfSchedulerMemberCschedSapProvider : public FfMacCschedSapProvider
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    45
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    46
public:
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    47
  PfSchedulerMemberCschedSapProvider (PfFfMacScheduler* scheduler);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    48
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    49
  // inherited from FfMacCschedSapProvider
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    50
  virtual void CschedCellConfigReq (const struct CschedCellConfigReqParameters& params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    51
  virtual void CschedUeConfigReq (const struct CschedUeConfigReqParameters& params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    52
  virtual void CschedLcConfigReq (const struct CschedLcConfigReqParameters& params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    53
  virtual void CschedLcReleaseReq (const struct CschedLcReleaseReqParameters& params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    54
  virtual void CschedUeReleaseReq (const struct CschedUeReleaseReqParameters& params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    55
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    56
private:
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    57
  PfSchedulerMemberCschedSapProvider ();
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    58
  PfFfMacScheduler* m_scheduler;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    59
};
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    60
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    61
PfSchedulerMemberCschedSapProvider::PfSchedulerMemberCschedSapProvider ()
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    62
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    63
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    64
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    65
PfSchedulerMemberCschedSapProvider::PfSchedulerMemberCschedSapProvider (PfFfMacScheduler* scheduler) : m_scheduler (scheduler)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    66
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    67
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    68
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    69
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    70
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    71
PfSchedulerMemberCschedSapProvider::CschedCellConfigReq (const struct CschedCellConfigReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    72
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    73
  m_scheduler->DoCschedCellConfigReq (params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    74
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    75
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    76
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    77
PfSchedulerMemberCschedSapProvider::CschedUeConfigReq (const struct CschedUeConfigReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    78
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    79
  m_scheduler->DoCschedUeConfigReq (params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    80
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    81
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    82
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    83
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    84
PfSchedulerMemberCschedSapProvider::CschedLcConfigReq (const struct CschedLcConfigReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    85
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    86
  m_scheduler->DoCschedLcConfigReq (params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    87
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    88
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    89
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    90
PfSchedulerMemberCschedSapProvider::CschedLcReleaseReq (const struct CschedLcReleaseReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    91
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    92
  m_scheduler->DoCschedLcReleaseReq (params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    93
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    94
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    95
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    96
PfSchedulerMemberCschedSapProvider::CschedUeReleaseReq (const struct CschedUeReleaseReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    97
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    98
  m_scheduler->DoCschedUeReleaseReq (params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    99
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   100
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   101
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   102
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   103
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   104
class PfSchedulerMemberSchedSapProvider : public FfMacSchedSapProvider
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   105
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   106
public:
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   107
  PfSchedulerMemberSchedSapProvider (PfFfMacScheduler* scheduler);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   108
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   109
  // inherited from FfMacSchedSapProvider
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   110
  virtual void SchedDlRlcBufferReq (const struct SchedDlRlcBufferReqParameters& params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   111
  virtual void SchedDlPagingBufferReq (const struct SchedDlPagingBufferReqParameters& params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   112
  virtual void SchedDlMacBufferReq (const struct SchedDlMacBufferReqParameters& params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   113
  virtual void SchedDlTriggerReq (const struct SchedDlTriggerReqParameters& params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   114
  virtual void SchedDlRachInfoReq (const struct SchedDlRachInfoReqParameters& params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   115
  virtual void SchedDlCqiInfoReq (const struct SchedDlCqiInfoReqParameters& params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   116
  virtual void SchedUlTriggerReq (const struct SchedUlTriggerReqParameters& params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   117
  virtual void SchedUlNoiseInterferenceReq (const struct SchedUlNoiseInterferenceReqParameters& params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   118
  virtual void SchedUlSrInfoReq (const struct SchedUlSrInfoReqParameters& params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   119
  virtual void SchedUlMacCtrlInfoReq (const struct SchedUlMacCtrlInfoReqParameters& params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   120
  virtual void SchedUlCqiInfoReq (const struct SchedUlCqiInfoReqParameters& params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   121
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   122
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   123
private:
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   124
  PfSchedulerMemberSchedSapProvider ();
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   125
  PfFfMacScheduler* m_scheduler;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   126
};
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   127
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   128
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   129
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   130
PfSchedulerMemberSchedSapProvider::PfSchedulerMemberSchedSapProvider ()
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   131
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   132
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   133
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   134
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   135
PfSchedulerMemberSchedSapProvider::PfSchedulerMemberSchedSapProvider (PfFfMacScheduler* scheduler)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   136
  : m_scheduler (scheduler)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   137
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   138
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   139
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   140
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   141
PfSchedulerMemberSchedSapProvider::SchedDlRlcBufferReq (const struct SchedDlRlcBufferReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   142
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   143
  m_scheduler->DoSchedDlRlcBufferReq (params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   144
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   145
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   146
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   147
PfSchedulerMemberSchedSapProvider::SchedDlPagingBufferReq (const struct SchedDlPagingBufferReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   148
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   149
  m_scheduler->DoSchedDlPagingBufferReq (params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   150
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   151
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   152
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   153
PfSchedulerMemberSchedSapProvider::SchedDlMacBufferReq (const struct SchedDlMacBufferReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   154
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   155
  m_scheduler->DoSchedDlMacBufferReq (params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   156
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   157
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   158
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   159
PfSchedulerMemberSchedSapProvider::SchedDlTriggerReq (const struct SchedDlTriggerReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   160
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   161
  m_scheduler->DoSchedDlTriggerReq (params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   162
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   163
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   164
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   165
PfSchedulerMemberSchedSapProvider::SchedDlRachInfoReq (const struct SchedDlRachInfoReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   166
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   167
  m_scheduler->DoSchedDlRachInfoReq (params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   168
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   169
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   170
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   171
PfSchedulerMemberSchedSapProvider::SchedDlCqiInfoReq (const struct SchedDlCqiInfoReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   172
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   173
  m_scheduler->DoSchedDlCqiInfoReq (params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   174
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   175
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   176
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   177
PfSchedulerMemberSchedSapProvider::SchedUlTriggerReq (const struct SchedUlTriggerReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   178
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   179
  m_scheduler->DoSchedUlTriggerReq (params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   180
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   181
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   182
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   183
PfSchedulerMemberSchedSapProvider::SchedUlNoiseInterferenceReq (const struct SchedUlNoiseInterferenceReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   184
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   185
  m_scheduler->DoSchedUlNoiseInterferenceReq (params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   186
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   187
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   188
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   189
PfSchedulerMemberSchedSapProvider::SchedUlSrInfoReq (const struct SchedUlSrInfoReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   190
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   191
  m_scheduler->DoSchedUlSrInfoReq (params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   192
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   193
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   194
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   195
PfSchedulerMemberSchedSapProvider::SchedUlMacCtrlInfoReq (const struct SchedUlMacCtrlInfoReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   196
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   197
  m_scheduler->DoSchedUlMacCtrlInfoReq (params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   198
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   199
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   200
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   201
PfSchedulerMemberSchedSapProvider::SchedUlCqiInfoReq (const struct SchedUlCqiInfoReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   202
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   203
  m_scheduler->DoSchedUlCqiInfoReq (params);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   204
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   205
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   206
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   207
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   208
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   209
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   210
PfFfMacScheduler::PfFfMacScheduler ()
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   211
  :   m_cschedSapUser (0),
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   212
    m_schedSapUser (0),
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   213
    m_timeWindow (0.5),
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   214
    m_schedTtiDelay (2) // WILD ACK: based on a m_macChTtiDelay = 1 
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   215
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   216
  m_cschedSapProvider = new PfSchedulerMemberCschedSapProvider (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   217
  m_schedSapProvider = new PfSchedulerMemberSchedSapProvider (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   218
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   219
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   220
PfFfMacScheduler::~PfFfMacScheduler ()
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   221
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   222
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   223
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   224
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   225
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   226
PfFfMacScheduler::DoDispose ()
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   227
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   228
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   229
  delete m_cschedSapProvider;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   230
  delete m_schedSapProvider;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   231
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   232
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   233
TypeId
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   234
PfFfMacScheduler::GetTypeId (void)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   235
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   236
  static TypeId tid = TypeId ("PfFfMacScheduler")
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   237
    .SetParent<FfMacScheduler> ()
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   238
    .AddConstructor<PfFfMacScheduler> ();
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   239
  return tid;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   240
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   241
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   242
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   243
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   244
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   245
PfFfMacScheduler::SetFfMacCschedSapUser (FfMacCschedSapUser* s)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   246
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   247
  m_cschedSapUser = s;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   248
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   249
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   250
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   251
PfFfMacScheduler::SetFfMacSchedSapUser (FfMacSchedSapUser* s)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   252
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   253
  m_schedSapUser = s;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   254
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   255
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   256
FfMacCschedSapProvider*
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   257
PfFfMacScheduler::GetFfMacCschedSapProvider ()
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   258
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   259
  return m_cschedSapProvider;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   260
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   261
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   262
FfMacSchedSapProvider*
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   263
PfFfMacScheduler::GetFfMacSchedSapProvider ()
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   264
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   265
  return m_schedSapProvider;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   266
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   267
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   268
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   269
PfFfMacScheduler::DoCschedCellConfigReq (const struct FfMacCschedSapProvider::CschedCellConfigReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   270
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   271
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   272
  // Read the subset of parameters used
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   273
  m_cschedCellConfig = params;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   274
  FfMacCschedSapUser::CschedUeConfigCnfParameters cnf;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   275
  cnf.m_result = SUCCESS;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   276
  m_cschedSapUser->CschedUeConfigCnf (cnf);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   277
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   278
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   279
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   280
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   281
PfFfMacScheduler::DoCschedUeConfigReq (const struct FfMacCschedSapProvider::CschedUeConfigReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   282
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   283
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   284
  // Not used at this stage
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   285
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   286
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   287
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   288
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   289
PfFfMacScheduler::DoCschedLcConfigReq (const struct FfMacCschedSapProvider::CschedLcConfigReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   290
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   291
  NS_LOG_FUNCTION (this << " New LC, rnti: "  << params.m_rnti);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   292
  
7940
50dd9246e780 refactoring lteFlowId_t struct
mrequena
parents: 7936
diff changeset
   293
  std::map <lteFlowId_t, pfsFlowPerf_t>::iterator it;
7909
82b1281ea0a3 Updates for MACOS compilation (virtual destructors and variable types)
mmiozzo
parents: 7899
diff changeset
   294
  for (uint16_t i = 0; i < params.m_logicalChannelConfigList.size (); i++)
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   295
    {
7940
50dd9246e780 refactoring lteFlowId_t struct
mrequena
parents: 7936
diff changeset
   296
      lteFlowId_t flow (params.m_rnti, params.m_logicalChannelConfigList.at (i).m_logicalChannelIdentity);
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   297
      
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   298
      it = m_flowStats.find (flow);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   299
      
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   300
      if (it == m_flowStats.end ())
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   301
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   302
          pfsFlowPerf_t flowStats;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   303
          flowStats.flowStart = Simulator::Now ();
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   304
          flowStats.totalBytesTransmitted = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   305
          flowStats.lastTtiBytesTrasmitted = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   306
          flowStats.lastAveragedThroughput = 0.0;
7912
a02ae1dc9fc0 fixed valgrind error in pf-ff-mac-scheduler
Nicola Baldo <nbaldo@cttc.es>
parents: 7909
diff changeset
   307
          flowStats.rlcBufferReq.m_rlcTransmissionQueueSize = 0;
a02ae1dc9fc0 fixed valgrind error in pf-ff-mac-scheduler
Nicola Baldo <nbaldo@cttc.es>
parents: 7909
diff changeset
   308
          flowStats.rlcBufferReq.m_rlcRetransmissionQueueSize = 0;
a02ae1dc9fc0 fixed valgrind error in pf-ff-mac-scheduler
Nicola Baldo <nbaldo@cttc.es>
parents: 7909
diff changeset
   309
          flowStats.rlcBufferReq.m_rlcStatusPduSize = 0;
7940
50dd9246e780 refactoring lteFlowId_t struct
mrequena
parents: 7936
diff changeset
   310
          m_flowStats.insert (std::pair<lteFlowId_t, pfsFlowPerf_t> (flow, flowStats));
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   311
        }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   312
      else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   313
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   314
          NS_LOG_ERROR ("LC already exists");
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   315
        }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   316
    }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   317
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   318
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   319
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   320
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   321
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   322
PfFfMacScheduler::DoCschedLcReleaseReq (const struct FfMacCschedSapProvider::CschedLcReleaseReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   323
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   324
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   325
  // TODO: Implementation of the API
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   326
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   327
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   328
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   329
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   330
PfFfMacScheduler::DoCschedUeReleaseReq (const struct FfMacCschedSapProvider::CschedUeReleaseReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   331
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   332
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   333
  // TODO: Implementation of the API
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   334
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   335
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   336
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   337
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   338
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   339
PfFfMacScheduler::DoSchedDlRlcBufferReq (const struct FfMacSchedSapProvider::SchedDlRlcBufferReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   340
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   341
  NS_LOG_FUNCTION (this << params.m_rnti << (uint32_t) params.m_logicalChannelIdentity);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   342
  // API generated by RLC for updating RLC parameters on a LC (tx and retx queues)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   343
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   344
  
7940
50dd9246e780 refactoring lteFlowId_t struct
mrequena
parents: 7936
diff changeset
   345
  std::map <lteFlowId_t, pfsFlowPerf_t>::iterator it;
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   346
  
7940
50dd9246e780 refactoring lteFlowId_t struct
mrequena
parents: 7936
diff changeset
   347
  lteFlowId_t flow (params.m_rnti, params.m_logicalChannelIdentity);
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   348
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   349
  it = m_flowStats.find (flow);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   350
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   351
  if (it == m_flowStats.end ())
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   352
    {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   353
      NS_LOG_ERROR (this << " RlcBufferReq from an unregistered LC");
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   354
    }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   355
  else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   356
    {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   357
      (*it).second.rlcBufferReq = params;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   358
    }  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   359
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   360
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   361
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   362
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   363
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   364
PfFfMacScheduler::DoSchedDlPagingBufferReq (const struct FfMacSchedSapProvider::SchedDlPagingBufferReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   365
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   366
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   367
  // TODO: Implementation of the API
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   368
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   369
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   370
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   371
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   372
PfFfMacScheduler::DoSchedDlMacBufferReq (const struct FfMacSchedSapProvider::SchedDlMacBufferReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   373
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   374
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   375
  // TODO: Implementation of the API
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   376
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   377
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   378
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   379
int
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   380
PfFfMacScheduler::GetRbgSize (int dlbandwidth)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   381
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   382
  for (int i = 0; i < 4; i++)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   383
    {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   384
      if (dlbandwidth < PfType0AllocationRbg[i])
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   385
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   386
          return (i + 1);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   387
        }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   388
    }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   389
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   390
  return (-1);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   391
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   392
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   393
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   394
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   395
PfFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::SchedDlTriggerReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   396
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   397
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   398
  // API generated by RLC for triggering the scheduling of a DL subframe
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   399
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   400
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   401
  // evaluate the relative channel quality indicator for each UE per each RBG 
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   402
  // (since we are using allocation type 0 the small unit of allocation is RBG)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   403
  // Resource allocation type 0 (see sec 7.1.6.1 of 36.213)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   404
  int rbgSize = GetRbgSize (m_cschedCellConfig.m_dlBandwidth);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   405
  int rbgNum = m_cschedCellConfig.m_dlBandwidth / rbgSize;
7940
50dd9246e780 refactoring lteFlowId_t struct
mrequena
parents: 7936
diff changeset
   406
  std::vector <lteFlowId_t> rbgAllocationMap;
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   407
  for (int i = 0; i < rbgNum; i++)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   408
    {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   409
      //NS_LOG_DEBUG (this << " ALLOCATION for RBG " << i << " of " << rbgNum);
7940
50dd9246e780 refactoring lteFlowId_t struct
mrequena
parents: 7936
diff changeset
   410
      std::map <lteFlowId_t, pfsFlowPerf_t>::iterator it;
50dd9246e780 refactoring lteFlowId_t struct
mrequena
parents: 7936
diff changeset
   411
      std::map <lteFlowId_t, pfsFlowPerf_t>::iterator itMax = m_flowStats.begin ();
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   412
      double rcqiMax = 0.0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   413
      for (it = m_flowStats.begin (); it != m_flowStats.end (); it++)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   414
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   415
          if ( ((*it).second.rlcBufferReq.m_rlcTransmissionQueueSize > 0)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   416
            || ((*it).second.rlcBufferReq.m_rlcRetransmissionQueueSize > 0)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   417
            || ((*it).second.rlcBufferReq.m_rlcStatusPduSize > 0) )
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   418
            {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   419
              // this UE-LC has data to transmit
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   420
              std::map <uint16_t,SbMeasResult_s>::iterator itCqi;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   421
              itCqi = m_a30CqiRxed.find ((*it).first.m_rnti);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   422
              //NS_LOG_DEBUG (this << " ue-lc " << (*it).first.m_rnti);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   423
              uint8_t cqi = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   424
              if (itCqi == m_a30CqiRxed.end ())
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   425
                {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   426
                  //NS_LOG_DEBUG (this << " No DL-CQI for this UE-LC " << (*it).first.m_rnti);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   427
                  cqi = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   428
                }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   429
              else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   430
                {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   431
                  cqi = (*itCqi).second.m_higherLayerSelected.at (i).m_sbCqi.at (0);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   432
                }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   433
              uint8_t mcs = LteAmc::GetMcsFromCqi (cqi);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   434
              //NS_LOG_DEBUG (this << " MCS " << (uint32_t)mcs);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   435
              double achievableRate = ((LteAmc::GetTbSizeFromMcs (mcs, 1) / 8)/0.001); // = TB size / TTI
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   436
              double rcqi = achievableRate / (*it).second.lastAveragedThroughput;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   437
              //NS_LOG_DEBUG (this << " achievaleRate " << achievableRate << " avg thr " << (*it).second.lastAveragedThroughput);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   438
              //NS_LOG_DEBUG (this << " RCQI " << rcqi);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   439
              
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   440
              if (rcqi > rcqiMax)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   441
                {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   442
                  rcqiMax = rcqi;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   443
                  itMax = it;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   444
                }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   445
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   446
            }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   447
        } // end for m_rlcBufferReq
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   448
      
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   449
      if (itMax == m_flowStats.end ())
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   450
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   451
          // no UE available for this RB
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   452
          //NS_LOG_DEBUG (this << " no UE found");
7940
50dd9246e780 refactoring lteFlowId_t struct
mrequena
parents: 7936
diff changeset
   453
          lteFlowId_t nullFlow;
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   454
          nullFlow.m_rnti = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   455
          rbgAllocationMap.push_back (nullFlow);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   456
        }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   457
      else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   458
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   459
          rbgAllocationMap.push_back ((*itMax).first);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   460
          //NS_LOG_DEBUG (this << " UE assigned " << (*itMax).first.m_rnti);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   461
        }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   462
    } // end for RBGs
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   463
    
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   464
    // generate the transmission opportunities by grouping the adjacent RBGs and
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   465
    // creating the correspondent DCIs
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   466
    FfMacSchedSapUser::SchedDlConfigIndParameters ret;
7940
50dd9246e780 refactoring lteFlowId_t struct
mrequena
parents: 7936
diff changeset
   467
    std::vector <lteFlowId_t>:: iterator flowIt = rbgAllocationMap.begin ();
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   468
    int rbgAllocated = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   469
    while (flowIt != rbgAllocationMap.end ())
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   470
      {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   471
        if ((*flowIt).m_rnti == 0)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   472
          {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   473
            // skip this RBG
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   474
            //NS_LOG_DEBUG (this << " RBG empty " << rbgAllocated);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   475
            rbgAllocated++;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   476
            flowIt++;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   477
            continue;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   478
          }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   479
        int lcRbgNum = 1;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   480
        while (((flowIt+1) != rbgAllocationMap.end ()) && ((*flowIt).m_rnti == (*(flowIt+1)).m_rnti))
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   481
          {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   482
            lcRbgNum++;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   483
            flowIt++;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   484
          }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   485
        //NS_LOG_DEBUG (this << " Tx Opp for user " << (*flowIt).m_rnti);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   486
        //NS_LOG_DEBUG (this << " Tx Opp from " << rbgAllocated << " to " << rbgAllocated + lcRbgNum);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   487
        // create new BuildDataListElement_s for this LC
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   488
        BuildDataListElement_s newEl;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   489
        newEl.m_rnti = (*flowIt).m_rnti;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   490
        // NS_LOG_DEBUG (this << "Allocate user " << newEl.m_rnti << " rbg " << rbgPerFlow);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   491
        // create the DlDciListElement_s
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   492
        DlDciListElement_s newDci;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   493
        newDci.m_rnti = (*flowIt).m_rnti;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   494
        newDci.m_resAlloc = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   495
        newDci.m_rbBitmap = 0; // TBD (32 bit bitmap see 7.1.6 of 36.213)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   496
        uint32_t rbgMask = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   497
        for (int i = 0; i < lcRbgNum; i++)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   498
          {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   499
            rbgMask = rbgMask + (0x1 << rbgAllocated);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   500
            // NS_LOG_DEBUG (this << " Allocated PRB " << rbgAllocated);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   501
            rbgAllocated++;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   502
          }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   503
        newDci.m_rbBitmap = rbgMask; // (32 bit bitmap see 7.1.6 of 36.213)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   504
        
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   505
        int nbOfTbsInNewDci = 1;  // SISO -> only one TB
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   506
        int rlcPduSize = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   507
        for (int i = 0; i < nbOfTbsInNewDci; i++)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   508
          {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   509
            std::map <uint16_t,SbMeasResult_s>::iterator itCqi;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   510
            itCqi = m_a30CqiRxed.find (newDci.m_rnti);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   511
            if (itCqi == m_a30CqiRxed.end ())
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   512
              {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   513
                newDci.m_mcs.push_back (1); // no info on this user -> lowest MCS
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   514
                //NS_LOG_DEBUG (this << " No DL-CQI for this allocated UE-LC");
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   515
              }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   516
            else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   517
              {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   518
                newDci.m_mcs.push_back ( LteAmc::GetMcsFromCqi ((*itCqi).second.m_higherLayerSelected.at (i).m_sbCqi.at (0)) );
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   519
                //NS_LOG_DEBUG (this << " MCS " << (uint32_t)newDci.m_mcs.at(0));
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   520
              }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   521
            int nPRB = rbgSize * lcRbgNum;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   522
            newDci.m_tbsSize.push_back ( (LteAmc::GetTbSizeFromMcs (newDci.m_mcs.at (i), nPRB) / 8) ); // (size of TB in bytes according to table 7.1.7.2.1-1 of 36.213)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   523
            newDci.m_ndi.push_back (1); // TBD (new data indicator)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   524
            newDci.m_rv.push_back (0); // TBD (redundancy version)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   525
            //NS_LOG_DEBUG (this << " nPRB " << nPRB << " tbSize " << newDci.m_tbsSize.at (0));
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   526
            
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   527
            rlcPduSize += newDci.m_tbsSize.at (i);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   528
          }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   529
        newEl.m_dci = newDci;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   530
        // ...more parameters -> ingored in this version
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   531
        
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   532
        RlcPduListElement_s newRlcEl;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   533
        newRlcEl.m_logicalChannelIdentity = (*flowIt).m_lcId;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   534
        // NS_LOG_DEBUG (this << "LCID " << (uint32_t) newRlcEl.m_logicalChannelIdentity);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   535
        newRlcEl.m_size = rlcPduSize; // TBD (max length of RLC-PDU in bytes)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   536
        
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   537
        std::vector <struct RlcPduListElement_s> newRlcPduLe;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   538
        newRlcPduLe.push_back (newRlcEl);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   539
        
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   540
        newEl.m_rlcPduList.push_back (newRlcPduLe);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   541
        ret.m_buildDataList.push_back (newEl);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   542
        
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   543
        // update UE-LC stats
7940
50dd9246e780 refactoring lteFlowId_t struct
mrequena
parents: 7936
diff changeset
   544
        std::map <lteFlowId_t, pfsFlowPerf_t>::iterator it;
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   545
        it = m_flowStats.find ((*flowIt));
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   546
        if (it != m_flowStats.end())
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   547
          {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   548
            (*it).second.lastTtiBytesTrasmitted += rlcPduSize;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   549
            //NS_LOG_DEBUG (this << " UE bytes txed " << (*it).second.lastTtiBytesTrasmitted);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   550
          }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   551
//         else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   552
//           {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   553
//             NS_LOG_DEBUG (this << " No Stats for this allocated UE-LC");
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   554
//           }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   555
        if (rbgAllocated == rbgNum)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   556
          {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   557
            break;                       // no more RGB to be allocated
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   558
          }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   559
          
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   560
        if ((flowIt+1) == rbgAllocationMap.end ())
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   561
          {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   562
            // no more flows to allocated
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   563
            break;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   564
          }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   565
        else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   566
          {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   567
            flowIt++;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   568
          }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   569
         
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   570
      } // end while allocation
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   571
      ret.m_nrOfPdcchOfdmSymbols = 1;   // TODO: check correct value according the DCIs txed
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   572
      
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   573
      // update the UE-LC stats
7940
50dd9246e780 refactoring lteFlowId_t struct
mrequena
parents: 7936
diff changeset
   574
      std::map <lteFlowId_t, pfsFlowPerf_t>::iterator it;
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   575
      for (it = m_flowStats.begin (); it != m_flowStats.end (); it++)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   576
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   577
          (*it).second.totalBytesTransmitted += (*it).second.lastTtiBytesTrasmitted;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   578
          // update average throughput (see eq. 12.3 of Sec 12.3.1.2 of LTE – The UMTS Long Term Evolution, Ed Wiley)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   579
          (*it).second.lastAveragedThroughput = ((1 - (1 / m_timeWindow)) * (*it).second.lastAveragedThroughput) + ((1 / m_timeWindow) * ((*it).second.lastTtiBytesTrasmitted / 0.001));
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   580
          (*it).second.lastTtiBytesTrasmitted = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   581
          //NS_LOG_DEBUG (this << " UE tot bytes " << (*it).second.totalBytesTransmitted);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   582
//           NS_LOG_DEBUG (this << " UE avg thr " << (*it).second.lastAveragedThroughput);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   583
        }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   584
      
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   585
      
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   586
  m_schedSapUser->SchedDlConfigInd (ret);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   587
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   588
 
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   589
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   590
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   591
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   592
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   593
PfFfMacScheduler::DoSchedDlRachInfoReq (const struct FfMacSchedSapProvider::SchedDlRachInfoReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   594
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   595
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   596
  // TODO: Implementation of the API
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   597
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   598
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   599
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   600
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   601
PfFfMacScheduler::DoSchedDlCqiInfoReq (const struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   602
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   603
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   604
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   605
  for (unsigned int i = 0; i < params.m_cqiList.size (); i++)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   606
    {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   607
      if ( params.m_cqiList.at (i).m_cqiType == CqiListElement_s::P10 )
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   608
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   609
          // wideband CQI reporting
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   610
          std::map <uint16_t,uint8_t>::iterator it;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   611
          uint16_t rnti = params.m_cqiList.at (i).m_rnti;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   612
          it = m_p10CqiRxed.find (rnti);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   613
          if (it == m_p10CqiRxed.end ())
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   614
            {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   615
              // create the new entry
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   616
              m_p10CqiRxed.insert ( std::pair<uint16_t, uint8_t > (rnti, params.m_cqiList.at (i).m_wbCqi.at (0)) ); // only codeword 0 at this stage (SISO)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   617
            }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   618
          else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   619
            {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   620
              // update the CQI value
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   621
              (*it).second = params.m_cqiList.at (i).m_wbCqi.at (0);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   622
            }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   623
        }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   624
      else if ( params.m_cqiList.at (i).m_cqiType == CqiListElement_s::A30 )
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   625
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   626
          // subband CQI reporting high layer configured
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   627
          std::map <uint16_t,SbMeasResult_s>::iterator it;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   628
          uint16_t rnti = params.m_cqiList.at (i).m_rnti;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   629
          it = m_a30CqiRxed.find (rnti);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   630
          if (it == m_a30CqiRxed.end ())
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   631
            {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   632
              // create the new entry
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   633
              m_a30CqiRxed.insert ( std::pair<uint16_t, SbMeasResult_s > (rnti, params.m_cqiList.at (i).m_sbMeasResult) );
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   634
            }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   635
          else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   636
            {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   637
              // update the CQI value
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   638
              (*it).second = params.m_cqiList.at (i).m_sbMeasResult;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   639
            }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   640
        }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   641
      else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   642
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   643
          NS_LOG_ERROR (this << " CQI type unknown");
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   644
        }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   645
    }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   646
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   647
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   648
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   649
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   650
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   651
PfFfMacScheduler::DoSchedUlTriggerReq (const struct FfMacSchedSapProvider::SchedUlTriggerReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   652
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   653
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   654
  // TODO: Implementation of the API
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   655
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   656
  std::map <uint16_t,uint8_t>::iterator it; 
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   657
  int nflows = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   658
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   659
  for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   660
    {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   661
      // remove old entries of this UE-LC
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   662
      if ((*it).second > 0)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   663
      {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   664
        nflows++;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   665
      }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   666
    }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   667
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   668
  if (nflows==0)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   669
  {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   670
    return ;  // no flows to be scheduled
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   671
  } 
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   672
   
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   673
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   674
  // Divide the resource equally among the active users
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   675
  int rbPerFlow = m_cschedCellConfig.m_ulBandwidth / nflows;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   676
  if (rbPerFlow == 0)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   677
  {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   678
    rbPerFlow = 1;                // at least 1 rbg per flow (till available resource)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   679
  }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   680
  int rbAllocated = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   681
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   682
  FfMacSchedSapUser::SchedUlConfigIndParameters ret;
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   683
  std::vector <uint16_t> rbgAllocationMap;
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   684
  for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   685
    {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   686
      if (rbAllocated + rbPerFlow > m_cschedCellConfig.m_ulBandwidth)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   687
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   688
          // limit to physical resources last resource assignment
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   689
          rbPerFlow = m_cschedCellConfig.m_ulBandwidth - rbAllocated;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   690
        }
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   691
       // store info on allocation for managing ul-cqi interpretation
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   692
      for (int i = 0; i < rbPerFlow; i++)
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   693
        {
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   694
        	rbgAllocationMap.push_back ((*it).first);
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   695
        }
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   696
      UlDciListElement_s uldci;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   697
      uldci.m_rnti = (*it).first;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   698
      uldci.m_rbStart = rbAllocated;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   699
      uldci.m_rbLen = rbPerFlow;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   700
      rbAllocated += rbPerFlow;
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   701
      std::map <uint16_t, std::vector <double> >::iterator itCqi = m_ueCqi.find ((*it).first);
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   702
      if (itCqi == m_ueCqi.end ())
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   703
        {
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   704
        	// no cqi info about this UE
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   705
          uldci.m_mcs = 0; // MCS 0 -> UL-AMC TBD
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   706
          //NS_LOG_DEBUG (this << " UE does not have ULCQI " << (*it).first );
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   707
        }
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   708
      else
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   709
        {
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   710
        	// take the lowest CQI value (worst RB)
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   711
        	double minSinr = (*itCqi).second.at(uldci.m_rbStart);
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   712
        	for (uint16_t i = uldci.m_rbStart; i < uldci.m_rbStart + uldci.m_rbLen; i++)
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   713
        	  {
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   714
        	  	//NS_LOG_DEBUG (this << " UE " << (*it).first << " has CQI " << (*itCqi).second.at(i));
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   715
        	  	if ((*itCqi).second.at(i) < minSinr)
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   716
        	  	  {
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   717
        	  	  	minSinr = (*itCqi).second.at(i);
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   718
        	  	  }
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   719
        	  }
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   720
        	 
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   721
        	// translate SINR -> cqi: WILD ACK: same as DL
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   722
        	double s = log2 ( 1 + (
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   723
                          pow (10, minSinr / 10 )  /
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   724
                          ( (-log (5.0 * 0.00005 )) / 1.5) ));
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   725
          int cqi = LteAmc::GetCqiFromSpectralEfficiency (s);
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   726
          uldci.m_mcs = LteAmc::GetMcsFromCqi (cqi);
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   727
          //NS_LOG_DEBUG (this << " UE " <<  (*it).first << " minsinr " << minSinr << " -> mcs " << (uint16_t)uldci.m_mcs);
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   728
        	
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   729
        }
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   730
      uldci.m_tbSize = (LteAmc::GetTbSizeFromMcs (uldci.m_mcs, rbPerFlow) / 8);
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   731
      uldci.m_ndi = 1;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   732
      uldci.m_cceIndex = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   733
      uldci.m_aggrLevel = 1;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   734
      uldci.m_ueTxAntennaSelection = 3; // antenna selection OFF
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   735
      uldci.m_hopping = false;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   736
      uldci.m_n2Dmrs = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   737
      uldci.m_tpc = 0; // no power control
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   738
      uldci.m_cqiRequest = false; // only period CQI at this stage
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   739
      uldci.m_ulIndex = 0; // TDD parameter
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   740
      uldci.m_dai = 1; // TDD parameter
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   741
      uldci.m_freqHopping = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   742
      uldci.m_pdcchPowerOffset = 0; // not used
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   743
      ret.m_dciList.push_back (uldci);      
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   744
    }
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   745
  m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params.m_sfnSf, rbgAllocationMap));
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   746
  m_schedSapUser->SchedUlConfigInd (ret);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   747
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   748
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   749
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   750
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   751
PfFfMacScheduler::DoSchedUlNoiseInterferenceReq (const struct FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   752
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   753
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   754
  // TODO: Implementation of the API
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   755
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   756
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   757
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   758
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   759
PfFfMacScheduler::DoSchedUlSrInfoReq (const struct FfMacSchedSapProvider::SchedUlSrInfoReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   760
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   761
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   762
  // TODO: Implementation of the API
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   763
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   764
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   765
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   766
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   767
PfFfMacScheduler::DoSchedUlMacCtrlInfoReq (const struct FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   768
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   769
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   770
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   771
  std::map <uint16_t,uint8_t>::iterator it;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   772
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   773
  for (unsigned int i = 0; i < params.m_macCeList.size (); i++)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   774
  {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   775
    if ( params.m_macCeList.at (i).m_macCeType == MacCeListElement_s::BSR )
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   776
    {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   777
      // buffer status report
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   778
      uint16_t rnti = params.m_macCeList.at (i).m_rnti;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   779
      it = m_ceBsrRxed.find(rnti);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   780
      if (it==m_ceBsrRxed.end())
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   781
      {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   782
        // create the new entry
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   783
        uint8_t bsr = params.m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (0);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   784
        m_ceBsrRxed.insert( std::pair<uint16_t, uint8_t > (rnti, bsr)); // only 1 buffer status is working now
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   785
      }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   786
      else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   787
      {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   788
        // update the CQI value
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   789
        (*it).second = params.m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (0);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   790
      }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   791
    }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   792
  }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   793
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   794
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   795
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   796
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   797
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   798
PfFfMacScheduler::DoSchedUlCqiInfoReq (const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   799
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   800
  NS_LOG_FUNCTION (this);
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   801
  //NS_LOG_DEBUG (this << " RX UL CQI at " << params.m_sfnSf);
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   802
  // correlate info on UL-CQIs with previous scheduling -> calculate m_sfnSf of transmission
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   803
  uint32_t frameNo = (0xFF & params.m_sfnSf) >> 4;
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   804
  uint32_t subframeNo = (0xF & params.m_sfnSf);
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   805
  //NS_LOG_DEBUG (this << " sfn " << frameNo << " sbfn " << subframeNo);
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   806
  if (subframeNo - m_schedTtiDelay < 0)
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   807
  {
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   808
  	frameNo--;
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   809
  }
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   810
  subframeNo = (subframeNo - m_schedTtiDelay) % 10;
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   811
  //NS_LOG_DEBUG (this << " Actual sfn " << frameNo << " sbfn " << subframeNo);
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   812
  uint16_t sfnSf = ((0xFF & frameNo) << 4) | (0xF & subframeNo);
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   813
  // retrieve the allocation for this subframe
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   814
  std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   815
  std::map <uint16_t, std::vector <double> >::iterator itCqi;
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   816
  itMap = m_allocationMaps.find (sfnSf);
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   817
  if (itMap == m_allocationMaps.end())
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   818
  {
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   819
  	NS_LOG_DEBUG (this << " Does not find info on allocation");
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   820
  	return;
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   821
  }
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   822
  for (uint32_t i = 0; i < (*itMap).second.size (); i++)
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   823
    {
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   824
  	  // convert from fixed point notation Sxxxxxxxxxxx.xxx to double    	
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   825
    	double sinr = LteFfConverter::fpS11dot3toDouble (params.m_ulCqi.m_sinr.at (i));
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   826
  	  //NS_LOG_DEBUG (this << " UE " << (*itMap).second.at (i) << " SINRfp " << params.m_ulCqi.m_sinr.at (i) << " sinrdb " << sinr);
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   827
  	  itCqi = m_ueCqi.find ((*itMap).second.at (i));
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   828
  	  if (itCqi == m_ueCqi.end ())
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   829
  	    {
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   830
  	    	// create a new entry
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   831
  	    	std::vector <double> newCqi;
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   832
  	    	for (uint32_t j = 0; j < m_cschedCellConfig.m_ulBandwidth; j++)
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   833
  	    	  {
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   834
  	    	  	if (i==j)
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   835
		 	    	  	{
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   836
		 	    	  		newCqi.push_back (sinr);
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   837
		 	    	  	}
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   838
  	    	  	else
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   839
  	    	  	  {
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   840
  	    	  	  	// initialize with minumum values according to the fixed point notation
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   841
  	    	  	  	newCqi.push_back (LteFfConverter::getMinFpS11dot3Value ());
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   842
  	    	  	  }
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   843
  	    	  	
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   844
  	    	  }
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   845
  	    	m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > ((*itMap).second.at (i), newCqi));
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   846
  	    }
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   847
  	  else
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   848
  	    {
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   849
  	      // update the value
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   850
  	      (*itCqi).second.at (i) = sinr;
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   851
  	    }
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   852
  	  
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   853
  	}
7948
7a7b4ad007b0 UL-CQI and AMC in RrFfMacScheduler
mmiozzo
parents: 7947
diff changeset
   854
  // remove obsolete info on allocation
7a7b4ad007b0 UL-CQI and AMC in RrFfMacScheduler
mmiozzo
parents: 7947
diff changeset
   855
  m_allocationMaps.erase (m_allocationMaps.begin (), ++itMap);
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   856
   
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   857
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   858
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   859
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   860
}