Left: | ||
Right: |
OLD | NEW |
---|---|
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2015 Danilo Abrignani | 3 * Copyright (c) 2015 Danilo Abrignani |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
54 tid = | 54 tid = |
55 TypeId ("ns3::CcHelper") | 55 TypeId ("ns3::CcHelper") |
56 .SetParent<Object> () | 56 .SetParent<Object> () |
57 .AddConstructor<CcHelper> () | 57 .AddConstructor<CcHelper> () |
58 .AddAttribute ("NumberOfComponentCarriers", | 58 .AddAttribute ("NumberOfComponentCarriers", |
59 "Set the number of Component Carriers to setup per eNodeB" | 59 "Set the number of Component Carriers to setup per eNodeB" |
60 "Currently the maximum Number of Component Carriers allowed i s 2", | 60 "Currently the maximum Number of Component Carriers allowed i s 2", |
61 UintegerValue (1), | 61 UintegerValue (1), |
62 MakeUintegerAccessor (&CcHelper::m_numberOfComponentCarriers) , | 62 MakeUintegerAccessor (&CcHelper::m_numberOfComponentCarriers) , |
63 MakeUintegerChecker<uint16_t> (MIN_CC, MAX_CC)) | 63 MakeUintegerChecker<uint16_t> (MIN_CC, MAX_CC)) |
64 .AddAttribute ("UlFreq", | 64 .AddAttribute ("UlEarfcn", |
65 "Set Ul Channel [EARFCN] for the first carrier component", | 65 "Set Ul Channel [EARFCN] for the first carrier component", |
66 UintegerValue (0), | 66 UintegerValue (0), |
67 MakeUintegerAccessor (&CcHelper::m_ulEarfcn), | 67 MakeUintegerAccessor (&CcHelper::m_ulEarfcn), |
68 MakeUintegerChecker<uint32_t> ()) | 68 MakeUintegerChecker<uint32_t> ()) |
69 .AddAttribute ("DlFreq", | 69 .AddAttribute ("DlEarfcn", |
70 "Set Dl Channel [EARFCN] for the first carrier component", | 70 "Set Dl Channel [EARFCN] for the first carrier component", |
71 UintegerValue (0), | 71 UintegerValue (0), |
72 MakeUintegerAccessor (&CcHelper::m_dlEarfcn), | 72 MakeUintegerAccessor (&CcHelper::m_dlEarfcn), |
73 MakeUintegerChecker<uint32_t> (0)) | 73 MakeUintegerChecker<uint32_t> (0)) |
74 .AddAttribute ("DlBandwidth", | 74 .AddAttribute ("DlBandwidth", |
75 "Set Dl Bandwidth for the first carrier component", | 75 "Set Dl Bandwidth for the first carrier component", |
76 UintegerValue (25), | 76 UintegerValue (25), |
77 MakeUintegerAccessor (&CcHelper::m_dlBandwidth), | 77 MakeUintegerAccessor (&CcHelper::m_dlBandwidth), |
78 MakeUintegerChecker<uint16_t> (0,100)) | 78 MakeUintegerChecker<uint16_t> (0,100)) |
79 .AddAttribute ("UlBandwidth", | 79 .AddAttribute ("UlBandwidth", |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
168 } | 168 } |
169 | 169 |
170 std::map< uint8_t, ComponentCarrier > | 170 std::map< uint8_t, ComponentCarrier > |
171 CcHelper::EquallySpacedCcs () | 171 CcHelper::EquallySpacedCcs () |
172 { | 172 { |
173 std::map< uint8_t, ComponentCarrier > ccmap; | 173 std::map< uint8_t, ComponentCarrier > ccmap; |
174 | 174 |
175 for (uint8_t i = 0; i < m_numberOfComponentCarriers; i++) | 175 for (uint8_t i = 0; i < m_numberOfComponentCarriers; i++) |
176 { | 176 { |
177 bool pc =false; | 177 bool pc =false; |
178 uint32_t ul = m_ulEarfcn + i * m_ulBandwidth; | 178 |
Biljana Bojović
2017/06/27 17:13:50
I agree with your approach. But I would change the
ilabdsf
2017/06/30 12:25:33
Thanks, I will fix it and some test for 6RB case t
| |
179 uint32_t dl = m_dlEarfcn + i * m_dlBandwidth; | 179 // One RB is 200 kHz wide, while increment by 1 in corresponds to 100 kHz shift |
zorazeali
2017/07/04 14:53:03
I think the other way to do this is by following t
| |
180 // Therefore, we need to multiply by 2 here. | |
181 uint32_t ul = m_ulEarfcn + i * 2 * m_ulBandwidth; | |
182 uint32_t dl = m_dlEarfcn + i * 2 * m_dlBandwidth; | |
180 if (i == 0) | 183 if (i == 0) |
181 { | 184 { |
182 pc = true; | 185 pc = true; |
183 } | 186 } |
184 ComponentCarrier cc = CreateSingleCc (m_ulBandwidth, m_dlBandwidth, ul, dl , pc); | 187 ComponentCarrier cc = CreateSingleCc (m_ulBandwidth, m_dlBandwidth, ul, dl , pc); |
185 ccmap.insert (std::pair<uint8_t, ComponentCarrier >(i, cc)); | 188 ccmap.insert (std::pair<uint8_t, ComponentCarrier >(i, cc)); |
186 | 189 |
187 NS_LOG_INFO(" ulBandwidth:"<<m_ulBandwidth<<" , dlBandwidth: "<<m_dlBandwi dth<<" , ul:"<<ul<<" , dl:"<<dl); | 190 NS_LOG_INFO(" ulBandwidth:"<<m_ulBandwidth<<" , dlBandwidth: "<<m_dlBandwi dth<<" , ul:"<<ul<<" , dl:"<<dl); |
188 } | 191 } |
189 | 192 |
(...skipping 25 matching lines...) Expand all Loading... | |
215 cc.SetUlBandwidth (ulBandwidth); | 218 cc.SetUlBandwidth (ulBandwidth); |
216 | 219 |
217 cc.SetAsPrimary (isPrimary); | 220 cc.SetAsPrimary (isPrimary); |
218 | 221 |
219 return cc; | 222 return cc; |
220 | 223 |
221 | 224 |
222 } | 225 } |
223 | 226 |
224 } // namespace ns3 | 227 } // namespace ns3 |
OLD | NEW |