src/lte/model/pf-ff-mac-scheduler.cc
author Marco Miozzo <marco.miozzo@cttc.es>
Mon, 14 Nov 2011 12:25:16 +0100
changeset 8321 c674feef9d5f
parent 8319 8b45a9d26c06
child 8435 6b0542a91970
child 8516 db748e56aea2
permissions -rw-r--r--
Bug-fix UL Allocation Map storing for UL-CQI
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),
8047
3741b99462cd Update PfFfMacScheduler::m_timWindow for having giving more memory to the scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8035
diff changeset
   213
    m_timeWindow (99.0),
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   214
    m_schedTtiDelay (2),
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   215
    // WILD ACK: based on a m_macChTtiDelay = 1
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   216
    m_nextRntiUl (0)
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   217
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   218
  m_cschedSapProvider = new PfSchedulerMemberCschedSapProvider (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   219
  m_schedSapProvider = new PfSchedulerMemberSchedSapProvider (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   220
}
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
PfFfMacScheduler::~PfFfMacScheduler ()
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
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   225
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   226
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   227
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   228
PfFfMacScheduler::DoDispose ()
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   229
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   230
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   231
  delete m_cschedSapProvider;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   232
  delete m_schedSapProvider;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   233
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   234
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   235
TypeId
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   236
PfFfMacScheduler::GetTypeId (void)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   237
{
7983
b91d5a39aabc scheduler and propagation model configurable through ConfigStore
Nicola Baldo <nbaldo@cttc.es>
parents: 7979
diff changeset
   238
  static TypeId tid = TypeId ("ns3::PfFfMacScheduler")
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   239
    .SetParent<FfMacScheduler> ()
8311
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   240
    .AddConstructor<PfFfMacScheduler> ()
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   241
    .AddAttribute ("CqiTimerThreshold",
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   242
                   "The number of TTIs a CQI is valid (default 1000 - 1 sec.)",
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   243
                   UintegerValue (1000),
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   244
                   MakeUintegerAccessor (&PfFfMacScheduler::m_cqiTimersThreshold),
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   245
                   MakeUintegerChecker<uint32_t> ())
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   246
    ;
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   247
  return tid;
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
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   251
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   252
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   253
PfFfMacScheduler::SetFfMacCschedSapUser (FfMacCschedSapUser* 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
  m_cschedSapUser = s;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   256
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   257
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   258
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   259
PfFfMacScheduler::SetFfMacSchedSapUser (FfMacSchedSapUser* s)
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
  m_schedSapUser = s;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   262
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   263
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   264
FfMacCschedSapProvider*
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   265
PfFfMacScheduler::GetFfMacCschedSapProvider ()
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
  return m_cschedSapProvider;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   268
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   269
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   270
FfMacSchedSapProvider*
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   271
PfFfMacScheduler::GetFfMacSchedSapProvider ()
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   272
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   273
  return m_schedSapProvider;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   274
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   275
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   276
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   277
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
   278
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   279
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   280
  // Read the subset of parameters used
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   281
  m_cschedCellConfig = params;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   282
  FfMacCschedSapUser::CschedUeConfigCnfParameters cnf;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   283
  cnf.m_result = SUCCESS;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   284
  m_cschedSapUser->CschedUeConfigCnf (cnf);
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::DoCschedUeConfigReq (const struct FfMacCschedSapProvider::CschedUeConfigReqParameters& 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);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   292
  // Not used at this stage
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   293
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   294
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   295
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   296
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   297
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
   298
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   299
  NS_LOG_FUNCTION (this << " New LC, rnti: "  << params.m_rnti);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   300
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   301
  std::map <uint16_t, pfsFlowPerf_t>::iterator it;
7909
82b1281ea0a3 Updates for MACOS compilation (virtual destructors and variable types)
mmiozzo
parents: 7899
diff changeset
   302
  for (uint16_t i = 0; i < params.m_logicalChannelConfigList.size (); i++)
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   303
    {
8131
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   304
      it = m_flowStatsDl.find (params.m_rnti);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   305
8131
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   306
      if (it == m_flowStatsDl.end ())
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   307
        {
8131
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   308
          pfsFlowPerf_t flowStatsDl;
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   309
          flowStatsDl.flowStart = Simulator::Now ();
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   310
          flowStatsDl.totalBytesTransmitted = 0;
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   311
          flowStatsDl.lastTtiBytesTrasmitted = 0;
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   312
          flowStatsDl.lastAveragedThroughput = 1;
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   313
          m_flowStatsDl.insert (std::pair<uint16_t, pfsFlowPerf_t> (params.m_rnti, flowStatsDl));
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   314
          pfsFlowPerf_t flowStatsUl;
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   315
          flowStatsUl.flowStart = Simulator::Now ();
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   316
          flowStatsUl.totalBytesTransmitted = 0;
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   317
          flowStatsUl.lastTtiBytesTrasmitted = 0;
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   318
          flowStatsUl.lastAveragedThroughput = 1;
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   319
          m_flowStatsUl.insert (std::pair<uint16_t, pfsFlowPerf_t> (params.m_rnti, flowStatsUl));
7899
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
      else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   322
        {
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   323
          NS_LOG_ERROR ("RNTI already exists");
7899
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
    }
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   326
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   327
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   328
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   329
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   330
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   331
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
   332
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   333
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   334
  // TODO: Implementation of the API
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   335
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   336
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   337
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   338
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   339
PfFfMacScheduler::DoCschedUeReleaseReq (const struct FfMacCschedSapProvider::CschedUeReleaseReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   340
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   341
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   342
  // TODO: Implementation of the API
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   343
  return;
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
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   346
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   347
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   348
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
   349
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   350
  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
   351
  // API generated by RLC for updating RLC parameters on a LC (tx and retx queues)
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   352
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   353
  std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   354
7971
3cc205853837 lteFlowId_t --> LteFlowId_t
Nicola Baldo <nbaldo@cttc.es>
parents: 7968
diff changeset
   355
  LteFlowId_t flow (params.m_rnti, params.m_logicalChannelIdentity);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   356
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   357
  it =  m_rlcBufferReq.find (flow);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   358
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   359
  if (it == m_rlcBufferReq.end ())
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   360
    {
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   361
      m_rlcBufferReq.insert (std::pair <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters> (flow, params));
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   362
    }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   363
  else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   364
    {
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   365
      (*it).second = params;
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   366
    }
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   367
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   368
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   369
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   370
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   371
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   372
PfFfMacScheduler::DoSchedDlPagingBufferReq (const struct FfMacSchedSapProvider::SchedDlPagingBufferReqParameters& params)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   373
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   374
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   375
  // TODO: Implementation of the API
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   376
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   377
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   378
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   379
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   380
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
   381
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   382
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   383
  // TODO: Implementation of the API
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   384
  return;
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
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   387
int
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   388
PfFfMacScheduler::GetRbgSize (int dlbandwidth)
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   389
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   390
  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
   391
    {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   392
      if (dlbandwidth < PfType0AllocationRbg[i])
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   393
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   394
          return (i + 1);
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
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   398
  return (-1);
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
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   402
int 
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   403
PfFfMacScheduler::LcActivePerFlow (uint16_t rnti)
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   404
{
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   405
  std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   406
  int lcActive = 0;
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   407
  for (it = m_rlcBufferReq.begin (); it != m_rlcBufferReq.end (); it++)
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   408
    {
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   409
      if (((*it).first.m_rnti == rnti) && (((*it).second.m_rlcTransmissionQueueSize > 0)
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   410
                                           || ((*it).second.m_rlcRetransmissionQueueSize > 0)
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   411
                                           || ((*it).second.m_rlcStatusPduSize > 0) ))
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   412
        {
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   413
          lcActive++;
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   414
        }
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   415
      if ((*it).first.m_rnti > rnti)
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   416
        {
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   417
          break;
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   418
        }
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   419
    }
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   420
  return (lcActive);
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   421
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   422
}
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   423
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   424
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   425
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   426
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
   427
{
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   428
  NS_LOG_FUNCTION (this << " Frame no. " << (params.m_sfnSf >> 4) << " subframe no. " << (0xF & params.m_sfnSf));
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   429
  // API generated by RLC for triggering the scheduling of a DL subframe
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   430
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   431
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   432
  // 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
   433
  // (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
   434
  // Resource allocation type 0 (see sec 7.1.6.1 of 36.213)
8311
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   435
  
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   436
  RefreshDlCqiMaps ();
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   437
  
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   438
  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
   439
  int rbgNum = m_cschedCellConfig.m_dlBandwidth / rbgSize;
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   440
  //std::vector <LteFlowId_t> rbgAllocationMap;
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   441
  std::map <uint16_t, std::vector <uint16_t> > allocationMap;
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   442
  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
   443
    {
8080
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   444
//       NS_LOG_DEBUG (this << " ALLOCATION for RBG " << i << " of " << rbgNum);
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   445
      std::map <uint16_t, pfsFlowPerf_t>::iterator it;
8131
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   446
      std::map <uint16_t, pfsFlowPerf_t>::iterator itMax = m_flowStatsDl.end ();
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   447
      double rcqiMax = 0.0;
8131
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   448
      for (it = m_flowStatsDl.begin (); it != m_flowStatsDl.end (); it++)
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   449
        {
7966
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   450
          std::map <uint16_t,SbMeasResult_s>::iterator itCqi;
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   451
          itCqi = m_a30CqiRxed.find ((*it).first);
7966
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   452
          uint8_t cqi = 0;
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   453
          if (itCqi == m_a30CqiRxed.end ())
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   454
            {
8311
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   455
//               NS_LOG_DEBUG (this << " No DL-CQI for this UE " << (*it).first);
7966
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   456
              cqi = 1;  // start with lowest value
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   457
            }
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   458
          else
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   459
            {
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   460
              cqi = (*itCqi).second.m_higherLayerSelected.at (i).m_sbCqi.at (0);
8311
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   461
//               NS_LOG_INFO (this << " CQI " << (uint32_t)cqi);
7966
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   462
            }
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   463
          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
   464
            {
8035
d2e70680881a LenaTestPfFfMacSchedulerSuite works with distance 0
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7983
diff changeset
   465
//               NS_LOG_DEBUG (this << " LC active " << LcActivePerFlow ((*it).first));
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   466
              if (LcActivePerFlow ((*it).first) > 0)
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   467
                {
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   468
                  // this UE has data to transmit
7966
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   469
                  uint8_t mcs = LteAmc::GetMcsFromCqi (cqi);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   470
                  double achievableRate = ((LteAmc::GetTbSizeFromMcs (mcs, 1) / 8) / 0.001); // = TB size / TTI
7966
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   471
                  double rcqi = achievableRate / (*it).second.lastAveragedThroughput;
8080
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   472
//                   NS_LOG_DEBUG (this << " RNTI " << (*it).first << " MCS " << (uint32_t)mcs << " achievableRate " << achievableRate << " avgThr " << (*it).second.lastAveragedThroughput << " RCQI " << rcqi);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   473
7966
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   474
                  if (rcqi > rcqiMax)
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   475
                    {
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   476
                      rcqiMax = rcqi;
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   477
                      itMax = it;
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   478
                    }
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   479
                }
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   480
            }   // end if cqi
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   481
        } // end for m_rlcBufferReq
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   482
8131
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   483
      if (itMax == m_flowStatsDl.end ())
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   484
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   485
          // no UE available for this RB
8035
d2e70680881a LenaTestPfFfMacSchedulerSuite works with distance 0
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7983
diff changeset
   486
          NS_LOG_DEBUG (this << " no UE found");
7899
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
      else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   489
        {
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   490
          std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   491
          itMap = allocationMap.find ((*itMax).first);
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   492
          if (itMap == allocationMap.end ())
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   493
            {
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   494
              // insert new element
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   495
              std::vector <uint16_t> tempMap;
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   496
              tempMap.push_back (i);
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   497
              allocationMap.insert (std::pair <uint16_t, std::vector <uint16_t> > ((*itMax).first, tempMap));
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   498
            }
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   499
          else
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   500
            {
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   501
              (*itMap).second.push_back (i);
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   502
            }
8080
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   503
//           NS_LOG_DEBUG (this << " UE assigned " << (*itMax).first);
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   504
        }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   505
    } // end for RBGs
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   506
8047
3741b99462cd Update PfFfMacScheduler::m_timWindow for having giving more memory to the scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8035
diff changeset
   507
  // reset TTI stats of users
3741b99462cd Update PfFfMacScheduler::m_timWindow for having giving more memory to the scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8035
diff changeset
   508
  std::map <uint16_t, pfsFlowPerf_t>::iterator itStats;
8131
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   509
  for (itStats = m_flowStatsDl.begin (); itStats != m_flowStatsDl.end (); itStats++)
8047
3741b99462cd Update PfFfMacScheduler::m_timWindow for having giving more memory to the scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8035
diff changeset
   510
    {
3741b99462cd Update PfFfMacScheduler::m_timWindow for having giving more memory to the scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8035
diff changeset
   511
      (*itStats).second.lastTtiBytesTrasmitted = 0;
3741b99462cd Update PfFfMacScheduler::m_timWindow for having giving more memory to the scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8035
diff changeset
   512
    }
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   513
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   514
  // generate the transmission opportunities by grouping the RBGs of the same RNTI and
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   515
  // creating the correspondent DCIs
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   516
  FfMacSchedSapUser::SchedDlConfigIndParameters ret;
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   517
  std::map <uint16_t, std::vector <uint16_t> >::iterator itMap = allocationMap.begin ();
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   518
  while (itMap != allocationMap.end ())
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   519
    {
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   520
      // create new BuildDataListElement_s for this LC
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   521
      BuildDataListElement_s newEl;
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   522
      newEl.m_rnti = (*itMap).first;
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   523
      // create the DlDciListElement_s
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   524
      DlDciListElement_s newDci;
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   525
      std::vector <struct RlcPduListElement_s> newRlcPduLe;
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   526
      newDci.m_rnti = (*itMap).first;
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   527
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   528
      uint16_t lcActives = LcActivePerFlow ((*itMap).first);
8035
d2e70680881a LenaTestPfFfMacSchedulerSuite works with distance 0
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7983
diff changeset
   529
//       NS_LOG_DEBUG (this << "Allocate user " << newEl.m_rnti << " rbg " << lcActives);
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   530
      uint16_t RgbPerRnti = (*itMap).second.size ();
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   531
      std::map <uint16_t,SbMeasResult_s>::iterator itCqi;
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   532
      itCqi = m_a30CqiRxed.find ((*itMap).first);
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   533
      uint8_t worstCqi = 15;
8182
81d05985d460 Bug-fix JIRA-152 m_a30CqiRxed lookup in PfFfMacScheduler::DoSchedDlTriggerReq
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8181
diff changeset
   534
      if (itCqi != m_a30CqiRxed.end ())
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   535
        {
8182
81d05985d460 Bug-fix JIRA-152 m_a30CqiRxed lookup in PfFfMacScheduler::DoSchedDlTriggerReq
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8181
diff changeset
   536
          for (uint16_t k = 0; k < (*itMap).second.size (); k++)
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   537
            {
8182
81d05985d460 Bug-fix JIRA-152 m_a30CqiRxed lookup in PfFfMacScheduler::DoSchedDlTriggerReq
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8181
diff changeset
   538
              if ((*itCqi).second.m_higherLayerSelected.size () > (*itMap).second.at (k))
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   539
                {
8311
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   540
//                 NS_LOG_DEBUG (this << " RBG " << (*itMap).second.at (k) << " CQI " << (uint16_t)((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.at (0)) );
8182
81d05985d460 Bug-fix JIRA-152 m_a30CqiRxed lookup in PfFfMacScheduler::DoSchedDlTriggerReq
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8181
diff changeset
   541
                  if (((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.at (0)) < worstCqi)
81d05985d460 Bug-fix JIRA-152 m_a30CqiRxed lookup in PfFfMacScheduler::DoSchedDlTriggerReq
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8181
diff changeset
   542
                    {
81d05985d460 Bug-fix JIRA-152 m_a30CqiRxed lookup in PfFfMacScheduler::DoSchedDlTriggerReq
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8181
diff changeset
   543
                      worstCqi = ((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.at (0));
81d05985d460 Bug-fix JIRA-152 m_a30CqiRxed lookup in PfFfMacScheduler::DoSchedDlTriggerReq
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8181
diff changeset
   544
                    }
81d05985d460 Bug-fix JIRA-152 m_a30CqiRxed lookup in PfFfMacScheduler::DoSchedDlTriggerReq
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8181
diff changeset
   545
                }
81d05985d460 Bug-fix JIRA-152 m_a30CqiRxed lookup in PfFfMacScheduler::DoSchedDlTriggerReq
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8181
diff changeset
   546
              else
81d05985d460 Bug-fix JIRA-152 m_a30CqiRxed lookup in PfFfMacScheduler::DoSchedDlTriggerReq
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8181
diff changeset
   547
                {
81d05985d460 Bug-fix JIRA-152 m_a30CqiRxed lookup in PfFfMacScheduler::DoSchedDlTriggerReq
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8181
diff changeset
   548
                  worstCqi = 1; // try with lowest MCS in RBG with no info on channel
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   549
                }
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   550
            }
8182
81d05985d460 Bug-fix JIRA-152 m_a30CqiRxed lookup in PfFfMacScheduler::DoSchedDlTriggerReq
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8181
diff changeset
   551
        }
81d05985d460 Bug-fix JIRA-152 m_a30CqiRxed lookup in PfFfMacScheduler::DoSchedDlTriggerReq
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8181
diff changeset
   552
      else
81d05985d460 Bug-fix JIRA-152 m_a30CqiRxed lookup in PfFfMacScheduler::DoSchedDlTriggerReq
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8181
diff changeset
   553
        {
81d05985d460 Bug-fix JIRA-152 m_a30CqiRxed lookup in PfFfMacScheduler::DoSchedDlTriggerReq
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8181
diff changeset
   554
          worstCqi = 1; // try with lowest MCS in RBG with no info on channel
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   555
        }
8035
d2e70680881a LenaTestPfFfMacSchedulerSuite works with distance 0
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7983
diff changeset
   556
//       NS_LOG_DEBUG (this << " CQI " << (uint16_t)worstCqi);
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   557
      newDci.m_mcs.push_back (LteAmc::GetMcsFromCqi (worstCqi));
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   558
      int tbSize = (LteAmc::GetTbSizeFromMcs (newDci.m_mcs.at (0), RgbPerRnti * rbgSize) / 8); // (size of TB in bytes according to table 7.1.7.2.1-1 of 36.213)
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   559
      newDci.m_tbsSize.push_back (tbSize);
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   560
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   561
      newDci.m_resAlloc = 0;  // only allocation type 0 at this stage
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   562
      newDci.m_rbBitmap = 0; // TBD (32 bit bitmap see 7.1.6 of 36.213)
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   563
      uint32_t rbgMask = 0;
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   564
      for (uint16_t k = 0; k < (*itMap).second.size (); k++)
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   565
        {
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   566
          rbgMask = rbgMask + (0x1 << (*itMap).second.at (k));
8035
d2e70680881a LenaTestPfFfMacSchedulerSuite works with distance 0
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7983
diff changeset
   567
//           NS_LOG_DEBUG (this << " Allocated PRB " << (*itMap).second.at (k));
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   568
        }
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   569
      newDci.m_rbBitmap = rbgMask; // (32 bit bitmap see 7.1.6 of 36.213)
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   570
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   571
      // create the rlc PDUs -> equally divide resources among actives LCs
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   572
      int rlcPduSize = tbSize / lcActives;
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   573
      std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator itBufReq;
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   574
      for (itBufReq = m_rlcBufferReq.begin (); itBufReq != m_rlcBufferReq.end (); itBufReq++)
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   575
        {
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   576
          if (((*itBufReq).first.m_rnti == (*itMap).first) && (((*itBufReq).second.m_rlcTransmissionQueueSize > 0)
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   577
                                                               || ((*itBufReq).second.m_rlcRetransmissionQueueSize > 0)
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   578
                                                               || ((*itBufReq).second.m_rlcStatusPduSize > 0) ))
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   579
            {
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   580
              RlcPduListElement_s newRlcEl;
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   581
              newRlcEl.m_logicalChannelIdentity = (*itBufReq).first.m_lcId;
8080
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   582
//               NS_LOG_DEBUG (this << " LCID " << (uint32_t) newRlcEl.m_logicalChannelIdentity << " size " << rlcPduSize);
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   583
              newRlcEl.m_size = rlcPduSize;
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   584
              newRlcPduLe.push_back (newRlcEl);
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   585
            }
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   586
          if ((*itBufReq).first.m_rnti > (*itMap).first)
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   587
            {
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   588
              break;
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   589
            }
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   590
        }
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   591
      newDci.m_ndi.push_back (1); // TBD (new data indicator)
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   592
      newDci.m_rv.push_back (0); // TBD (redundancy version)
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   593
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   594
      newEl.m_dci = newDci;
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   595
      // ...more parameters -> ingored in this version
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   596
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   597
      newEl.m_rlcPduList.push_back (newRlcPduLe);
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   598
      ret.m_buildDataList.push_back (newEl);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   599
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   600
      // update UE stats
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   601
      std::map <uint16_t, pfsFlowPerf_t>::iterator it;
8131
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   602
      it = m_flowStatsDl.find ((*itMap).first);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   603
      if (it != m_flowStatsDl.end ())
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   604
        {
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   605
          (*it).second.lastTtiBytesTrasmitted = tbSize;
8080
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   606
//           NS_LOG_DEBUG (this << " UE bytes txed " << (*it).second.lastTtiBytesTrasmitted);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   607
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   608
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   609
        }
8035
d2e70680881a LenaTestPfFfMacSchedulerSuite works with distance 0
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7983
diff changeset
   610
      else
d2e70680881a LenaTestPfFfMacSchedulerSuite works with distance 0
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7983
diff changeset
   611
        {
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   612
          NS_LOG_DEBUG (this << " No Stats for this allocated UE");
8035
d2e70680881a LenaTestPfFfMacSchedulerSuite works with distance 0
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7983
diff changeset
   613
        }
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   614
7979
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   615
      itMap++;
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   616
    } // end while allocation
8e542d91bfc3 LENA-68 PfFfMacScheduler updated to single TB per RNTI (LC multiplexed)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7974
diff changeset
   617
  ret.m_nrOfPdcchOfdmSymbols = 1;   // TODO: check correct value according the DCIs txed
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   618
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   619
8047
3741b99462cd Update PfFfMacScheduler::m_timWindow for having giving more memory to the scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8035
diff changeset
   620
  // update UEs stats
8131
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   621
  for (itStats = m_flowStatsDl.begin (); itStats != m_flowStatsDl.end (); itStats++)
8047
3741b99462cd Update PfFfMacScheduler::m_timWindow for having giving more memory to the scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8035
diff changeset
   622
    {
3741b99462cd Update PfFfMacScheduler::m_timWindow for having giving more memory to the scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8035
diff changeset
   623
      (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTrasmitted;
3741b99462cd Update PfFfMacScheduler::m_timWindow for having giving more memory to the scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8035
diff changeset
   624
      // update average throughput (see eq. 12.3 of Sec 12.3.1.2 of LTE – The UMTS Long Term Evolution, Ed Wiley)
3741b99462cd Update PfFfMacScheduler::m_timWindow for having giving more memory to the scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8035
diff changeset
   625
      (*itStats).second.lastAveragedThroughput = ((1.0 - (1.0 / m_timeWindow)) * (*itStats).second.lastAveragedThroughput) + ((1.0 / m_timeWindow) * (double)((*itStats).second.lastTtiBytesTrasmitted / 0.001));
8080
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   626
//       NS_LOG_DEBUG (this << " UE tot bytes " << (*itStats).second.totalBytesTransmitted);
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   627
//       NS_LOG_DEBUG (this << " UE avg thr " << (*itStats).second.lastAveragedThroughput);
8047
3741b99462cd Update PfFfMacScheduler::m_timWindow for having giving more memory to the scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8035
diff changeset
   628
      (*itStats).second.lastTtiBytesTrasmitted = 0;
3741b99462cd Update PfFfMacScheduler::m_timWindow for having giving more memory to the scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8035
diff changeset
   629
    }
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   630
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   631
  m_schedSapUser->SchedDlConfigInd (ret);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   632
7899
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
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   635
}
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
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   638
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
   639
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   640
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   641
  // TODO: Implementation of the API
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   642
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   643
}
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
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   646
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
   647
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   648
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   649
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   650
  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
   651
    {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   652
      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
   653
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   654
          // wideband CQI reporting
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   655
          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
   656
          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
   657
          it = m_p10CqiRxed.find (rnti);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   658
          if (it == m_p10CqiRxed.end ())
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
              // create the new entry
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   661
              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)
8311
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   662
              // generate correspondent timer
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   663
              m_p10CqiTimers.insert ( std::pair<uint16_t, uint32_t > (rnti, m_cqiTimersThreshold));
7899
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
          else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   666
            {
8311
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   667
              // update the CQI value and refresh correspondent timer
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   668
              (*it).second = params.m_cqiList.at (i).m_wbCqi.at (0);
8311
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   669
              // update correspondent timer
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   670
              std::map <uint16_t,uint32_t>::iterator itTimers;
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   671
              itTimers = m_p10CqiTimers.find (rnti);
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   672
              (*itTimers).second = m_cqiTimersThreshold;
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   673
            }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   674
        }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   675
      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
   676
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   677
          // subband CQI reporting high layer configured
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   678
          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
   679
          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
   680
          it = m_a30CqiRxed.find (rnti);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   681
          if (it == m_a30CqiRxed.end ())
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
              // create the new entry
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   684
              m_a30CqiRxed.insert ( std::pair<uint16_t, SbMeasResult_s > (rnti, params.m_cqiList.at (i).m_sbMeasResult) );
8311
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   685
              m_a30CqiTimers.insert ( std::pair<uint16_t, uint32_t > (rnti, m_cqiTimersThreshold));
7899
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
          else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   688
            {
8311
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   689
              // update the CQI value and refresh correspondent timer
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   690
              (*it).second = params.m_cqiList.at (i).m_sbMeasResult;
8311
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   691
              std::map <uint16_t,uint32_t>::iterator itTimers;
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   692
              itTimers = m_a30CqiTimers.find (rnti);
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   693
              (*itTimers).second = m_cqiTimersThreshold;
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   694
            }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   695
        }
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   696
      else
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   697
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   698
          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
   699
        }
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
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   702
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   703
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   704
8141
b3a8a85ee6f0 LENA-109 Uplink CQI support: introduced estimation of unkwnown CQI (average)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8133
diff changeset
   705
b3a8a85ee6f0 LENA-109 Uplink CQI support: introduced estimation of unkwnown CQI (average)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8133
diff changeset
   706
double
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   707
PfFfMacScheduler::EstimateUlSinr (uint16_t rnti, uint16_t rb)
8141
b3a8a85ee6f0 LENA-109 Uplink CQI support: introduced estimation of unkwnown CQI (average)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8133
diff changeset
   708
{
b3a8a85ee6f0 LENA-109 Uplink CQI support: introduced estimation of unkwnown CQI (average)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8133
diff changeset
   709
  std::map <uint16_t, std::vector <double> >::iterator itCqi = m_ueCqi.find (rnti);
b3a8a85ee6f0 LENA-109 Uplink CQI support: introduced estimation of unkwnown CQI (average)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8133
diff changeset
   710
  if (itCqi == m_ueCqi.end ())
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   711
    {
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   712
      // no cqi info about this UE
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   713
      return (NO_SINR);
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   714
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   715
    }
8141
b3a8a85ee6f0 LENA-109 Uplink CQI support: introduced estimation of unkwnown CQI (average)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8133
diff changeset
   716
  else
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   717
    {
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   718
      // take the average SINR value among the available
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   719
      double sinrSum = 0;
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   720
      int sinrNum = 0;
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   721
      for (uint32_t i = 0; i < m_cschedCellConfig.m_ulBandwidth; i++)
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   722
        {
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   723
          double sinr = (*itCqi).second.at (i);
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   724
          if (sinr != NO_SINR)
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   725
            {
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   726
              sinrSum += sinr;
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   727
              sinrNum++;
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   728
            }
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   729
        }
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   730
      double estimatedSinr = sinrSum / (double)sinrNum;
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   731
      // store the value
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   732
      (*itCqi).second.at (rb) = estimatedSinr;
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   733
      return (estimatedSinr);
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   734
    }
8141
b3a8a85ee6f0 LENA-109 Uplink CQI support: introduced estimation of unkwnown CQI (average)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8133
diff changeset
   735
}
b3a8a85ee6f0 LENA-109 Uplink CQI support: introduced estimation of unkwnown CQI (average)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8133
diff changeset
   736
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   737
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   738
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
   739
{
8264
e3a90cfb6ac2 Bug-fix LENA 172 bug on schedulers in uplink when UE has CQI = 0
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8182
diff changeset
   740
//   NS_LOG_FUNCTION (this << " Frame no. " << (params.m_sfnSf >> 4) << " subframe no. " << (0xF & params.m_sfnSf));
8080
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   741
 
8311
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
   742
  RefreshUlCqiMaps ();
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   743
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   744
  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
   745
  int nflows = 0;
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   746
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   747
  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
   748
    {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   749
      // 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
   750
      if ((*it).second > 0)
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   751
        {
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   752
          nflows++;
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   753
        }
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   754
    }
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   755
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   756
  if (nflows == 0)
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   757
    {
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   758
      return ; // no flows to be scheduled
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   759
    }
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   760
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   761
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   762
  // 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
   763
  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
   764
  if (rbPerFlow == 0)
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   765
    {
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   766
      rbPerFlow = 1;              // at least 1 rbg per flow (till available resource)
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   767
    }
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   768
  int rbAllocated = 0;
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   769
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   770
  FfMacSchedSapUser::SchedUlConfigIndParameters ret;
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   771
  std::vector <uint16_t> rbgAllocationMap;
8131
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   772
  std::map <uint16_t, pfsFlowPerf_t>::iterator itStats;
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   773
  if (m_nextRntiUl != 0)
8080
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   774
    {
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   775
      for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++)
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   776
        {
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   777
          if ((*it).first == m_nextRntiUl)
8080
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   778
            {
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   779
              break;
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   780
            }
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   781
        }
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   782
      if (it == m_ceBsrRxed.end ())
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   783
        {
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   784
          NS_LOG_ERROR (this << " no user found");
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   785
        }
8080
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   786
    }
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   787
  else
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   788
    {
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   789
      it = m_ceBsrRxed.begin ();
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   790
      m_nextRntiUl = (*it).first;
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   791
    }
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   792
  do
7899
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
      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
   795
        {
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   796
          // 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
   797
          rbPerFlow = m_cschedCellConfig.m_ulBandwidth - rbAllocated;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   798
        }
8264
e3a90cfb6ac2 Bug-fix LENA 172 bug on schedulers in uplink when UE has CQI = 0
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8182
diff changeset
   799
     
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   800
      UlDciListElement_s uldci;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   801
      uldci.m_rnti = (*it).first;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   802
      uldci.m_rbStart = rbAllocated;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   803
      uldci.m_rbLen = rbPerFlow;
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   804
      std::map <uint16_t, std::vector <double> >::iterator itCqi = m_ueCqi.find ((*it).first);
8080
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   805
      int cqi = 0;
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   806
      if (itCqi == m_ueCqi.end ())
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   807
        {
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   808
          // no cqi info about this UE
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   809
          uldci.m_mcs = 0; // MCS 0 -> UL-AMC TBD
8264
e3a90cfb6ac2 Bug-fix LENA 172 bug on schedulers in uplink when UE has CQI = 0
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8182
diff changeset
   810
//           NS_LOG_DEBUG (this << " UE does not have ULCQI " << (*it).first );
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   811
        }
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   812
      else
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   813
        {
8080
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   814
          // take the lowest CQI value (worst RB)
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   815
          double minSinr = (*itCqi).second.at (uldci.m_rbStart);
8141
b3a8a85ee6f0 LENA-109 Uplink CQI support: introduced estimation of unkwnown CQI (average)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8133
diff changeset
   816
          if (minSinr == NO_SINR)
b3a8a85ee6f0 LENA-109 Uplink CQI support: introduced estimation of unkwnown CQI (average)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8133
diff changeset
   817
            {
b3a8a85ee6f0 LENA-109 Uplink CQI support: introduced estimation of unkwnown CQI (average)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8133
diff changeset
   818
              minSinr = EstimateUlSinr ((*it).first, uldci.m_rbStart);
b3a8a85ee6f0 LENA-109 Uplink CQI support: introduced estimation of unkwnown CQI (average)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8133
diff changeset
   819
            }
8080
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   820
          for (uint16_t i = uldci.m_rbStart; i < uldci.m_rbStart + uldci.m_rbLen; i++)
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   821
            {
8264
e3a90cfb6ac2 Bug-fix LENA 172 bug on schedulers in uplink when UE has CQI = 0
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8182
diff changeset
   822
//               NS_LOG_DEBUG (this << " UE " << (*it).first << " has SINR " << (*itCqi).second.at(i));
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   823
              double sinr = (*itCqi).second.at (i);
8141
b3a8a85ee6f0 LENA-109 Uplink CQI support: introduced estimation of unkwnown CQI (average)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8133
diff changeset
   824
              if (sinr == NO_SINR)
b3a8a85ee6f0 LENA-109 Uplink CQI support: introduced estimation of unkwnown CQI (average)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8133
diff changeset
   825
                {
b3a8a85ee6f0 LENA-109 Uplink CQI support: introduced estimation of unkwnown CQI (average)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8133
diff changeset
   826
                  sinr = EstimateUlSinr ((*it).first, i);
b3a8a85ee6f0 LENA-109 Uplink CQI support: introduced estimation of unkwnown CQI (average)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8133
diff changeset
   827
                }
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   828
              if ((*itCqi).second.at (i) < minSinr)
8080
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   829
                {
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   830
                  minSinr = (*itCqi).second.at (i);
8080
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   831
                }
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   832
            }
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   833
8080
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   834
          // translate SINR -> cqi: WILD ACK: same as DL
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   835
          double s = log2 ( 1 + (
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   836
                              pow (10, minSinr / 10 )  /
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   837
                              ( (-log (5.0 * 0.00005 )) / 1.5) ));
8080
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   838
          cqi = LteAmc::GetCqiFromSpectralEfficiency (s);
7966
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   839
          if (cqi == 0)
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   840
            {
8080
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   841
              it++;
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   842
              if (it == m_ceBsrRxed.end ())
8080
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   843
                {
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   844
                  // restart from the first
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   845
                  it = m_ceBsrRxed.begin ();
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   846
                }
7966
c2cfb1a64d66 LENA-72 CQI=0 behaviour
Marco Miozzo <marco.miozzo@cttc.es>
parents: 7959
diff changeset
   847
              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
   848
            }
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   849
          uldci.m_mcs = LteAmc::GetMcsFromCqi (cqi);
8264
e3a90cfb6ac2 Bug-fix LENA 172 bug on schedulers in uplink when UE has CQI = 0
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8182
diff changeset
   850
//           NS_LOG_DEBUG (this << " UE " <<  (*it).first << " minsinr " << minSinr << " -> mcs " << (uint16_t)uldci.m_mcs);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   851
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   852
        }
8264
e3a90cfb6ac2 Bug-fix LENA 172 bug on schedulers in uplink when UE has CQI = 0
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8182
diff changeset
   853
      
e3a90cfb6ac2 Bug-fix LENA 172 bug on schedulers in uplink when UE has CQI = 0
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8182
diff changeset
   854
      rbAllocated += rbPerFlow;
e3a90cfb6ac2 Bug-fix LENA 172 bug on schedulers in uplink when UE has CQI = 0
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8182
diff changeset
   855
      // store info on allocation for managing ul-cqi interpretation
e3a90cfb6ac2 Bug-fix LENA 172 bug on schedulers in uplink when UE has CQI = 0
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8182
diff changeset
   856
      for (int i = 0; i < rbPerFlow; i++)
e3a90cfb6ac2 Bug-fix LENA 172 bug on schedulers in uplink when UE has CQI = 0
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8182
diff changeset
   857
        {
e3a90cfb6ac2 Bug-fix LENA 172 bug on schedulers in uplink when UE has CQI = 0
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8182
diff changeset
   858
          rbgAllocationMap.push_back ((*it).first);
e3a90cfb6ac2 Bug-fix LENA 172 bug on schedulers in uplink when UE has CQI = 0
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8182
diff changeset
   859
        }
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   860
      uldci.m_tbSize = (LteAmc::GetTbSizeFromMcs (uldci.m_mcs, rbPerFlow) / 8);
8264
e3a90cfb6ac2 Bug-fix LENA 172 bug on schedulers in uplink when UE has CQI = 0
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8182
diff changeset
   861
//       NS_LOG_DEBUG (this << " UE " << (*it).first << " startPRB " << (uint32_t)uldci.m_rbStart << " nPRB " << (uint32_t)uldci.m_rbLen << " CQI " << cqi << " MCS " << (uint32_t)uldci.m_mcs << " TBsize " << uldci.m_tbSize << " RbAlloc " << rbAllocated);
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   862
      uldci.m_ndi = 1;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   863
      uldci.m_cceIndex = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   864
      uldci.m_aggrLevel = 1;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   865
      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
   866
      uldci.m_hopping = false;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   867
      uldci.m_n2Dmrs = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   868
      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
   869
      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
   870
      uldci.m_ulIndex = 0; // TDD parameter
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   871
      uldci.m_dai = 1; // TDD parameter
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   872
      uldci.m_freqHopping = 0;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   873
      uldci.m_pdcchPowerOffset = 0; // not used
8080
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   874
      ret.m_dciList.push_back (uldci);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   875
8131
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   876
      // update TTI  UE stats
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   877
      itStats = m_flowStatsUl.find ((*it).first);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   878
      if (itStats != m_flowStatsUl.end ())
8131
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   879
        {
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   880
          (*itStats).second.lastTtiBytesTrasmitted =  uldci.m_tbSize;
8264
e3a90cfb6ac2 Bug-fix LENA 172 bug on schedulers in uplink when UE has CQI = 0
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8182
diff changeset
   881
//                     NS_LOG_DEBUG (this << " UE bytes txed " << (*it).second.lastTtiBytesTrasmitted);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   882
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   883
8131
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   884
        }
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   885
      else
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   886
        {
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   887
          NS_LOG_DEBUG (this << " No Stats for this allocated UE");
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   888
        }
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   889
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   890
8080
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   891
      it++;
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   892
      if (it == m_ceBsrRxed.end ())
8080
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   893
        {
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   894
          // restart from the first
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   895
          it = m_ceBsrRxed.begin ();
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   896
        }
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   897
      if (rbAllocated == m_cschedCellConfig.m_ulBandwidth)
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   898
        {
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   899
          // Stop allocation: no more PRBs
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   900
          m_nextRntiUl = (*it).first;
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   901
          break;
62d2fccef672 Refinements to RR and PF uplink scheduling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8047
diff changeset
   902
        }
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   903
    }
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   904
  while ((*it).first != m_nextRntiUl);
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   905
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   906
8131
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   907
  // Update global UE stats
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   908
  // update UEs stats
8133
ea0cd92de3bb PfFfMacScheduler::DoSchedUlTriggerReq fix bug m_flowStatsDl instead of m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8131
diff changeset
   909
  for (itStats = m_flowStatsUl.begin (); itStats != m_flowStatsUl.end (); itStats++)
8131
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   910
    {
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   911
      (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTrasmitted;
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   912
      // update average throughput (see eq. 12.3 of Sec 12.3.1.2 of LTE – The UMTS Long Term Evolution, Ed Wiley)
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   913
      (*itStats).second.lastAveragedThroughput = ((1.0 - (1.0 / m_timeWindow)) * (*itStats).second.lastAveragedThroughput) + ((1.0 / m_timeWindow) * (double)((*itStats).second.lastTtiBytesTrasmitted / 0.001));
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   914
      //       NS_LOG_DEBUG (this << " UE tot bytes " << (*itStats).second.totalBytesTransmitted);
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   915
      //       NS_LOG_DEBUG (this << " UE avg thr " << (*itStats).second.lastAveragedThroughput);
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   916
      (*itStats).second.lastTtiBytesTrasmitted = 0;
3a0422147f8a PfFfMacScheduler add m_flowStatsUl
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8080
diff changeset
   917
    }
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   918
  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
   919
  m_schedSapUser->SchedUlConfigInd (ret);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   920
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   921
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   922
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   923
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   924
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
   925
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   926
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   927
  // TODO: Implementation of the API
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   928
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   929
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   930
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   931
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   932
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
   933
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   934
  NS_LOG_FUNCTION (this);
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   935
  // TODO: Implementation of the API
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   936
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   937
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   938
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   939
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   940
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
   941
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   942
  NS_LOG_FUNCTION (this);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   943
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   944
  std::map <uint16_t,uint8_t>::iterator it;
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   945
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   946
  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
   947
    {
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   948
      if ( params.m_macCeList.at (i).m_macCeType == MacCeListElement_s::BSR )
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   949
        {
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   950
          // buffer status report
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   951
          uint16_t rnti = params.m_macCeList.at (i).m_rnti;
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   952
          it = m_ceBsrRxed.find (rnti);
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   953
          if (it == m_ceBsrRxed.end ())
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   954
            {
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   955
              // create the new entry
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   956
              uint8_t bsr = params.m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (0);
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   957
              m_ceBsrRxed.insert ( std::pair<uint16_t, uint8_t > (rnti, bsr)); // only 1 buffer status is working now
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   958
            }
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   959
          else
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   960
            {
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   961
              // update the CQI value
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   962
              (*it).second = params.m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (0);
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   963
            }
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   964
        }
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   965
    }
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   966
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   967
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   968
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   969
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   970
void
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   971
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
   972
{
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   973
  NS_LOG_FUNCTION (this);
8321
c674feef9d5f Bug-fix UL Allocation Map storing for UL-CQI
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8319
diff changeset
   974
//   NS_LOG_DEBUG (this << " RX SFNID " << params.m_sfnSf << " delay " << (uint32_t)m_schedTtiDelay);
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   975
  // correlate info on UL-CQIs with previous scheduling -> calculate m_sfnSf of transmission
8321
c674feef9d5f Bug-fix UL Allocation Map storing for UL-CQI
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8319
diff changeset
   976
  uint32_t frameNo = (0x3FF & (params.m_sfnSf >> 4));
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   977
  uint32_t subframeNo = (0xF & params.m_sfnSf);
8321
c674feef9d5f Bug-fix UL Allocation Map storing for UL-CQI
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8319
diff changeset
   978
//   NS_LOG_DEBUG (this << " sfn " << frameNo << " sbfn " << subframeNo);
c674feef9d5f Bug-fix UL Allocation Map storing for UL-CQI
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8319
diff changeset
   979
  if (subframeNo <= m_schedTtiDelay)
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   980
    {
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   981
      frameNo--;
8321
c674feef9d5f Bug-fix UL Allocation Map storing for UL-CQI
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8319
diff changeset
   982
      subframeNo = (10 + subframeNo - m_schedTtiDelay) % 11;
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   983
    }
8321
c674feef9d5f Bug-fix UL Allocation Map storing for UL-CQI
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8319
diff changeset
   984
  else
c674feef9d5f Bug-fix UL Allocation Map storing for UL-CQI
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8319
diff changeset
   985
    {
c674feef9d5f Bug-fix UL Allocation Map storing for UL-CQI
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8319
diff changeset
   986
      subframeNo = (subframeNo - m_schedTtiDelay) % 11;
c674feef9d5f Bug-fix UL Allocation Map storing for UL-CQI
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8319
diff changeset
   987
    }
8319
8b45a9d26c06 Bug-fix update frame number codification in sfnId scheduler parameter
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8311
diff changeset
   988
  uint16_t sfnSf = ((0x3FF & frameNo) << 4) | (0xF & subframeNo);
8321
c674feef9d5f Bug-fix UL Allocation Map storing for UL-CQI
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8319
diff changeset
   989
//   NS_LOG_DEBUG (this << " Actual sfn " << frameNo << " sbfn " << subframeNo << " sfnSf "  << sfnSf);
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   990
  // retrieve the allocation for this subframe
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   991
  std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7943
diff changeset
   992
  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
   993
  itMap = m_allocationMaps.find (sfnSf);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   994
  if (itMap == m_allocationMaps.end ())
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   995
    {
8321
c674feef9d5f Bug-fix UL Allocation Map storing for UL-CQI
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8319
diff changeset
   996
      NS_LOG_DEBUG (this << " Does not find info on allocation, size : " << m_allocationMaps.size ());
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   997
      return;
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
   998
    }
7943
db21a8048ab9 PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents: 7940
diff changeset
   999
  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
  1000
    {
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1001
      // convert from fixed point notation Sxxxxxxxxxxx.xxx to double
8311
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1002
//       NS_LOG_INFO (this << " i " << i << " size " << params.m_ulCqi.m_sinr.size () << " mapSIze " << (*itMap).second.size ());
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1003
      double sinr = LteFfConverter::fpS11dot3toDouble (params.m_ulCqi.m_sinr.at (i));
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1004
      //NS_LOG_DEBUG (this << " UE " << (*itMap).second.at (i) << " SINRfp " << params.m_ulCqi.m_sinr.at (i) << " sinrdb " << sinr);
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1005
      itCqi = m_ueCqi.find ((*itMap).second.at (i));
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1006
      if (itCqi == m_ueCqi.end ())
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1007
        {
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1008
          // create a new entry
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1009
          std::vector <double> newCqi;
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1010
          for (uint32_t j = 0; j < m_cschedCellConfig.m_ulBandwidth; j++)
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1011
            {
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1012
              if (i == j)
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1013
                {
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1014
                  newCqi.push_back (sinr);
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1015
                }
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1016
              else
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1017
                {
8141
b3a8a85ee6f0 LENA-109 Uplink CQI support: introduced estimation of unkwnown CQI (average)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8133
diff changeset
  1018
                  // initialize with NO_SINR value.
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1019
                  newCqi.push_back (NO_SINR);
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1020
                }
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1021
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1022
            }
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1023
          m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > ((*itMap).second.at (i), newCqi));
8311
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1024
          // generate correspondent timer
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1025
          m_ueCqiTimers.insert (std::pair <uint16_t, uint32_t > ((*itMap).second.at (i), m_cqiTimersThreshold));
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1026
        }
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1027
      else
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1028
        {
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1029
          // update the value
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1030
          (*itCqi).second.at (i) = sinr;
8311
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1031
          // update correspondent timer
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1032
          std::map <uint16_t, uint32_t>::iterator itTimers;
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1033
          itTimers = m_ueCqiTimers.find ((*itMap).second.at (i));
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1034
          (*itTimers).second = m_cqiTimersThreshold;
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1035
          
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1036
        }
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1037
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1038
    }
7948
7a7b4ad007b0 UL-CQI and AMC in RrFfMacScheduler
mmiozzo
parents: 7947
diff changeset
  1039
  // remove obsolete info on allocation
8321
c674feef9d5f Bug-fix UL Allocation Map storing for UL-CQI
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8319
diff changeset
  1040
  m_allocationMaps.erase (itMap);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8141
diff changeset
  1041
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
  1042
  return;
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
  1043
}
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
  1044
8311
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1045
void
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1046
PfFfMacScheduler::RefreshDlCqiMaps(void)
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1047
{
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1048
  // refresh DL CQI P01 Map
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1049
  std::map <uint16_t,uint32_t>::iterator itP10 = m_p10CqiTimers.begin ();
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1050
  while (itP10!=m_p10CqiTimers.end ())
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1051
    {
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1052
//       NS_LOG_INFO (this << " P10-CQI for user " << (*itP10).first << " is " << (uint32_t)(*itP10).second << " thr " << (uint32_t)m_cqiTimersThreshold);
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1053
      if ((*itP10).second == 0)
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1054
        {
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1055
          // delete correspondent entries
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1056
          std::map <uint16_t,uint8_t>::iterator itMap = m_p10CqiRxed.find ((*itP10).first);
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1057
          NS_ASSERT_MSG (itMap != m_p10CqiRxed.end (), " Does not find CQI report for user " << (*itP10).first);
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1058
          NS_LOG_INFO (this << " P10-CQI exired for user " << (*itP10).first);
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1059
          m_p10CqiRxed.erase (itMap);
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1060
          m_p10CqiTimers.erase (itP10);
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1061
        }
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1062
      else
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1063
        {
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1064
          (*itP10).second--;
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1065
        }
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1066
      itP10++;
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1067
    }
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1068
  
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1069
  // refresh DL CQI A30 Map
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1070
  std::map <uint16_t,uint32_t>::iterator itA30 = m_a30CqiTimers.begin ();
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1071
  while (itA30!=m_a30CqiTimers.end ())
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1072
    {
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1073
//       NS_LOG_INFO (this << " A30-CQI for user " << (*itA30).first << " is " << (uint32_t)(*itA30).second << " thr " << (uint32_t)m_cqiTimersThreshold);
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1074
      if ((*itA30).second == 0)
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1075
        {
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1076
          // delete correspondent entries
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1077
          std::map <uint16_t,SbMeasResult_s>::iterator itMap = m_a30CqiRxed.find ((*itA30).first);
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1078
          NS_ASSERT_MSG (itMap != m_a30CqiRxed.end (), " Does not find CQI report for user " << (*itA30).first);
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1079
          NS_LOG_INFO (this << " A30-CQI exired for user " << (*itA30).first);
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1080
          m_a30CqiRxed.erase (itMap);
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1081
          m_a30CqiTimers.erase (itA30);
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1082
        }
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1083
      else
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1084
        {
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1085
          (*itA30).second--;
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1086
        }
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1087
      itA30++;
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1088
    }
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1089
    
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1090
    return;
7899
6cde5b6879e1 add missed file of pf-ff-mac-scheduler
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
  1091
}
8311
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1092
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1093
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1094
void
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1095
PfFfMacScheduler::RefreshUlCqiMaps(void)
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1096
{
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1097
  // refresh UL CQI  Map
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1098
  std::map <uint16_t,uint32_t>::iterator itUl = m_ueCqiTimers.begin ();
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1099
  while (itUl!=m_ueCqiTimers.end ())
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1100
    {
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1101
//       NS_LOG_INFO (this << " UL-CQI for user " << (*itUl).first << " is " << (uint32_t)(*itUl).second << " thr " << (uint32_t)m_cqiTimersThreshold);
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1102
      if ((*itUl).second == 0)
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1103
        {
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1104
          // delete correspondent entries
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1105
          std::map <uint16_t, std::vector <double> >::iterator itMap = m_ueCqi.find ((*itUl).first);
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1106
          NS_ASSERT_MSG (itMap != m_ueCqi.end (), " Does not find CQI report for user " << (*itUl).first);
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1107
          NS_LOG_INFO (this << " UL-CQI exired for user " << (*itUl).first);
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1108
          (*itMap).second.clear ();
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1109
          m_ueCqi.erase (itMap);
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1110
          m_ueCqiTimers.erase (itUl);
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1111
        }
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1112
      else
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1113
        {
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1114
          (*itUl).second--;
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1115
        }
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1116
      itUl++;
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1117
    }
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1118
    
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1119
    return;
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1120
}
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1121
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1122
ec257b681d85 Address LENA-173: CQI refresh procedure introduced in Pf and Rr schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8264
diff changeset
  1123
}