src/lte/model/pf-ff-mac-scheduler.cc
author Nicola Baldo <nbaldo@cttc.es>
Mon, 18 Apr 2011 17:35:49 +0200
changeset 7971 3cc205853837
parent 7968 3beb480fee94
child 7974 418af6390cd8
permissions -rw-r--r--
lteFlowId_t --> LteFlowId_t
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
  
7971
3cc205853837 lteFlowId_t --> LteFlowId_t
Nicola Baldo <nbaldo@cttc.es>
parents: 7968
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
    {
7971
3cc205853837 lteFlowId_t --> LteFlowId_t
Nicola Baldo <nbaldo@cttc.es>
parents: 7968
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;
7968
3beb480fee94 LENA-77 PfFfMacScheduler::lastAveragedThroughput initialization
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7966
diff changeset
   306
          if (params.m_logicalChannelConfigList.at (i).m_eRabGuaranteedBitrateDl != 0)
3beb480fee94 LENA-77 PfFfMacScheduler::lastAveragedThroughput initialization
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7966
diff changeset
   307
            {
3beb480fee94 LENA-77 PfFfMacScheduler::lastAveragedThroughput initialization
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7966
diff changeset
   308
              flowStats.lastAveragedThroughput = params.m_logicalChannelConfigList.at (i).m_eRabGuaranteedBitrateDl;
3beb480fee94 LENA-77 PfFfMacScheduler::lastAveragedThroughput initialization
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7966
diff changeset
   309
            }
3beb480fee94 LENA-77 PfFfMacScheduler::lastAveragedThroughput initialization
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7966
diff changeset
   310
          else
3beb480fee94 LENA-77 PfFfMacScheduler::lastAveragedThroughput initialization
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7966
diff changeset
   311
            {
3beb480fee94 LENA-77 PfFfMacScheduler::lastAveragedThroughput initialization
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7966
diff changeset
   312
              flowStats.lastAveragedThroughput = 1; // minimum bitrate -> high priority to new flows
3beb480fee94 LENA-77 PfFfMacScheduler::lastAveragedThroughput initialization
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7966
diff changeset
   313
            }
7912
a02ae1dc9fc0 fixed valgrind error in pf-ff-mac-scheduler
Nicola Baldo <nbaldo@cttc.es>
parents: 7909
diff changeset
   314
          flowStats.rlcBufferReq.m_rlcTransmissionQueueSize = 0;
a02ae1dc9fc0 fixed valgrind error in pf-ff-mac-scheduler
Nicola Baldo <nbaldo@cttc.es>
parents: 7909
diff changeset
   315
          flowStats.rlcBufferReq.m_rlcRetransmissionQueueSize = 0;
a02ae1dc9fc0 fixed valgrind error in pf-ff-mac-scheduler
Nicola Baldo <nbaldo@cttc.es>
parents: 7909
diff changeset
   316
          flowStats.rlcBufferReq.m_rlcStatusPduSize = 0;
7971
3cc205853837 lteFlowId_t --> LteFlowId_t
Nicola Baldo <nbaldo@cttc.es>
parents: 7968
diff changeset
   317
          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
   318
        }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   319
      else
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
          NS_LOG_ERROR ("LC already exists");
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   322
        }
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
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   325
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   326
}
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
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   329
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
   330
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   331
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   332
  // TODO: Implementation of the API
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   333
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   334
}
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
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   337
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
   338
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   339
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   340
  // TODO: Implementation of the API
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   341
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   342
}
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
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   345
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   346
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
   347
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   348
  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
   349
  // 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
   350
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   351
  
7971
3cc205853837 lteFlowId_t --> LteFlowId_t
Nicola Baldo <nbaldo@cttc.es>
parents: 7968
diff changeset
   352
  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
   353
  
