LEFT | RIGHT |
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) 2014 Piotr Gawlowicz | 3 * Copyright (c) 2014 Piotr Gawlowicz |
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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 } | 192 } |
193 InitializeDownlinkRbgMaps (); | 193 InitializeDownlinkRbgMaps (); |
194 InitializeUplinkRbgMaps (); | 194 InitializeUplinkRbgMaps (); |
195 m_needReconfiguration = false; | 195 m_needReconfiguration = false; |
196 } | 196 } |
197 | 197 |
198 void | 198 void |
199 LteFfrDistributedAlgorithm::SetDownlinkConfiguration (uint16_t cellId, uint8_t b
andwidth) | 199 LteFfrDistributedAlgorithm::SetDownlinkConfiguration (uint16_t cellId, uint8_t b
andwidth) |
200 { | 200 { |
201 NS_LOG_FUNCTION (this); | 201 NS_LOG_FUNCTION (this); |
202 NS_UNUSED(cellId); | 202 NS_UNUSED (cellId); |
203 NS_UNUSED(bandwidth); | 203 NS_UNUSED (bandwidth); |
204 } | 204 } |
205 | 205 |
206 void | 206 void |
207 LteFfrDistributedAlgorithm::SetUplinkConfiguration (uint16_t cellId, uint8_t ban
dwidth) | 207 LteFfrDistributedAlgorithm::SetUplinkConfiguration (uint16_t cellId, uint8_t ban
dwidth) |
208 { | 208 { |
209 NS_LOG_FUNCTION (this); | 209 NS_LOG_FUNCTION (this); |
210 NS_UNUSED(cellId); | 210 NS_UNUSED (cellId); |
211 NS_UNUSED(bandwidth); | 211 NS_UNUSED (bandwidth); |
212 } | 212 } |
213 | 213 |
214 void | 214 void |
215 LteFfrDistributedAlgorithm::InitializeDownlinkRbgMaps () | 215 LteFfrDistributedAlgorithm::InitializeDownlinkRbgMaps () |
216 { | 216 { |
217 NS_LOG_FUNCTION (this); | 217 NS_LOG_FUNCTION (this); |
218 m_dlRbgMap.clear (); | 218 m_dlRbgMap.clear (); |
219 int rbgSize = GetRbgSize (m_dlBandwidth); | 219 int rbgSize = GetRbgSize (m_dlBandwidth); |
220 m_dlRbgMap.resize (m_dlBandwidth / rbgSize, false); | 220 m_dlRbgMap.resize (m_dlBandwidth / rbgSize, false); |
221 } | 221 } |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 } | 308 } |
309 | 309 |
310 return (edgeRbg && edgeUe) || (!edgeRbg && !edgeUe); | 310 return (edgeRbg && edgeUe) || (!edgeRbg && !edgeUe); |
311 } | 311 } |
312 | 312 |
313 void | 313 void |
314 LteFfrDistributedAlgorithm::DoReportDlCqiInfo (const struct FfMacSchedSapProvide
r::SchedDlCqiInfoReqParameters& params) | 314 LteFfrDistributedAlgorithm::DoReportDlCqiInfo (const struct FfMacSchedSapProvide
r::SchedDlCqiInfoReqParameters& params) |
315 { | 315 { |
316 NS_LOG_FUNCTION (this); | 316 NS_LOG_FUNCTION (this); |
317 NS_LOG_WARN ("Method should not be called, because it is empty"); | 317 NS_LOG_WARN ("Method should not be called, because it is empty"); |
318 NS_UNUSED(params); | 318 NS_UNUSED (params); |
319 } | 319 } |
320 | 320 |
321 void | 321 void |
322 LteFfrDistributedAlgorithm::DoReportUlCqiInfo (const struct FfMacSchedSapProvide
r::SchedUlCqiInfoReqParameters& params) | 322 LteFfrDistributedAlgorithm::DoReportUlCqiInfo (const struct FfMacSchedSapProvide
r::SchedUlCqiInfoReqParameters& params) |
323 { | 323 { |
324 NS_LOG_FUNCTION (this); | 324 NS_LOG_FUNCTION (this); |
325 NS_LOG_WARN ("Method should not be called, because it is empty"); | 325 NS_LOG_WARN ("Method should not be called, because it is empty"); |
326 NS_UNUSED(params); | 326 NS_UNUSED (params); |
327 } | 327 } |
328 | 328 |
329 void | 329 void |
330 LteFfrDistributedAlgorithm::DoReportUlCqiInfo (std::map <uint16_t, std::vector <
double> > ulCqiMap) | 330 LteFfrDistributedAlgorithm::DoReportUlCqiInfo (std::map <uint16_t, std::vector <
double> > ulCqiMap) |
331 { | 331 { |
332 NS_LOG_FUNCTION (this); | 332 NS_LOG_FUNCTION (this); |
333 NS_LOG_WARN ("Method should not be called, because it is empty"); | 333 NS_LOG_WARN ("Method should not be called, because it is empty"); |
334 } | 334 } |
335 | 335 |
336 uint8_t | 336 uint8_t |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 NS_LOG_WARN ("Ignoring measId " << (uint16_t) measResults.measId); | 480 NS_LOG_WARN ("Ignoring measId " << (uint16_t) measResults.measId); |
481 } | 481 } |
482 } | 482 } |
483 | 483 |
484 void | 484 void |
485 LteFfrDistributedAlgorithm::Calculate () | 485 LteFfrDistributedAlgorithm::Calculate () |
486 { | 486 { |
487 NS_LOG_FUNCTION (this); | 487 NS_LOG_FUNCTION (this); |
488 m_calculationEvent = Simulator::Schedule (m_calculationInterval, &LteFfrDistri
butedAlgorithm::Calculate, this); | 488 m_calculationEvent = Simulator::Schedule (m_calculationInterval, &LteFfrDistri
butedAlgorithm::Calculate, this); |
489 | 489 |
490 int rbgSize = GetRbgSize (m_dlBandwidth); | 490 uint16_t rbgSize = static_cast<uint16_t> (GetRbgSize (m_dlBandwidth)); |
491 uint16_t rbgNum = static_cast<uint16_t>(m_dlBandwidth / rbgSize); | 491 uint16_t rbgNum = m_dlBandwidth / rbgSize; |
492 | 492 |
493 m_cellWeightMap.clear (); | 493 m_cellWeightMap.clear (); |
494 m_dlEdgeRbgMap.clear (); | 494 m_dlEdgeRbgMap.clear (); |
495 m_dlEdgeRbgMap.resize (m_dlBandwidth / rbgSize, false); | 495 m_dlEdgeRbgMap.resize (m_dlBandwidth / rbgSize, false); |
496 m_ulEdgeRbgMap.clear (); | 496 m_ulEdgeRbgMap.clear (); |
497 m_ulEdgeRbgMap.resize (m_ulBandwidth, false); | 497 m_ulEdgeRbgMap.resize (m_ulBandwidth, false); |
498 | 498 |
499 MeasurementTable_t::iterator it1; | 499 MeasurementTable_t::iterator it1; |
500 MeasurementRow_t::iterator it2; | 500 MeasurementRow_t::iterator it2; |
501 Ptr<UeMeasure> servingCellMeasures; | 501 Ptr<UeMeasure> servingCellMeasures; |
502 Ptr<UeMeasure> neighbourCellMeasures; | 502 Ptr<UeMeasure> neighbourCellMeasures; |
503 | 503 |
504 uint32_t edgeUeNum = 0; | 504 uint32_t edgeUeNum = 0; |
505 std::map< uint16_t, uint8_t >::iterator areaIt; | 505 for (std::map< uint16_t, uint8_t >::iterator areaIt = m_ues.begin (); areaIt !
= m_ues.end (); areaIt++) |
506 for (areaIt = m_ues.begin (); areaIt != m_ues.end (); areaIt++) | |
507 { | 506 { |
508 if (areaIt->second == EdgeArea) | 507 if (areaIt->second == EdgeArea) |
509 { | 508 { |
510 edgeUeNum++; | 509 edgeUeNum++; |
511 } | 510 } |
512 } | 511 } |
513 | 512 |
514 if (edgeUeNum != 0) | 513 if (edgeUeNum != 0) |
515 { | 514 { |
516 for (it1 = m_ueMeasures.begin (); it1 != m_ueMeasures.end (); it1++) | 515 for (it1 = m_ueMeasures.begin (); it1 != m_ueMeasures.end (); it1++) |
517 { | 516 { |
518 std::map< uint16_t, uint8_t >::iterator areaIt1 = m_ues.find (it1->fir
st); | 517 std::map< uint16_t, uint8_t >::iterator areaIt = m_ues.find (it1->firs
t); |
519 if (areaIt1->second != EdgeArea) | 518 if (areaIt->second != EdgeArea) |
520 { | 519 { |
521 continue; | 520 continue; |
522 } | 521 } |
523 | 522 |
524 servingCellMeasures = 0; | 523 servingCellMeasures = 0; |
525 neighbourCellMeasures = 0; | 524 neighbourCellMeasures = 0; |
526 | 525 |
527 it2 = it1->second.find (m_cellId); | 526 it2 = it1->second.find (m_cellId); |
528 if (it2 != it1->second.end ()) | 527 if (it2 != it1->second.end ()) |
529 { | 528 { |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 cellMeasures = Create<UeMeasure> (); | 708 cellMeasures = Create<UeMeasure> (); |
710 cellMeasures->m_cellId = cellId; | 709 cellMeasures->m_cellId = cellId; |
711 cellMeasures->m_rsrp = rsrp; | 710 cellMeasures->m_rsrp = rsrp; |
712 cellMeasures->m_rsrq = rsrq; | 711 cellMeasures->m_rsrq = rsrq; |
713 it1->second[cellId] = cellMeasures; | 712 it1->second[cellId] = cellMeasures; |
714 } | 713 } |
715 | 714 |
716 } // end of UpdateNeighbourMeasurements | 715 } // end of UpdateNeighbourMeasurements |
717 | 716 |
718 } // end of namespace ns3 | 717 } // end of namespace ns3 |
LEFT | RIGHT |