author | Peter D. Barnes, Jr. <barnes26@llnl.gov> |
Fri, 26 Sep 2014 15:51:00 -0700 | |
changeset 10968 | 2d29fee2b7b8 |
parent 10892 | 3e86fac77082 |
child 11274 | 609de51c9b88 |
permissions | -rw-r--r-- |
10892
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
2 |
/* |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
3 |
* Copyright (c) 2014 Piotr Gawlowicz |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
4 |
* |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
8 |
* |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
13 |
* |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
17 |
* |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
18 |
* Author: Piotr Gawlowicz <gawlowicz.p@gmail.com> |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
19 |
* |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
20 |
*/ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
21 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
22 |
#include "lte-ffr-enhanced-algorithm.h" |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
23 |
#include "ns3/ff-mac-common.h" |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
24 |
#include "ns3/lte-common.h" |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
25 |
#include "ns3/lte-vendor-specific-parameters.h" |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
26 |
#include <ns3/log.h> |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
27 |
#include "ns3/boolean.h" |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
28 |
#include <ns3/double.h> |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
29 |
#include <cfloat> |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
30 |
|
10968
2d29fee2b7b8
[Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10892
diff
changeset
|
31 |
namespace ns3 { |
10892
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
32 |
|
10968
2d29fee2b7b8
[Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10892
diff
changeset
|
33 |
NS_LOG_COMPONENT_DEFINE ("LteFfrEnhancedAlgorithm"); |
10892
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
34 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
35 |
NS_OBJECT_ENSURE_REGISTERED (LteFfrEnhancedAlgorithm); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
36 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
37 |
static const double SpectralEfficiencyForCqi[16] = { |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
38 |
0.0, // out of range |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
39 |
0.15, 0.23, 0.38, 0.6, 0.88, 1.18, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
40 |
1.48, 1.91, 2.41, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
41 |
2.73, 3.32, 3.9, 4.52, 5.12, 5.55 |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
42 |
}; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
43 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
44 |
static const struct FfrEnhancedDownlinkDefaultConfiguration |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
45 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
46 |
uint8_t cellId; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
47 |
uint8_t dlBandwidth; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
48 |
uint8_t dlSubBandOffset; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
49 |
uint8_t dlReuse3SubBandwidth; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
50 |
uint8_t dlReuse1SubBandwidth; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
51 |
} g_ffrEnhancedDownlinkDefaultConfiguration[] = { |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
52 |
{ 1, 25, 0, 4, 4}, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
53 |
{ 2, 25, 8, 4, 4}, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
54 |
{ 3, 25, 16, 4, 4}, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
55 |
{ 1, 50, 0, 9, 6}, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
56 |
{ 2, 50, 15, 9, 6}, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
57 |
{ 3, 50, 30, 9, 6}, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
58 |
{ 1, 75, 0, 8, 16}, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
59 |
{ 2, 75, 24, 8, 16}, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
60 |
{ 3, 75, 48, 8, 16}, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
61 |
{ 1, 100, 0, 16, 16}, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
62 |
{ 2, 100, 32, 16, 16}, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
63 |
{ 3, 100, 64, 16, 16} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
64 |
}; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
65 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
66 |
static const struct FfrEnhancedUplinkDefaultConfiguration |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
67 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
68 |
uint8_t cellId; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
69 |
uint8_t ulBandwidth; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
70 |
uint8_t ulSubBandOffset; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
71 |
uint8_t ulReuse3SubBandwidth; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
72 |
uint8_t ulReuse1SubBandwidth; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
73 |
} g_ffrEnhancedUplinkDefaultConfiguration[] = { |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
74 |
{ 1, 25, 0, 4, 4}, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
75 |
{ 2, 25, 8, 4, 4}, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
76 |
{ 3, 25, 16, 4, 4}, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
77 |
{ 1, 50, 0, 9, 6}, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
78 |
{ 2, 50, 15, 9, 6}, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
79 |
{ 3, 50, 30, 9, 6}, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
80 |
{ 1, 75, 0, 8, 16}, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
81 |
{ 2, 75, 24, 8, 16}, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
82 |
{ 3, 75, 48, 8, 16}, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
83 |
{ 1, 100, 0, 16, 16}, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
84 |
{ 2, 100, 32, 16, 16}, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
85 |
{ 3, 100, 64, 16, 16} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
86 |
}; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
87 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
88 |
const uint16_t NUM_DOWNLINK_CONFS (sizeof (g_ffrEnhancedDownlinkDefaultConfiguration) / sizeof (FfrEnhancedDownlinkDefaultConfiguration)); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
89 |
const uint16_t NUM_UPLINK_CONFS (sizeof (g_ffrEnhancedUplinkDefaultConfiguration) / sizeof (FfrEnhancedUplinkDefaultConfiguration)); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
90 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
91 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
92 |
LteFfrEnhancedAlgorithm::LteFfrEnhancedAlgorithm () |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
93 |
: m_ffrSapUser (0), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
94 |
m_ffrRrcSapUser (0), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
95 |
m_measId (0) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
96 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
97 |
NS_LOG_FUNCTION (this); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
98 |
m_ffrSapProvider = new MemberLteFfrSapProvider<LteFfrEnhancedAlgorithm> (this); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
99 |
m_ffrRrcSapProvider = new MemberLteFfrRrcSapProvider<LteFfrEnhancedAlgorithm> (this); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
100 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
101 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
102 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
103 |
LteFfrEnhancedAlgorithm::~LteFfrEnhancedAlgorithm () |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
104 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
105 |
NS_LOG_FUNCTION (this); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
106 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
107 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
108 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
109 |
void |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
110 |
LteFfrEnhancedAlgorithm::DoDispose () |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
111 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
112 |
NS_LOG_FUNCTION (this); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
113 |
delete m_ffrSapProvider; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
114 |
delete m_ffrRrcSapProvider; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
115 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
116 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
117 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
118 |
TypeId |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
119 |
LteFfrEnhancedAlgorithm::GetTypeId () |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
120 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
121 |
static TypeId tid = TypeId ("ns3::LteFfrEnhancedAlgorithm") |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
122 |
.SetParent<LteFfrAlgorithm> () |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
123 |
.AddConstructor<LteFfrEnhancedAlgorithm> () |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
124 |
.AddAttribute ("UlSubBandOffset", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
125 |
"Uplink SubBand Offset for this cell in number of Resource Block Groups", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
126 |
UintegerValue (0), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
127 |
MakeUintegerAccessor (&LteFfrEnhancedAlgorithm::m_ulSubBandOffset), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
128 |
MakeUintegerChecker<uint8_t> ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
129 |
.AddAttribute ("UlReuse3SubBandwidth", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
130 |
"Uplink Reuse 3 SubBandwidth Configuration in number of Resource Block Groups", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
131 |
UintegerValue (4), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
132 |
MakeUintegerAccessor (&LteFfrEnhancedAlgorithm::m_ulReuse3SubBandwidth), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
133 |
MakeUintegerChecker<uint8_t> ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
134 |
.AddAttribute ("UlReuse1SubBandwidth", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
135 |
"Uplink Reuse 1 SubBandwidth Configuration in number of Resource Block Groups", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
136 |
UintegerValue (4), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
137 |
MakeUintegerAccessor (&LteFfrEnhancedAlgorithm::m_ulReuse1SubBandwidth), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
138 |
MakeUintegerChecker<uint8_t> ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
139 |
.AddAttribute ("DlSubBandOffset", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
140 |
"Downlink SubBand Offset for this cell in number of Resource Block Groups", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
141 |
UintegerValue (0), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
142 |
MakeUintegerAccessor (&LteFfrEnhancedAlgorithm::m_dlSubBandOffset), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
143 |
MakeUintegerChecker<uint8_t> ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
144 |
.AddAttribute ("DlReuse3SubBandwidth", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
145 |
"Downlink Reuse 3 SubBandwidth Configuration in number of Resource Block Groups", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
146 |
UintegerValue (4), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
147 |
MakeUintegerAccessor (&LteFfrEnhancedAlgorithm::m_dlReuse3SubBandwidth), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
148 |
MakeUintegerChecker<uint8_t> ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
149 |
.AddAttribute ("DlReuse1SubBandwidth", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
150 |
"Downlink Reuse 1 SubBandwidth Configuration in number of Resource Block Groups", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
151 |
UintegerValue (4), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
152 |
MakeUintegerAccessor (&LteFfrEnhancedAlgorithm::m_dlReuse1SubBandwidth), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
153 |
MakeUintegerChecker<uint8_t> ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
154 |
.AddAttribute ("RsrqThreshold", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
155 |
"If the RSRQ of is worse than this threshold, UE should be served in Edge sub-band", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
156 |
UintegerValue (26), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
157 |
MakeUintegerAccessor (&LteFfrEnhancedAlgorithm::m_rsrqThreshold), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
158 |
MakeUintegerChecker<uint8_t> ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
159 |
.AddAttribute ("CenterAreaPowerOffset", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
160 |
"PdschConfigDedicated::Pa value for Center Sub-band, default value dB0", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
161 |
UintegerValue (5), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
162 |
MakeUintegerAccessor (&LteFfrEnhancedAlgorithm::m_centerAreaPowerOffset), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
163 |
MakeUintegerChecker<uint8_t> ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
164 |
.AddAttribute ("EdgeAreaPowerOffset", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
165 |
"PdschConfigDedicated::Pa value for Edge Sub-band, default value dB0", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
166 |
UintegerValue (5), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
167 |
MakeUintegerAccessor (&LteFfrEnhancedAlgorithm::m_edgeAreaPowerOffset), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
168 |
MakeUintegerChecker<uint8_t> ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
169 |
.AddAttribute ("DlCqiThreshold", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
170 |
"If the DL-CQI for RBG of is higher than this threshold, transmission on RBG is possible", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
171 |
UintegerValue (15), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
172 |
MakeUintegerAccessor (&LteFfrEnhancedAlgorithm::m_dlCqiThreshold), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
173 |
MakeUintegerChecker<uint8_t> ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
174 |
.AddAttribute ("UlCqiThreshold", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
175 |
"If the UL-CQI for RBG of is higher than this threshold, transmission on RBG is possible", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
176 |
UintegerValue (15), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
177 |
MakeUintegerAccessor (&LteFfrEnhancedAlgorithm::m_ulCqiThreshold), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
178 |
MakeUintegerChecker <uint8_t> ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
179 |
.AddAttribute ("CenterAreaTpc", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
180 |
"TPC value which will be set in DL-DCI for UEs in center area" |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
181 |
"Absolute mode is used, default value 1 is mapped to -1 according to" |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
182 |
"TS36.213 Table 5.1.1.1-2", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
183 |
UintegerValue (1), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
184 |
MakeUintegerAccessor (&LteFfrEnhancedAlgorithm::m_centerAreaTpc), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
185 |
MakeUintegerChecker<uint8_t> ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
186 |
.AddAttribute ("EdgeAreaTpc", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
187 |
"TPC value which will be set in DL-DCI for UEs in edge area" |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
188 |
"Absolute mode is used, default value 1 is mapped to -1 according to" |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
189 |
"TS36.213 Table 5.1.1.1-2", |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
190 |
UintegerValue (1), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
191 |
MakeUintegerAccessor (&LteFfrEnhancedAlgorithm::m_edgeAreaTpc), |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
192 |
MakeUintegerChecker<uint8_t> ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
193 |
; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
194 |
return tid; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
195 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
196 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
197 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
198 |
void |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
199 |
LteFfrEnhancedAlgorithm::SetLteFfrSapUser (LteFfrSapUser* s) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
200 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
201 |
NS_LOG_FUNCTION (this << s); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
202 |
m_ffrSapUser = s; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
203 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
204 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
205 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
206 |
LteFfrSapProvider* |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
207 |
LteFfrEnhancedAlgorithm::GetLteFfrSapProvider () |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
208 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
209 |
NS_LOG_FUNCTION (this); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
210 |
return m_ffrSapProvider; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
211 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
212 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
213 |
void |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
214 |
LteFfrEnhancedAlgorithm::SetLteFfrRrcSapUser (LteFfrRrcSapUser* s) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
215 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
216 |
NS_LOG_FUNCTION (this << s); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
217 |
m_ffrRrcSapUser = s; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
218 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
219 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
220 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
221 |
LteFfrRrcSapProvider* |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
222 |
LteFfrEnhancedAlgorithm::GetLteFfrRrcSapProvider () |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
223 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
224 |
NS_LOG_FUNCTION (this); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
225 |
return m_ffrRrcSapProvider; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
226 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
227 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
228 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
229 |
void |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
230 |
LteFfrEnhancedAlgorithm::DoInitialize () |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
231 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
232 |
NS_LOG_FUNCTION (this); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
233 |
LteFfrAlgorithm::DoInitialize (); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
234 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
235 |
NS_ASSERT_MSG (m_dlBandwidth > 24,"DlBandwidth must be at least 25 to use EFFR algorithm"); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
236 |
NS_ASSERT_MSG (m_ulBandwidth > 24,"UlBandwidth must be at least 25 to use EFFR algorithm"); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
237 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
238 |
if (m_frCellTypeId != 0) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
239 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
240 |
SetDownlinkConfiguration (m_frCellTypeId, m_dlBandwidth); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
241 |
SetUplinkConfiguration (m_frCellTypeId, m_ulBandwidth); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
242 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
243 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
244 |
NS_LOG_LOGIC (this << " requesting Event A1 measurements" |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
245 |
<< " (threshold = 0" << ")"); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
246 |
LteRrcSap::ReportConfigEutra reportConfig; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
247 |
reportConfig.eventId = LteRrcSap::ReportConfigEutra::EVENT_A1; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
248 |
reportConfig.threshold1.choice = LteRrcSap::ThresholdEutra::THRESHOLD_RSRQ; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
249 |
reportConfig.threshold1.range = 0; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
250 |
reportConfig.triggerQuantity = LteRrcSap::ReportConfigEutra::RSRQ; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
251 |
reportConfig.reportInterval = LteRrcSap::ReportConfigEutra::MS120; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
252 |
m_measId = m_ffrRrcSapUser->AddUeMeasReportConfigForFfr (reportConfig); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
253 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
254 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
255 |
void |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
256 |
LteFfrEnhancedAlgorithm::Reconfigure () |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
257 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
258 |
NS_LOG_FUNCTION (this); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
259 |
if (m_frCellTypeId != 0) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
260 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
261 |
SetDownlinkConfiguration (m_frCellTypeId, m_dlBandwidth); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
262 |
SetUplinkConfiguration (m_frCellTypeId, m_ulBandwidth); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
263 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
264 |
InitializeDownlinkRbgMaps (); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
265 |
InitializeUplinkRbgMaps (); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
266 |
m_needReconfiguration = false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
267 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
268 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
269 |
void |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
270 |
LteFfrEnhancedAlgorithm::SetDownlinkConfiguration (uint16_t cellId, uint8_t bandwidth) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
271 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
272 |
NS_LOG_FUNCTION (this); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
273 |
for (uint16_t i = 0; i < NUM_DOWNLINK_CONFS; ++i) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
274 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
275 |
if ((g_ffrEnhancedDownlinkDefaultConfiguration[i].cellId == cellId) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
276 |
&& g_ffrEnhancedDownlinkDefaultConfiguration[i].dlBandwidth == m_dlBandwidth) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
277 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
278 |
m_dlSubBandOffset = g_ffrEnhancedDownlinkDefaultConfiguration[i].dlSubBandOffset; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
279 |
m_dlReuse3SubBandwidth = g_ffrEnhancedDownlinkDefaultConfiguration[i].dlReuse3SubBandwidth; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
280 |
m_dlReuse1SubBandwidth = g_ffrEnhancedDownlinkDefaultConfiguration[i].dlReuse1SubBandwidth; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
281 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
282 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
283 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
284 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
285 |
void |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
286 |
LteFfrEnhancedAlgorithm::SetUplinkConfiguration (uint16_t cellId, uint8_t bandwidth) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
287 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
288 |
NS_LOG_FUNCTION (this); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
289 |
for (uint16_t i = 0; i < NUM_UPLINK_CONFS; ++i) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
290 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
291 |
if ((g_ffrEnhancedUplinkDefaultConfiguration[i].cellId == cellId) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
292 |
&& g_ffrEnhancedUplinkDefaultConfiguration[i].ulBandwidth == m_ulBandwidth) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
293 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
294 |
m_ulSubBandOffset = g_ffrEnhancedUplinkDefaultConfiguration[i].ulSubBandOffset; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
295 |
m_ulReuse3SubBandwidth = g_ffrEnhancedUplinkDefaultConfiguration[i].ulReuse3SubBandwidth; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
296 |
m_ulReuse1SubBandwidth = g_ffrEnhancedUplinkDefaultConfiguration[i].ulReuse1SubBandwidth; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
297 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
298 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
299 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
300 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
301 |
int |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
302 |
LteFfrEnhancedAlgorithm::GetCqiFromSpectralEfficiency (double s) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
303 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
304 |
NS_LOG_FUNCTION (s); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
305 |
NS_ASSERT_MSG (s >= 0.0, "negative spectral efficiency = " << s); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
306 |
int cqi = 0; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
307 |
while ((cqi < 15) && (SpectralEfficiencyForCqi[cqi + 1] < s)) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
308 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
309 |
++cqi; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
310 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
311 |
NS_LOG_LOGIC ("cqi = " << cqi); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
312 |
return cqi; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
313 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
314 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
315 |
void |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
316 |
LteFfrEnhancedAlgorithm::InitializeDownlinkRbgMaps () |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
317 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
318 |
m_dlRbgMap.clear (); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
319 |
m_dlReuse3RbgMap.clear (); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
320 |
m_dlReuse1RbgMap.clear (); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
321 |
m_dlPrimarySegmentRbgMap.clear (); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
322 |
m_dlSecondarySegmentRbgMap.clear (); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
323 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
324 |
int rbgSize = GetRbgSize (m_dlBandwidth); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
325 |
m_dlRbgMap.resize (m_dlBandwidth / rbgSize, true); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
326 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
327 |
m_dlReuse3RbgMap.resize (m_dlBandwidth / rbgSize, false); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
328 |
m_dlReuse1RbgMap.resize (m_dlBandwidth / rbgSize, false); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
329 |
m_dlPrimarySegmentRbgMap.resize (m_dlBandwidth / rbgSize, false); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
330 |
m_dlSecondarySegmentRbgMap.resize (m_dlBandwidth / rbgSize, true); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
331 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
332 |
NS_ASSERT_MSG (m_dlSubBandOffset <= m_dlBandwidth,"DlSubBandOffset higher than DlBandwidth"); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
333 |
NS_ASSERT_MSG (m_dlSubBandOffset + m_dlReuse3SubBandwidth + m_dlReuse1SubBandwidth <= m_dlBandwidth, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
334 |
"DlSubBandOffset + DlReuse3SubBandwidth + DlReuse1SubBandwidth higher than DlBandwidth"); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
335 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
336 |
for (uint8_t i = 0; i < m_dlReuse3SubBandwidth / rbgSize; i++) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
337 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
338 |
int offset = m_dlSubBandOffset / rbgSize; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
339 |
uint8_t index = offset + i; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
340 |
m_dlReuse3RbgMap[index] = true; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
341 |
m_dlPrimarySegmentRbgMap[index] = true; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
342 |
m_dlRbgMap[index] = false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
343 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
344 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
345 |
for (uint8_t i = 0; i < m_dlReuse1SubBandwidth / rbgSize; i++) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
346 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
347 |
int offset = (m_dlSubBandOffset + m_dlReuse3SubBandwidth) / rbgSize; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
348 |
uint8_t index = offset + i; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
349 |
m_dlReuse1RbgMap[index] = true; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
350 |
m_dlPrimarySegmentRbgMap[index] = true; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
351 |
m_dlSecondarySegmentRbgMap[index] = false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
352 |
m_dlRbgMap[index] = false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
353 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
354 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
355 |
for (uint8_t i = 0; i < m_dlReuse3SubBandwidth / rbgSize; i++) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
356 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
357 |
uint8_t offset = (m_dlReuse3SubBandwidth + m_dlReuse1SubBandwidth) / rbgSize; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
358 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
359 |
uint8_t index = 0 * offset + i; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
360 |
m_dlSecondarySegmentRbgMap[index] = false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
361 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
362 |
index = 1 * offset + i; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
363 |
m_dlSecondarySegmentRbgMap[index] = false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
364 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
365 |
index = 2 * offset + i; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
366 |
m_dlSecondarySegmentRbgMap[index] = false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
367 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
368 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
369 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
370 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
371 |
void |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
372 |
LteFfrEnhancedAlgorithm::InitializeUplinkRbgMaps () |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
373 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
374 |
m_ulRbgMap.clear (); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
375 |
m_ulReuse3RbgMap.clear (); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
376 |
m_ulReuse1RbgMap.clear (); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
377 |
m_ulPrimarySegmentRbgMap.clear (); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
378 |
m_ulSecondarySegmentRbgMap.clear (); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
379 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
380 |
if (!m_enabledInUplink) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
381 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
382 |
m_ulRbgMap.resize (m_ulBandwidth, false); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
383 |
return; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
384 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
385 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
386 |
m_ulRbgMap.resize (m_ulBandwidth, true); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
387 |
m_ulReuse3RbgMap.resize (m_ulBandwidth, false); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
388 |
m_ulReuse1RbgMap.resize (m_ulBandwidth, false); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
389 |
m_ulPrimarySegmentRbgMap.resize (m_ulBandwidth, false); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
390 |
m_ulSecondarySegmentRbgMap.resize (m_ulBandwidth, true); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
391 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
392 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
393 |
NS_ASSERT_MSG (m_ulSubBandOffset <= m_ulBandwidth, "UlSubBandOffset higher than UlBandwidth"); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
394 |
NS_ASSERT_MSG (m_ulSubBandOffset + m_ulReuse3SubBandwidth + m_ulReuse1SubBandwidth <= m_ulBandwidth, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
395 |
"UlSubBandOffset + UlReuse3SubBandwidth + UlReuse1SubBandwidth higher than UlBandwidth"); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
396 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
397 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
398 |
for (uint8_t i = 0; i < m_ulReuse3SubBandwidth; i++) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
399 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
400 |
int offset = m_ulSubBandOffset; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
401 |
uint8_t index = offset + i; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
402 |
m_ulReuse3RbgMap[index] = true; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
403 |
m_ulPrimarySegmentRbgMap[index] = true; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
404 |
m_ulRbgMap[index] = false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
405 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
406 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
407 |
for (uint8_t i = 0; i < m_ulReuse1SubBandwidth; i++) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
408 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
409 |
int offset = (m_ulSubBandOffset + m_ulReuse3SubBandwidth); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
410 |
uint8_t index = offset + i; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
411 |
m_ulReuse1RbgMap[index] = true; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
412 |
m_ulPrimarySegmentRbgMap[index] = true; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
413 |
m_ulSecondarySegmentRbgMap[index] = false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
414 |
m_ulRbgMap[index] = false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
415 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
416 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
417 |
for (uint8_t i = 0; i < m_ulReuse3SubBandwidth; i++) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
418 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
419 |
uint8_t offset = m_ulReuse3SubBandwidth + m_ulReuse1SubBandwidth; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
420 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
421 |
uint8_t index = 0 * offset + i; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
422 |
m_ulSecondarySegmentRbgMap[index] = false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
423 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
424 |
index = 1 * offset + i; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
425 |
m_ulSecondarySegmentRbgMap[index] = false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
426 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
427 |
index = 2 * offset + i; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
428 |
m_ulSecondarySegmentRbgMap[index] = false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
429 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
430 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
431 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
432 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
433 |
std::vector <bool> |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
434 |
LteFfrEnhancedAlgorithm::DoGetAvailableDlRbg () |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
435 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
436 |
NS_LOG_FUNCTION (this); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
437 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
438 |
if (m_needReconfiguration) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
439 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
440 |
Reconfigure (); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
441 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
442 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
443 |
if (m_dlRbgMap.empty ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
444 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
445 |
InitializeDownlinkRbgMaps (); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
446 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
447 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
448 |
std::vector <bool> rbgMap = m_dlRbgMap; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
449 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
450 |
std::map <uint16_t, std::vector<bool> >::iterator it; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
451 |
for (it = m_dlRbgAvailableforUe.begin (); it != m_dlRbgAvailableforUe.end (); it++) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
452 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
453 |
NS_LOG_INFO ("RNTI : " << it->first); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
454 |
std::vector<bool> rbgAvailableMap = it->second; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
455 |
for (uint32_t i = 0; i < rbgMap.size (); i++) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
456 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
457 |
NS_LOG_INFO ("\t rbgId: " << i << " available " << (int)rbgAvailableMap.at (i)); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
458 |
if ( rbgAvailableMap.at (i) == true) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
459 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
460 |
rbgMap.at (i) = false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
461 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
462 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
463 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
464 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
465 |
return rbgMap; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
466 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
467 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
468 |
bool |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
469 |
LteFfrEnhancedAlgorithm::DoIsDlRbgAvailableForUe (int rbgId, uint16_t rnti) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
470 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
471 |
NS_LOG_FUNCTION (this); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
472 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
473 |
bool isReuse3Rbg = m_dlReuse3RbgMap[rbgId]; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
474 |
bool isReuse1Rbg = m_dlReuse1RbgMap[rbgId]; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
475 |
bool isPrimarySegmentRbg = m_dlPrimarySegmentRbgMap[rbgId]; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
476 |
bool isSecondarySegmentRbg = m_dlSecondarySegmentRbgMap[rbgId]; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
477 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
478 |
std::map< uint16_t, uint8_t >::iterator it = m_ues.find (rnti); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
479 |
if (it == m_ues.end ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
480 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
481 |
m_ues.insert (std::pair< uint16_t, uint8_t > (rnti, AreaUnset)); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
482 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
483 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
484 |
it = m_ues.find (rnti); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
485 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
486 |
//if UE area is unknown, serve UE in edge area RBGs |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
487 |
if (it->second == AreaUnset) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
488 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
489 |
return isReuse3Rbg; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
490 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
491 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
492 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
493 |
bool isCenterUe = false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
494 |
bool isEdgeUe = false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
495 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
496 |
if (it->second == CenterArea ) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
497 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
498 |
isCenterUe = true; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
499 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
500 |
else if (it->second == EdgeArea) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
501 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
502 |
isEdgeUe = true; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
503 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
504 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
505 |
if (isPrimarySegmentRbg) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
506 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
507 |
NS_LOG_INFO ("PRIMARY SEGMENT RNTI: " << rnti << " rbgId: " << rbgId ); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
508 |
return (isReuse1Rbg && isCenterUe) || (isReuse3Rbg && isEdgeUe); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
509 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
510 |
else if (isSecondarySegmentRbg && isCenterUe) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
511 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
512 |
//check if RB can be used by UE based on CQI information |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
513 |
NS_LOG_INFO ("SECONDARY SEGMENT RNTI: " << rnti << " rbgId: " << rbgId ); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
514 |
std::map <uint16_t, std::vector<bool> >::iterator it = m_dlRbgAvailableforUe.find (rnti); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
515 |
if (it != m_dlRbgAvailableforUe.end ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
516 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
517 |
NS_LOG_INFO ("RNTI: " << rnti << " rbgId: " << rbgId << " available: " << it->second.at (rbgId)); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
518 |
if (it->second.at (rbgId) == true) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
519 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
520 |
return true; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
521 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
522 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
523 |
return false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
524 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
525 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
526 |
return false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
527 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
528 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
529 |
std::vector <bool> |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
530 |
LteFfrEnhancedAlgorithm::DoGetAvailableUlRbg () |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
531 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
532 |
NS_LOG_FUNCTION (this); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
533 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
534 |
if (m_ulRbgMap.empty ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
535 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
536 |
InitializeUplinkRbgMaps (); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
537 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
538 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
539 |
if (!m_enabledInUplink) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
540 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
541 |
return m_ulRbgMap; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
542 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
543 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
544 |
std::vector <bool> rbgMap = m_ulRbgMap; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
545 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
546 |
std::map <uint16_t, std::vector<bool> >::iterator it; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
547 |
for (it = m_ulRbAvailableforUe.begin (); it != m_ulRbAvailableforUe.end (); it++) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
548 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
549 |
NS_LOG_INFO ("RNTI : " << it->first); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
550 |
std::vector<bool> rbAvailableMap = it->second; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
551 |
for (uint32_t i = 0; i < rbgMap.size (); i++) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
552 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
553 |
NS_LOG_INFO ("\t rbgId: " << i << " available " << (int)rbAvailableMap.at (i)); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
554 |
if ( rbAvailableMap.at (i) == true) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
555 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
556 |
rbgMap.at (i) = false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
557 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
558 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
559 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
560 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
561 |
return rbgMap; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
562 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
563 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
564 |
bool |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
565 |
LteFfrEnhancedAlgorithm::DoIsUlRbgAvailableForUe (int rbgId, uint16_t rnti) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
566 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
567 |
NS_LOG_FUNCTION (this); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
568 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
569 |
if (!m_enabledInUplink) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
570 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
571 |
return true; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
572 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
573 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
574 |
bool isReuse3Rbg = m_ulReuse3RbgMap[rbgId]; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
575 |
bool isReuse1Rbg = m_ulReuse1RbgMap[rbgId]; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
576 |
bool isPrimarySegmentRbg = m_ulPrimarySegmentRbgMap[rbgId]; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
577 |
bool isSecondarySegmentRbg = m_ulSecondarySegmentRbgMap[rbgId]; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
578 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
579 |
std::map< uint16_t, uint8_t >::iterator it = m_ues.find (rnti); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
580 |
if (it == m_ues.end ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
581 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
582 |
m_ues.insert (std::pair< uint16_t, uint8_t > (rnti, AreaUnset)); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
583 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
584 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
585 |
it = m_ues.find (rnti); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
586 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
587 |
//if UE area is unknown, serve UE in edge area RBGs |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
588 |
if (it->second == AreaUnset) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
589 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
590 |
return isReuse3Rbg; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
591 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
592 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
593 |
bool isCenterUe = false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
594 |
bool isEdgeUe = false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
595 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
596 |
if (it->second == CenterArea ) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
597 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
598 |
isCenterUe = true; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
599 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
600 |
else if (it->second == EdgeArea) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
601 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
602 |
isEdgeUe = true; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
603 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
604 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
605 |
if (isPrimarySegmentRbg) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
606 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
607 |
return (isReuse1Rbg && isCenterUe) || (isReuse3Rbg && isEdgeUe); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
608 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
609 |
else if (isSecondarySegmentRbg && isCenterUe) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
610 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
611 |
//check if RB can be used by UE based on CQI information |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
612 |
NS_LOG_INFO ("UL SECONDARY SEGMENT RNTI: " << rnti << " rbgId: " << rbgId ); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
613 |
std::map <uint16_t, std::vector<bool> >::iterator it = m_ulRbAvailableforUe.find (rnti); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
614 |
if (it != m_ulRbAvailableforUe.end ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
615 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
616 |
NS_LOG_INFO ("RNTI: " << rnti << " rbgId: " << rbgId << " available: " << it->second.at (rbgId)); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
617 |
if (it->second.at (rbgId) == true) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
618 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
619 |
return true; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
620 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
621 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
622 |
return false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
623 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
624 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
625 |
return false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
626 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
627 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
628 |
void |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
629 |
LteFfrEnhancedAlgorithm::DoReportDlCqiInfo (const struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters& params) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
630 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
631 |
NS_LOG_FUNCTION (this); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
632 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
633 |
m_dlCqi.clear (); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
634 |
for (unsigned int i = 0; i < params.m_cqiList.size (); i++) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
635 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
636 |
if ( params.m_cqiList.at (i).m_cqiType == CqiListElement_s::A30 ) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
637 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
638 |
NS_LOG_INFO ("subband CQI reporting high layer configured"); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
639 |
// subband CQI reporting high layer configured |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
640 |
std::map <uint16_t,SbMeasResult_s>::iterator it; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
641 |
uint16_t rnti = params.m_cqiList.at (i).m_rnti; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
642 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
643 |
std::map< uint16_t, uint8_t >::iterator ueIt = m_ues.find (rnti); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
644 |
if (ueIt != m_ues.end ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
645 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
646 |
if (ueIt->second != CenterArea ) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
647 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
648 |
continue; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
649 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
650 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
651 |
else |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
652 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
653 |
continue; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
654 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
655 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
656 |
it = m_dlCqi.find (rnti); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
657 |
if (it == m_dlCqi.end ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
658 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
659 |
// create the new entry |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
660 |
m_dlCqi.insert ( std::pair<uint16_t, SbMeasResult_s > (rnti, params.m_cqiList.at (i).m_sbMeasResult) ); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
661 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
662 |
else |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
663 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
664 |
// update the CQI value and refresh correspondent timer |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
665 |
(*it).second = params.m_cqiList.at (i).m_sbMeasResult; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
666 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
667 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
668 |
else |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
669 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
670 |
NS_LOG_ERROR (this << " CQI type unknown"); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
671 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
672 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
673 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
674 |
uint32_t rbgSize = GetRbgSize (m_dlBandwidth); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
675 |
m_dlRbgAvailableforUe.clear (); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
676 |
std::map <uint16_t,SbMeasResult_s>::iterator it; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
677 |
for (it = m_dlCqi.begin (); it != m_dlCqi.end (); it++) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
678 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
679 |
uint16_t rnti = it->first; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
680 |
std::vector<bool> rbgAvailableMap; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
681 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
682 |
for (uint32_t i = 0; i < (*it).second.m_higherLayerSelected.size (); i++) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
683 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
684 |
uint8_t rbgCqi = (*it).second.m_higherLayerSelected.at (i).m_sbCqi.at (0); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
685 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
686 |
if (i > m_dlBandwidth / rbgSize) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
687 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
688 |
continue; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
689 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
690 |
NS_LOG_INFO (this << " RNTI " << rnti << " RBG " << i << " DL-CQI: " << (int)rbgCqi); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
691 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
692 |
bool rbgAvailable = (rbgCqi > m_dlCqiThreshold) ? true : false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
693 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
694 |
bool isSecondarySegmentRbg = false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
695 |
if (i < m_dlSecondarySegmentRbgMap.size ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
696 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
697 |
isSecondarySegmentRbg = m_dlSecondarySegmentRbgMap[i]; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
698 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
699 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
700 |
rbgAvailable = (isSecondarySegmentRbg == true) ? rbgAvailable : false; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
701 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
702 |
rbgAvailableMap.push_back (rbgAvailable); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
703 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
704 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
705 |
m_dlRbgAvailableforUe.insert ( std::pair<uint16_t, std::vector<bool> > (rnti, rbgAvailableMap ) ); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
706 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
707 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
708 |
m_ulRbAvailableforUe.clear (); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
709 |
for (std::map<uint16_t, std::vector<bool> >::iterator it = m_dlRbgAvailableforUe.begin (); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
710 |
it != m_dlRbgAvailableforUe.end (); it++) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
711 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
712 |
uint16_t rnti = it->first; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
713 |
std::vector<bool> dlRbgAvailableMap = it->second; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
714 |
std::vector<bool> ulRbAvailableMap; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
715 |
ulRbAvailableMap.resize (m_ulBandwidth, false); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
716 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
717 |
for (uint32_t j = 0; j < dlRbgAvailableMap.size (); j++) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
718 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
719 |
uint32_t index = rbgSize * j; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
720 |
for (uint32_t i = 0; i < rbgSize; i++) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
721 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
722 |
index = index + i; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
723 |
ulRbAvailableMap[index] = dlRbgAvailableMap[j]; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
724 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
725 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
726 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
727 |
m_ulRbAvailableforUe.insert ( std::pair<uint16_t, std::vector<bool> > (rnti, ulRbAvailableMap ) ); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
728 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
729 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
730 |
return; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
731 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
732 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
733 |
void |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
734 |
LteFfrEnhancedAlgorithm::DoReportUlCqiInfo (const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters& params) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
735 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
736 |
NS_LOG_FUNCTION (this); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
737 |
if (params.m_ulCqi.m_type == UlCqi_s::SRS) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
738 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
739 |
// get the RNTI from vendor specific parameters |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
740 |
uint16_t rnti = 0; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
741 |
for (uint32_t j = 0; j < m_ulBandwidth; j++) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
742 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
743 |
double sinr = LteFfConverter::fpS11dot3toDouble (params.m_ulCqi.m_sinr.at (j)); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
744 |
double s = log2 ( 1 + ( |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
745 |
std::pow (10, sinr / 10 ) / |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
746 |
( (-std::log (5.0 * 0.00005 )) / 1.5) )); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
747 |
int cqi = GetCqiFromSpectralEfficiency (s); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
748 |
NS_LOG_INFO (this << " RNTI " << rnti << " new SRS-CQI for RB " << j << " value " << sinr << " UL-CQI: " << cqi); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
749 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
750 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
751 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
752 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
753 |
void |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
754 |
LteFfrEnhancedAlgorithm::DoReportUlCqiInfo ( std::map <uint16_t, std::vector <double> > ulCqiMap ) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
755 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
756 |
NS_LOG_FUNCTION (this); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
757 |
NS_LOG_WARN ("Method should not be called, because it is empty"); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
758 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
759 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
760 |
double |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
761 |
LteFfrEnhancedAlgorithm::EstimateUlSinr (uint16_t rnti, uint16_t rb, std::map <uint16_t, std::vector <double> > ulCqiMap) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
762 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
763 |
std::map <uint16_t, std::vector <double> >::iterator itCqi = ulCqiMap.find (rnti); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
764 |
if (itCqi == ulCqiMap.end ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
765 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
766 |
// no cqi info about this UE |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
767 |
return (NO_SINR); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
768 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
769 |
else |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
770 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
771 |
// take the average SINR value among the available |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
772 |
double sinrSum = 0; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
773 |
int sinrNum = 0; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
774 |
for (uint32_t i = 0; i < m_ulBandwidth; i++) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
775 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
776 |
double sinr = (*itCqi).second.at (i); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
777 |
if (sinr != NO_SINR) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
778 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
779 |
sinrSum += sinr; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
780 |
sinrNum++; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
781 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
782 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
783 |
double estimatedSinr = (sinrNum > 0) ? (sinrSum / sinrNum) : DBL_MAX; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
784 |
// store the value |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
785 |
(*itCqi).second.at (rb) = estimatedSinr; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
786 |
return (estimatedSinr); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
787 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
788 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
789 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
790 |
uint8_t |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
791 |
LteFfrEnhancedAlgorithm::DoGetTpc (uint16_t rnti) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
792 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
793 |
NS_LOG_FUNCTION (this); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
794 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
795 |
if (!m_enabledInUplink) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
796 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
797 |
return 1; // 1 is mapped to 0 for Accumulated mode, and to -1 in Absolute mode TS36.213 Table 5.1.1.1-2 |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
798 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
799 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
800 |
//TS36.213 Table 5.1.1.1-2 |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
801 |
// TPC | Accumulated Mode | Absolute Mode |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
802 |
//------------------------------------------------ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
803 |
// 0 | -1 | -4 |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
804 |
// 1 | 0 | -1 |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
805 |
// 2 | 1 | 1 |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
806 |
// 3 | 3 | 4 |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
807 |
//------------------------------------------------ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
808 |
// here Absolute mode is used |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
809 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
810 |
std::map< uint16_t, uint8_t >::iterator it = m_ues.find (rnti); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
811 |
if (it == m_ues.end ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
812 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
813 |
return 1; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
814 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
815 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
816 |
if (it->second == EdgeArea ) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
817 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
818 |
return m_edgeAreaTpc; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
819 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
820 |
else |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
821 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
822 |
return m_centerAreaTpc; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
823 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
824 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
825 |
return 1; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
826 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
827 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
828 |
uint8_t |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
829 |
LteFfrEnhancedAlgorithm::DoGetMinContinuousUlBandwidth () |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
830 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
831 |
NS_LOG_FUNCTION (this); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
832 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
833 |
uint8_t minContinuousUlBandwidth = m_ulBandwidth; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
834 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
835 |
if (!m_enabledInUplink) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
836 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
837 |
return minContinuousUlBandwidth; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
838 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
839 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
840 |
minContinuousUlBandwidth = |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
841 |
((m_ulReuse3SubBandwidth > 0 ) && (m_ulReuse3SubBandwidth < minContinuousUlBandwidth)) ? m_ulReuse3SubBandwidth : minContinuousUlBandwidth; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
842 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
843 |
minContinuousUlBandwidth = |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
844 |
((m_ulReuse1SubBandwidth > 0 ) && (m_ulReuse1SubBandwidth < minContinuousUlBandwidth)) ? m_ulReuse1SubBandwidth : minContinuousUlBandwidth; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
845 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
846 |
NS_LOG_INFO ("minContinuousUlBandwidth: " << (int)minContinuousUlBandwidth); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
847 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
848 |
return minContinuousUlBandwidth; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
849 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
850 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
851 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
852 |
void |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
853 |
LteFfrEnhancedAlgorithm::DoReportUeMeas (uint16_t rnti, |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
854 |
LteRrcSap::MeasResults measResults) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
855 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
856 |
NS_LOG_FUNCTION (this << rnti << (uint16_t) measResults.measId); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
857 |
NS_LOG_INFO ("RNTI :" << rnti << " MeasId: " << (uint16_t) measResults.measId |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
858 |
<< " RSRP: " << (uint16_t)measResults.rsrpResult |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
859 |
<< " RSRQ: " << (uint16_t)measResults.rsrqResult); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
860 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
861 |
if (measResults.measId != m_measId) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
862 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
863 |
NS_LOG_WARN ("Ignoring measId " << (uint16_t) measResults.measId); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
864 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
865 |
else |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
866 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
867 |
std::map< uint16_t, uint8_t >::iterator it = m_ues.find (rnti); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
868 |
if (it == m_ues.end ()) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
869 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
870 |
m_ues.insert (std::pair< uint16_t, uint8_t > (rnti, AreaUnset)); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
871 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
872 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
873 |
it = m_ues.find (rnti); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
874 |
if (measResults.rsrqResult < m_rsrqThreshold) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
875 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
876 |
if (it->second != EdgeArea) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
877 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
878 |
NS_LOG_INFO ("UE RNTI: " << rnti << " will be served in Edge sub-band"); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
879 |
it->second = EdgeArea; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
880 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
881 |
LteRrcSap::PdschConfigDedicated pdschConfigDedicated; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
882 |
pdschConfigDedicated.pa = m_edgeAreaPowerOffset; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
883 |
m_ffrRrcSapUser->SetPdschConfigDedicated (rnti, pdschConfigDedicated); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
884 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
885 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
886 |
else |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
887 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
888 |
if (it->second != CenterArea) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
889 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
890 |
NS_LOG_INFO ("UE RNTI: " << rnti << " will be served in Center sub-band"); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
891 |
it->second = CenterArea; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
892 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
893 |
LteRrcSap::PdschConfigDedicated pdschConfigDedicated; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
894 |
pdschConfigDedicated.pa = m_centerAreaPowerOffset; |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
895 |
m_ffrRrcSapUser->SetPdschConfigDedicated (rnti, pdschConfigDedicated); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
896 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
897 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
898 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
899 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
900 |
void |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
901 |
LteFfrEnhancedAlgorithm::DoRecvLoadInformation (EpcX2Sap::LoadInformationParams params) |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
902 |
{ |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
903 |
NS_LOG_FUNCTION (this); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
904 |
NS_LOG_WARN ("Method should not be called, because it is empty"); |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
905 |
} |
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
906 |
|
3e86fac77082
GSoC 2014 FFR algorithms
Piotr Gawlowicz <gawlowicz.p@gmail.com>
parents:
diff
changeset
|
907 |
} // end of namespace ns3 |