7971
3cc205853837 lteFlowId_t --> LteFlowId_t
Nicola Baldo <nbaldo@cttc.es>
parents: 7968
diff changeset
   354
  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
   355
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   356
  it = m_flowStats.find (flow);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   357
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   358
  if (it == m_flowStats.end ())
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
      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
   361
    }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   362
  else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   363
    {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   364
      (*it).second.rlcBufferReq = 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
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   367
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   368
}
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
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   371
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
   372
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   373
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   374
  // TODO: Implementation of the API
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   375
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   376
}
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
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   379
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
   380
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   381
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   382
  // TODO: Implementation of the API
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   383
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   384
}
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
int
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   387
PfFfMacScheduler::GetRbgSize (int dlbandwidth)
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
  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
   390
    {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   391
      if (dlbandwidth < PfType0AllocationRbg[i])
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
          return (i + 1);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   394
        }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   395
    }
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
  return (-1);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   398
}
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
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   402
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
   403
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   404
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   405
  // 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
   406
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   407
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   408
  // 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
   409
  // (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
   410
  // 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
   411
  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
   412
  int rbgNum = m_cschedCellConfig.m_dlBandwidth / rbgSize;
7971
3cc205853837 lteFlowId_t --> LteFlowId_t
Nicola Baldo <nbaldo@cttc.es>
parents: 7968
diff changeset
   413
  std::vector <LteFlowId_t> rbgAllocationMap;
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   414
  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
   415
    {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   416
      //NS_LOG_DEBUG (this << " ALLOCATION for RBG " << i << " of " << rbgNum);
7971
3cc205853837 lteFlowId_t --> LteFlowId_t
Nicola Baldo <nbaldo@cttc.es>
parents: 7968
diff changeset
   417
      std::map <LteFlowId_t, pfsFlowPerf_t>::iterator it;
3cc205853837 lteFlowId_t --> LteFlowId_t
Nicola Baldo <nbaldo@cttc.es>
parents: 7968
diff changeset
   418
      std::map <LteFlowId_t, pfsFlowPerf_t>::iterator itMax = m_flowStats.end ();
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   419
      double rcqiMax = 0.0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   420
      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
   421
        {
7966
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   422
          std::map <uint16_t,SbMeasResult_s>::iterator itCqi;
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   423
          itCqi = m_a30CqiRxed.find ((*it).first.m_rnti);
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   424
          uint8_t cqi = 0;
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   425
          if (itCqi == m_a30CqiRxed.end ())
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   426
            {
7966
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   427
              //NS_LOG_DEBUG (this << " No DL-CQI for this UE-LC " << (*it).first.m_rnti);
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   428
              cqi = 1;  // start with lowest value
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   429
            }
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   430
          else
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   431
            {
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   432
              cqi = (*itCqi).second.m_higherLayerSelected.at (i).m_sbCqi.at (0);
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   433
            }
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   434
          if (cqi > 0)  // CQI == 0 means "out of range" (see table 7.2.3-1 of 36.213)
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   435
            {
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   436
              if ( ((*it).second.rlcBufferReq.m_rlcTransmissionQueueSize > 0)
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   437
                || ((*it).second.rlcBufferReq.m_rlcRetransmissionQueueSize > 0)
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   438
                || ((*it).second.rlcBufferReq.m_rlcStatusPduSize > 0) )
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   439
                {
7966
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   440
                  // this UE-LC has data to transmit
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   441
                  //NS_LOG_DEBUG (this << " ue-lc " << (*it).first.m_rnti);
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   442
                  uint8_t mcs = LteAmc::GetMcsFromCqi (cqi);
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   443
                  //NS_LOG_DEBUG (this << " MCS " << (uint32_t)mcs);
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   444
                  double achievableRate = ((LteAmc::GetTbSizeFromMcs (mcs, 1) / 8)/0.001); // = TB size / TTI
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   445
                  double rcqi = achievableRate / (*it).second.lastAveragedThroughput;
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   446
                  //NS_LOG_DEBUG (this << " achievaleRate " << achievableRate << " avg thr " << (*it).second.lastAveragedThroughput);
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   447
                  //NS_LOG_DEBUG (this << " RCQI " << rcqi);
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   448
                  
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   449
                  if (rcqi > rcqiMax)
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   450
                    {
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   451
                      rcqiMax = rcqi;
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   452
                      itMax = it;
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   453
                    }
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   454
                }
7966
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   455
              } // end if cqi
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   456
        } // end for m_rlcBufferReq
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   457
      
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   458
      if (itMax == m_flowStats.end ())
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   459
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   460
          // no UE available for this RB
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   461
          //NS_LOG_DEBUG (this << " no UE found");
7971
3cc205853837 lteFlowId_t --> LteFlowId_t
Nicola Baldo <nbaldo@cttc.es>
parents: 7968
diff changeset
   462
          LteFlowId_t nullFlow;
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   463
          nullFlow.m_rnti = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   464
          rbgAllocationMap.push_back (nullFlow);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   465
        }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   466
      else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   467
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   468
          rbgAllocationMap.push_back ((*itMax).first);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   469
          //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
   470
        }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   471
    } // end for RBGs
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
    // 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
   474
    // creating the correspondent DCIs
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   475
    FfMacSchedSapUser::SchedDlConfigIndParameters ret;
