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) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) | 3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
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 |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with this program; if not, write to the Free Software | 15 * along with this program; if not, write to the Free Software |
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 * | 17 * |
18 * Author: Marco Miozzo <marco.miozzo@cttc.es> | 18 * Author: Marco Miozzo <marco.miozzo@cttc.es> |
19 */ | 19 */ |
20 | 20 |
21 #include <iostream> | 21 #include <iostream> |
22 #include <sstream> | 22 #include <sstream> |
23 #include <string> | 23 #include <string> |
24 | |
25 #include <ns3/object.h> | 24 #include <ns3/object.h> |
26 #include <ns3/spectrum-interference.h> | 25 #include <ns3/spectrum-interference.h> |
27 #include <ns3/spectrum-error-model.h> | 26 #include <ns3/spectrum-error-model.h> |
28 #include <ns3/log.h> | 27 #include <ns3/log.h> |
29 #include <ns3/test.h> | 28 #include <ns3/test.h> |
30 #include <ns3/simulator.h> | 29 #include <ns3/simulator.h> |
31 #include <ns3/packet.h> | 30 #include <ns3/packet.h> |
32 #include <ns3/ptr.h> | 31 #include <ns3/ptr.h> |
33 #include <iostream> | |
34 #include "ns3/radio-bearer-stats-calculator.h" | 32 #include "ns3/radio-bearer-stats-calculator.h" |
35 #include <ns3/mobility-building-info.h> | 33 #include <ns3/mobility-building-info.h> |
36 #include <ns3/buildings-propagation-loss-model.h> | 34 #include <ns3/buildings-propagation-loss-model.h> |
37 #include <ns3/eps-bearer.h> | 35 #include <ns3/eps-bearer.h> |
38 #include <ns3/node-container.h> | 36 #include <ns3/node-container.h> |
39 #include <ns3/mobility-helper.h> | 37 #include <ns3/mobility-helper.h> |
40 #include <ns3/net-device-container.h> | 38 #include <ns3/net-device-container.h> |
41 #include <ns3/lte-ue-net-device.h> | 39 #include <ns3/lte-ue-net-device.h> |
42 #include <ns3/lte-enb-net-device.h> | 40 #include <ns3/lte-enb-net-device.h> |
43 #include <ns3/lte-ue-rrc.h> | 41 #include <ns3/lte-ue-rrc.h> |
44 #include <ns3/lte-helper.h> | 42 #include <ns3/lte-helper.h> |
45 #include "ns3/string.h" | 43 #include "ns3/string.h" |
46 #include "ns3/double.h" | 44 #include "ns3/double.h" |
47 #include <ns3/lte-enb-phy.h> | 45 #include <ns3/lte-enb-phy.h> |
48 #include <ns3/lte-ue-phy.h> | 46 #include <ns3/lte-ue-phy.h> |
49 #include <ns3/boolean.h> | 47 #include <ns3/boolean.h> |
50 #include <ns3/rr-ff-mac-scheduler.h> | 48 #include <ns3/rr-ff-mac-scheduler.h> |
51 #include <ns3/pf-ff-mac-scheduler.h> | 49 #include <ns3/pf-ff-mac-scheduler.h> |
52 #include <ns3/pointer.h> | 50 #include <ns3/pointer.h> |
53 #include <ns3/enum.h> | 51 #include <ns3/enum.h> |
54 #include <ns3/buildings-helper.h> | 52 #include <ns3/buildings-helper.h> |
55 | |
56 #include "lte-test-mimo.h" | 53 #include "lte-test-mimo.h" |
57 | 54 |
58 | 55 |
59 using namespace ns3; | 56 using namespace ns3; |
60 | 57 |
61 NS_LOG_COMPONENT_DEFINE ("LteTestMimo"); | 58 NS_LOG_COMPONENT_DEFINE ("LteTestMimo"); |
62 | 59 |
63 LenaTestMimoSuite::LenaTestMimoSuite () | 60 LenaTestMimoSuite::LenaTestMimoSuite () |
64 : TestSuite ("lte-mimo", SYSTEM) | 61 : TestSuite ("lte-mimo", SYSTEM) |
65 { | 62 { |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 enbNetDev->GetCcMap()[0]->GetAttribute ("FfMacScheduler", ptrval); | 198 enbNetDev->GetCcMap()[0]->GetAttribute ("FfMacScheduler", ptrval); |
202 Ptr<PfFfMacScheduler> pfsched; | 199 Ptr<PfFfMacScheduler> pfsched; |
203 Ptr<RrFfMacScheduler> rrsched; | 200 Ptr<RrFfMacScheduler> rrsched; |
204 if (m_schedulerType.compare ("ns3::RrFfMacScheduler") == 0) | 201 if (m_schedulerType.compare ("ns3::RrFfMacScheduler") == 0) |
205 { | 202 { |
206 rrsched = ptrval.Get<RrFfMacScheduler> (); | 203 rrsched = ptrval.Get<RrFfMacScheduler> (); |
207 if (rrsched == 0) | 204 if (rrsched == 0) |
208 { | 205 { |
209 NS_FATAL_ERROR ("No RR Scheduler available"); | 206 NS_FATAL_ERROR ("No RR Scheduler available"); |
210 } | 207 } |
211 Simulator::Schedule (Seconds (0.2), &RrFfMacScheduler::TransmissionModeCon
figurationUpdate, rrsched, rnti, static_cast<uint8_t>(1)); | 208 Simulator::Schedule (Seconds (0.2), &RrFfMacScheduler::TransmissionModeCon
figurationUpdate, rrsched, rnti, static_cast<uint8_t> (1)); |
212 Simulator::Schedule (Seconds (0.4), &RrFfMacScheduler::TransmissionModeCon
figurationUpdate, rrsched, rnti, static_cast<uint8_t>(2)); | 209 Simulator::Schedule (Seconds (0.4), &RrFfMacScheduler::TransmissionModeCon
figurationUpdate, rrsched, rnti, static_cast<uint8_t> (2)); |
213 } | 210 } |
214 else if (m_schedulerType.compare ("ns3::PfFfMacScheduler") == 0) | 211 else if (m_schedulerType.compare ("ns3::PfFfMacScheduler") == 0) |
215 { | 212 { |
216 pfsched = ptrval.Get<PfFfMacScheduler> (); | 213 pfsched = ptrval.Get<PfFfMacScheduler> (); |
217 if (pfsched == 0) | 214 if (pfsched == 0) |
218 { | 215 { |
219 NS_FATAL_ERROR ("No Pf Scheduler available"); | 216 NS_FATAL_ERROR ("No Pf Scheduler available"); |
220 } | 217 } |
221 ······ | 218 ······ |
222 Simulator::Schedule (Seconds (0.2), &PfFfMacScheduler::TransmissionModeCon
figurationUpdate, pfsched, rnti, static_cast<uint8_t>(1)); | 219 Simulator::Schedule (Seconds (0.2), &PfFfMacScheduler::TransmissionModeCon
figurationUpdate, pfsched, rnti, static_cast<uint8_t> (1)); |
223 Simulator::Schedule (Seconds (0.4), &PfFfMacScheduler::TransmissionModeCon
figurationUpdate, pfsched, rnti, static_cast<uint8_t>(2)); | 220 Simulator::Schedule (Seconds (0.4), &PfFfMacScheduler::TransmissionModeCon
figurationUpdate, pfsched, rnti, static_cast<uint8_t> (2)); |
224 } | 221 } |
225 else | 222 else |
226 { | 223 { |
227 NS_FATAL_ERROR ("Scheduler not supported by this test"); | 224 NS_FATAL_ERROR ("Scheduler not supported by this test"); |
228 } | 225 } |
229 ···· | 226 ···· |
230 ·· | 227 ·· |
231 Ptr<RadioBearerStatsCalculator> rlcStats = lteHelper->GetRlcStats (); | 228 Ptr<RadioBearerStatsCalculator> rlcStats = lteHelper->GetRlcStats (); |
232 rlcStats->SetAttribute ("EpochDuration", TimeValue (Seconds (0.1))); | 229 rlcStats->SetAttribute ("EpochDuration", TimeValue (Seconds (0.1))); |
233 | 230 |
(...skipping 22 matching lines...) Expand all Loading... |
256 | 253 |
257 } | 254 } |
258 | 255 |
259 | 256 |
260 void | 257 void |
261 LenaMimoTestCase::GetRlcBufferSample (Ptr<RadioBearerStatsCalculator> rlcStats,
uint64_t imsi, uint8_t lcId) | 258 LenaMimoTestCase::GetRlcBufferSample (Ptr<RadioBearerStatsCalculator> rlcStats,
uint64_t imsi, uint8_t lcId) |
262 { | 259 { |
263 m_dlDataRxed.push_back (rlcStats->GetDlRxData (imsi, lcId)); | 260 m_dlDataRxed.push_back (rlcStats->GetDlRxData (imsi, lcId)); |
264 NS_LOG_INFO (Simulator::Now () << "\t get bytes " << m_dlDataRxed.at (m_dlData
Rxed.size () - 1)); | 261 NS_LOG_INFO (Simulator::Now () << "\t get bytes " << m_dlDataRxed.at (m_dlData
Rxed.size () - 1)); |
265 } | 262 } |
LEFT | RIGHT |