7971
3cc205853837 lteFlowId_t --> LteFlowId_t
Nicola Baldo <nbaldo@cttc.es>
parents: 7968
diff changeset
   476
    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
   477
    int rbgAllocated = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   478
    while (flowIt != rbgAllocationMap.end ())
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   479
      {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   480
        if ((*flowIt).m_rnti == 0)
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
            // skip this RBG
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   483
            //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
   484
            rbgAllocated++;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   485
            flowIt++;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   486
            continue;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   487
          }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   488
        int lcRbgNum = 1;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   489
        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
   490
          {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   491
            lcRbgNum++;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   492
            flowIt++;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   493
          }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   494
        //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
   495
        //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
   496
        // 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
   497
        BuildDataListElement_s newEl;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   498
        newEl.m_rnti = (*flowIt).m_rnti;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   499
        // 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
   500
        // create the DlDciListElement_s
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   501
        DlDciListElement_s newDci;
7953
1db2126cb7c9 PfFfMacScheduler updated for multiples rlcPdu
mmiozzo
parents: 7948
diff changeset
   502
        std::vector <struct RlcPduListElement_s> newRlcPduLe;
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   503
        newDci.m_rnti = (*flowIt).m_rnti;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   504
        newDci.m_resAlloc = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   505
        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
   506
        uint32_t rbgMask = 0;
7959
9c24fdc93a0d Bug fix: PfFfMacScheduler::DoSchedDlTriggerReq extract the worst CQI from the RBGs allocated to a LC
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7953
diff changeset
   507
        uint32_t startRbg = rbgAllocated;
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   508
        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
   509
          {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   510
            rbgMask = rbgMask + (0x1 << rbgAllocated);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   511
            // 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
   512
            rbgAllocated++;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   513
          }
7959
9c24fdc93a0d Bug fix: PfFfMacScheduler::DoSchedDlTriggerReq extract the worst CQI from the RBGs allocated to a LC
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7953
diff changeset
   514
        uint32_t finishRbg = rbgAllocated - 1; 
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   515
        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
   516
        
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   517
        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
   518
        int rlcPduSize = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   519
        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
   520
          {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   521
            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
   522
            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
   523
            if (itCqi == m_a30CqiRxed.end ())
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   524
              {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   525
                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
   526
                //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
   527
              }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   528
            else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   529
              {
7959
9c24fdc93a0d Bug fix: PfFfMacScheduler::DoSchedDlTriggerReq extract the worst CQI from the RBGs allocated to a LC
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7953
diff changeset
   530
                // find the worst CQI in the bandwidht allocated
9c24fdc93a0d Bug fix: PfFfMacScheduler::DoSchedDlTriggerReq extract the worst CQI from the RBGs allocated to a LC
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7953
diff changeset
   531
                uint8_t worstCqi = (*itCqi).second.m_higherLayerSelected.at (startRbg).m_sbCqi.at (0);
9c24fdc93a0d Bug fix: PfFfMacScheduler::DoSchedDlTriggerReq extract the worst CQI from the RBGs allocated to a LC
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7953
diff changeset
   532
                for (uint16_t k = startRbg + 1; k <= finishRbg; k++)
9c24fdc93a0d Bug fix: PfFfMacScheduler::DoSchedDlTriggerReq extract the worst CQI from the RBGs allocated to a LC
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7953
diff changeset
   533
                  {
9c24fdc93a0d Bug fix: PfFfMacScheduler::DoSchedDlTriggerReq extract the worst CQI from the RBGs allocated to a LC
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7953
diff changeset
   534
                    if (((*itCqi).second.m_higherLayerSelected.at (k).m_sbCqi.at (0)) < worstCqi)
9c24fdc93a0d Bug fix: PfFfMacScheduler::DoSchedDlTriggerReq extract the worst CQI from the RBGs allocated to a LC
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7953
diff changeset
   535
                      {
9c24fdc93a0d Bug fix: PfFfMacScheduler::DoSchedDlTriggerReq extract the worst CQI from the RBGs allocated to a LC
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7953
diff changeset
   536
                        worstCqi = ((*itCqi).second.m_higherLayerSelected.at (k).m_sbCqi.at (0));
9c24fdc93a0d Bug fix: PfFfMacScheduler::DoSchedDlTriggerReq extract the worst CQI from the RBGs allocated to a LC
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7953
diff changeset
   537
                      }
9c24fdc93a0d Bug fix: PfFfMacScheduler::DoSchedDlTriggerReq extract the worst CQI from the RBGs allocated to a LC
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7953
diff changeset
   538
                  }
9c24fdc93a0d Bug fix: PfFfMacScheduler::DoSchedDlTriggerReq extract the worst CQI from the RBGs allocated to a LC
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7953
diff changeset
   539
                newDci.m_mcs.push_back (LteAmc::GetMcsFromCqi (worstCqi));
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   540
                //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
   541
              }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   542
            int nPRB = rbgSize * lcRbgNum;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   543
            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
   544
            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
   545
            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
   546
            //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
   547
            
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   548
            rlcPduSize += newDci.m_tbsSize.at (i);
7953
1db2126cb7c9 PfFfMacScheduler updated for multiples rlcPdu
mmiozzo
parents: 7948
diff changeset
   549
            RlcPduListElement_s newRlcEl;
1db2126cb7c9 PfFfMacScheduler updated for multiples rlcPdu
mmiozzo
parents: 7948
diff changeset
   550
            newRlcEl.m_logicalChannelIdentity = (*flowIt).m_lcId;
1db2126cb7c9 PfFfMacScheduler updated for multiples rlcPdu
mmiozzo
parents: 7948
diff changeset
   551
            // NS_LOG_DEBUG (this << "LCID " << (uint32_t) newRlcEl.m_logicalChannelIdentity);
1db2126cb7c9 PfFfMacScheduler updated for multiples rlcPdu
mmiozzo
parents: 7948
diff changeset
   552
            newRlcEl.m_size = newDci.m_tbsSize.at (i);
1db2126cb7c9 PfFfMacScheduler updated for multiples rlcPdu
mmiozzo
parents: 7948
diff changeset
   553
            
1db2126cb7c9 PfFfMacScheduler updated for multiples rlcPdu
mmiozzo
parents: 7948
diff changeset
   554
            newRlcPduLe.push_back (newRlcEl);
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   555
          }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   556
        newEl.m_dci = newDci;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   557
        // ...more parameters -> ingored in this version
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
        newEl.m_rlcPduList.push_back (newRlcPduLe);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   560
        ret.m_buildDataList.push_back (newEl);
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
        // update UE-LC stats
7971
3cc205853837 lteFlowId_t --> LteFlowId_t
Nicola Baldo <nbaldo@cttc.es>
parents: 7968
diff changeset
   563
        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
   564
        it = m_flowStats.find ((*flowIt));
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   565
        if (it != m_flowStats.end())
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
            (*it).second.lastTtiBytesTrasmitted += rlcPduSize;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   568
            //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
   569
          }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   570
//         else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   571
//           {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   572
//             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
   573
//           }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   574
        if (rbgAllocated == rbgNum)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   575
          {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   576
            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
   577
          }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   578
          
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   579
        if ((flowIt+1) == rbgAllocationMap.end ())
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   580
          {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   581
            // no more flows to allocated
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   582
            break;
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
        else
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
            flowIt++;
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
      } // end while allocation
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   590
      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
   591
      
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   592
      // update the UE-LC stats
7971
3cc205853837 lteFlowId_t --> LteFlowId_t
Nicola Baldo <nbaldo@cttc.es>
parents: 7968
diff changeset
   593
      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
   594
      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
   595
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   596
          (*it).second.totalBytesTransmitted += (*it).second.lastTtiBytesTrasmitted;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   597
          // 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
   598
          (*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
   599
          (*it).second.lastTtiBytesTrasmitted = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   600
          //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
   601
//           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
   602
        }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   603
      
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
  m_schedSapUser->SchedDlConfigInd (ret);
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
 
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   608
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   609
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   610
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   611
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   612
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
   613
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   614
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   615
  // TODO: Implementation of the API
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   616
  return;
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
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   619
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   620
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
   621
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   622
  NS_LOG_FUNCTION (this);
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
  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
   625
    {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   626
      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
   627
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   628
          // wideband CQI reporting
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   629
          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
   630
          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
   631
          it = m_p10CqiRxed.find (rnti);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   632
          if (it == m_p10CqiRxed.end ())
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   633
            {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   634
              // create the new entry
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   635
              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
   636
            }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   637
          else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   638
            {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   639
              // update the CQI value
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   640
              (*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
   641
            }
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
      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
   644
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   645
          // subband CQI reporting high layer configured
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   646
          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
   647
          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
   648
          it = m_a30CqiRxed.find (rnti);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   649
          if (it == m_a30CqiRxed.end ())
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   650
            {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   651
              // create the new entry
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   652
              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
   653
            }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   654
          else
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
              // update the CQI value
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   657
              (*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
   658
            }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   659
        }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   660
      else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   661
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   662
          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
   663
        }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   664
    }
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
  return;
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
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   669
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   670
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
   671
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   672
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   673
  // TODO: Implementation of the API
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   674
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   675
  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
   676
  int nflows = 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
  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
   679
    {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   680
      // 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
   681
      if ((*it).second > 0)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   682
      {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   683
        nflows++;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   684
      }
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
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   687
  if (nflows==0)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   688
  {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   689
    return ;  // no flows to be scheduled
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   690
  } 
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   691
   
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   692
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   693
  // 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
   694
  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
   695
  if (rbPerFlow == 0)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   696
  {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   697
    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
   698
  }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   699
  int rbAllocated = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   700
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   701
  FfMacSchedSapUser::SchedUlConfigIndParameters ret;
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   702
  std::vector <uint16_t> rbgAllocationMap;
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   703
  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
   704
    {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   705
      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
   706
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   707
          // 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
   708
          rbPerFlow = m_cschedCellConfig.m_ulBandwidth - rbAllocated;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   709
        }
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   710
       // 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
   711
      for (int i = 0; i < rbPerFlow; i++)
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   712
        {
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   713
        	rbgAllocationMap.push_back ((*it).first);
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   714
        }
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   715
      UlDciListElement_s uldci;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   716
      uldci.m_rnti = (*it).first;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   717
      uldci.m_rbStart = rbAllocated;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   718
      uldci.m_rbLen = rbPerFlow;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   719
      rbAllocated += rbPerFlow;
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   720
      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
   721
      if (itCqi == m_ueCqi.end ())
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   722
        {
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   723
        	// no cqi info about this UE
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   724
          uldci.m_mcs = 0; // MCS 0 -> UL-AMC TBD
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   725
          //NS_LOG_DEBUG (this << " UE does not have ULCQI " << (*it).first );
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   726
        }
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   727
      else
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
        	// take the lowest CQI value (worst RB)
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   730
        	double minSinr = (*itCqi).second.at(uldci.m_rbStart);
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   731
        	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
   732
        	  {
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   733
        	  	//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
   734
        	  	if ((*itCqi).second.at(i) < minSinr)
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   735
        	  	  {
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   736
        	  	  	minSinr = (*itCqi).second.at(i);
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   737
        	  	  }
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   738
        	  }
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   739
        	 
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   740
        	// translate SINR -> cqi: WILD ACK: same as DL
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   741
        	double s = log2 ( 1 + (
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   742
                          pow (10, minSinr / 10 )  /
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   743
                          ( (-log (5.0 * 0.00005 )) / 1.5) ));
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   744
          int cqi = LteAmc::GetCqiFromSpectralEfficiency (s);
7966
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   745
          if (cqi == 0)
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   746
            {
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   747
              continue; // CQI == 0 means "out of range" (see table 7.2.3-1 of 36.213)
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   748
            }
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   749
          uldci.m_mcs = LteAmc::GetMcsFromCqi (cqi);
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   750
          //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
   751
        	
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   752
        }
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   753
      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
   754
      uldci.m_ndi = 1;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   755
      uldci.m_cceIndex = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   756
      uldci.m_aggrLevel = 1;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   757
      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
   758
      uldci.m_hopping = false;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   759
      uldci.m_n2Dmrs = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   760
      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
   761
      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
   762
      uldci.m_ulIndex = 0; // TDD parameter
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   763
      uldci.m_dai = 1; // TDD parameter
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   764
      uldci.m_freqHopping = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   765
      uldci.m_pdcchPowerOffset = 0; // not used
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   766
      ret.m_dciList.push_back (uldci);      
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   767
    }
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   768
  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
   769
  m_schedSapUser->SchedUlConfigInd (ret);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   770
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   771
}
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
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   774
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
   775
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   776
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   777
  // TODO: Implementation of the API
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   778
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   779
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   780
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   781
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   782
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
   783
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   784
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   785
  // TODO: Implementation of the API
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   786
  return;
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
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   789
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   790
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
   791
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   792
  NS_LOG_FUNCTION (this);
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
  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
   795
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   796
  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
   797
  {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   798
    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
   799
    {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   800
      // buffer status report
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   801
      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
   802
      it = m_ceBsrRxed.find(rnti);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   803
      if (it==m_ceBsrRxed.end())
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   804
      {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   805
        // create the new entry
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   806
        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
   807
        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
   808
      }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   809
      else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   810
      {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   811
        // update the CQI value
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   812
        (*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
   813
      }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   814
    }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   815
  }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   816
  
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   817
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   818
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   819
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   820
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   821
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
   822
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   823
  NS_LOG_FUNCTION (this);
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   824
  //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
   825
  // 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
   826
  uint32_t frameNo = (0xFF & params.m_sfnSf) >> 4;
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   827
  uint32_t subframeNo = (0xF & params.m_sfnSf);
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   828
  //NS_LOG_DEBUG (this << " sfn " << frameNo << " sbfn " << subframeNo);
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   829
  if (subframeNo - m_schedTtiDelay < 0)
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   830
  {
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   831
  	frameNo--;
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   832
  }
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   833
  subframeNo = (subframeNo - m_schedTtiDelay) % 10;
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   834
  //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
   835
  uint16_t sfnSf = ((0xFF & frameNo) << 4) | (0xF & subframeNo);
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   836
  // retrieve the allocation for this subframe
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   837
  std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   838
  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
   839
  itMap = m_allocationMaps.find (sfnSf);
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   840
  if (itMap == m_allocationMaps.end())
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   841
  {
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   842
  	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
   843
  	return;
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   844
  }
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   845
  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
   846
    {
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   847
  	  // convert from fixed point notation Sxxxxxxxxxxx.xxx to double    	
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   848
    	double sinr = LteFfConverter::fpS11dot3toDouble (params.m_ulCqi.m_sinr.at (i));
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   849
  	  //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
   850
  	  itCqi = m_ueCqi.find ((*itMap).second.at (i));
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   851
  	  if (itCqi == m_ueCqi.end ())
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
  	    	// create a new entry
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   854
  	    	std::vector <double> newCqi;
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   855
  	    	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
   856
  	    	  {
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   857
  	    	  	if (i==j)
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   858
		 	    	  	{
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   859
		 	    	  		newCqi.push_back (sinr);
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   860
		 	    	  	}
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   861
  	    	  	else
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   862
  	    	  	  {
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   863
  	    	  	  	// initialize with minumum values according to the fixed point notation
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   864
  	    	  	  	newCqi.push_back (LteFfConverter::getMinFpS11dot3Value ());
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   865
  	    	  	  }
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   866
  	    	  	
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   867
  	    	  }
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   868
  	    	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
   869
  	    }
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   870
  	  else
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   871
  	    {
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   872
  	      // update the value
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   873
  	      (*itCqi).second.at (i) = sinr;
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   874
  	    }
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   875
  	  
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   876
  	}
7948
7a7b4ad007b0 UL-CQI and AMC in RrFfMacScheduler
mmiozzo
parents: 7947
diff changeset
   877
  // remove obsolete info on allocation
7a7b4ad007b0 UL-CQI and AMC in RrFfMacScheduler
mmiozzo
parents: 7947
diff changeset
   878
  m_allocationMaps.erase (m_allocationMaps.begin (), ++itMap);
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   879
   
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   880
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   881
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   882
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   883
}