LEFT | RIGHT |
(no file at all) | |
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-2013 Centre Tecnologic de Telecomunicacions de Catalunya (
CTTC) | 3 * Copyright (c) 2011-2013 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 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 void | 159 void |
160 LenaDataPhyErrorModelTestCase::DoRun (void) | 160 LenaDataPhyErrorModelTestCase::DoRun (void) |
161 { | 161 { |
162 ·· | 162 ·· |
163 double ber = 0.03; | 163 double ber = 0.03; |
164 Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (ber)); | 164 Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (ber)); |
165 Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010)); | 165 Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010)); |
166 Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue
(false)); | 166 Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue
(false)); |
167 Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue
(true)); | 167 Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue
(true)); |
168 Config::SetDefault ("ns3::RrFfMacScheduler::HarqEnabled", BooleanValue (false)
); | 168 Config::SetDefault ("ns3::RrFfMacScheduler::HarqEnabled", BooleanValue (false)
); |
169 Config::SetGlobal ("RngRun", IntegerValue (m_rngRun)); | 169 Config::SetGlobal("RngRun", UintegerValue (m_rngRun)); |
170 | 170 |
171 //Disable Uplink Power Control | 171 //Disable Uplink Power Control |
172 Config::SetDefault ("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue (f
alse)); | 172 Config::SetDefault ("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue (f
alse)); |
173 | 173 |
174 /* | 174 /* |
175 * Initialize Simulation Scenario: 1 eNB and m_nUser UEs | 175 * Initialize Simulation Scenario: 1 eNB and m_nUser UEs |
176 */ | 176 */ |
177 | 177 |
178 int64_t stream = 1; | 178 int64_t stream = 1; |
179 Ptr<LteHelper> lena = CreateObject<LteHelper> (); | 179 Ptr<LteHelper> lena = CreateObject<LteHelper> (); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 Ptr<LteEnbPhy> enbPhy = lteEnbDev->GetPhy (); | 223 Ptr<LteEnbPhy> enbPhy = lteEnbDev->GetPhy (); |
224 enbPhy->SetAttribute ("TxPower", DoubleValue (43.0)); | 224 enbPhy->SetAttribute ("TxPower", DoubleValue (43.0)); |
225 enbPhy->SetAttribute ("NoiseFigure", DoubleValue (5.0)); | 225 enbPhy->SetAttribute ("NoiseFigure", DoubleValue (5.0)); |
226 // place the HeNB over the default rooftop level (20 mt.) | 226 // place the HeNB over the default rooftop level (20 mt.) |
227 Ptr<MobilityModel> mm = enbNodes.Get (0)->GetObject<MobilityModel> (); | 227 Ptr<MobilityModel> mm = enbNodes.Get (0)->GetObject<MobilityModel> (); |
228 mm->SetPosition (Vector (0.0, 0.0, 30.0)); | 228 mm->SetPosition (Vector (0.0, 0.0, 30.0)); |
229 | 229 |
230 // Set UEs' position and power | 230 // Set UEs' position and power |
231 for (int i = 0; i < m_nUser; i++) | 231 for (int i = 0; i < m_nUser; i++) |
232 { | 232 { |
233 Ptr<MobilityModel> mm = ueNodes.Get (i)->GetObject<MobilityModel> (); | 233 Ptr<MobilityModel> mm1 = ueNodes.Get (i)->GetObject<MobilityModel> (); |
234 mm->SetPosition (Vector (m_dist, 0.0, 1.0)); | 234 mm1->SetPosition (Vector (m_dist, 0.0, 1.0)); |
235 Ptr<LteUeNetDevice> lteUeDev = ueDevs.Get (i)->GetObject<LteUeNetDevice> (
); | 235 Ptr<LteUeNetDevice> lteUeDev = ueDevs.Get (i)->GetObject<LteUeNetDevice> (
); |
236 Ptr<LteUePhy> uePhy = lteUeDev->GetPhy (); | 236 Ptr<LteUePhy> uePhy = lteUeDev->GetPhy (); |
237 uePhy->SetAttribute ("TxPower", DoubleValue (23.0)); | 237 uePhy->SetAttribute ("TxPower", DoubleValue (23.0)); |
238 uePhy->SetAttribute ("NoiseFigure", DoubleValue (9.0)); | 238 uePhy->SetAttribute ("NoiseFigure", DoubleValue (9.0)); |
239 } | 239 } |
240 ···· | 240 ···· |
241 Time statsDuration = Seconds (1.0); | 241 Time statsDuration = Seconds (1.0); |
242 Simulator::Stop (m_statsStartTime + statsDuration - Seconds (0.0001)); | 242 Simulator::Stop (m_statsStartTime + statsDuration - Seconds (0.0001)); |
243 | 243 |
244 lena->EnableRlcTraces (); | 244 lena->EnableRlcTraces (); |
(...skipping 18 matching lines...) Expand all Loading... |
263 NS_LOG_INFO ("\tUser " << i << " imsi " << imsi << " DOWNLINK" | 263 NS_LOG_INFO ("\tUser " << i << " imsi " << imsi << " DOWNLINK" |
264 << " pkts rx " << dlRxPackets << " tx " << dlTxPackets | 264 << " pkts rx " << dlRxPackets << " tx " << dlTxPackets |
265 << " BLER " << dlBler << " Err " << std::fabs (m_blerRef - dl
Bler) | 265 << " BLER " << dlBler << " Err " << std::fabs (m_blerRef - dl
Bler) |
266 << " expected rx " << expectedDlRxPackets | 266 << " expected rx " << expectedDlRxPackets |
267 << " difference " << std::abs (expectedDlRxPackets - dlRxPack
ets) | 267 << " difference " << std::abs (expectedDlRxPackets - dlRxPack
ets) |
268 << " tolerance " << m_toleranceRxPackets); | 268 << " tolerance " << m_toleranceRxPackets); |
269 NS_UNUSED (dlBler); | 269 NS_UNUSED (dlBler); |
270 | 270 |
271 // sanity check for whether the tx packets reported by the stats are corre
ct | 271 // sanity check for whether the tx packets reported by the stats are corre
ct |
272 // we expect one packet per TTI | 272 // we expect one packet per TTI |
273 double expectedDlTxPackets = statsDuration.GetMilliSeconds (); | 273 double expectedDlTxPackets = static_cast<double>(statsDuration.GetMilliSec
onds ()); |
274 NS_TEST_ASSERT_MSG_EQ_TOL (dlTxPackets, expectedDlTxPackets, expectedDlTxP
ackets * 0.005,· | 274 NS_TEST_ASSERT_MSG_EQ_TOL (dlTxPackets, expectedDlTxPackets, expectedDlTxP
ackets * 0.005,· |
275 " too different DL TX packets reported"); | 275 " too different DL TX packets reported"); |
276 | 276 |
277 // this is the main test condition: check that the RX packets are within t
he expected range | 277 // this is the main test condition: check that the RX packets are within t
he expected range |
278 NS_TEST_ASSERT_MSG_EQ_TOL (dlRxPackets, expectedDlRxPackets, m_toleranceRx
Packets,· | 278 NS_TEST_ASSERT_MSG_EQ_TOL (dlRxPackets, expectedDlRxPackets, m_toleranceRx
Packets,· |
279 " too different DL RX packets reported"); | 279 " too different DL RX packets reported"); |
280 } | 280 } |
281 | 281 |
282 | 282 |
283 Simulator::Destroy (); | 283 Simulator::Destroy (); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 void | 315 void |
316 LenaDlCtrlPhyErrorModelTestCase::DoRun (void) | 316 LenaDlCtrlPhyErrorModelTestCase::DoRun (void) |
317 { | 317 { |
318 ·· | 318 ·· |
319 double ber = 0.03; | 319 double ber = 0.03; |
320 Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (ber)); | 320 Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (ber)); |
321 Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010)); | 321 Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010)); |
322 Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue
(true)); | 322 Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue
(true)); |
323 Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue
(false)); | 323 Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue
(false)); |
324 Config::SetDefault ("ns3::RrFfMacScheduler::HarqEnabled", BooleanValue (false)
); | 324 Config::SetDefault ("ns3::RrFfMacScheduler::HarqEnabled", BooleanValue (false)
); |
325 Config::SetGlobal ("RngRun", IntegerValue (m_rngRun)); | 325 Config::SetGlobal ("RngRun", UintegerValue (m_rngRun)); |
326 | 326 |
327 //Disable Uplink Power Control | 327 //Disable Uplink Power Control |
328 Config::SetDefault ("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue (f
alse)); | 328 Config::SetDefault ("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue (f
alse)); |
329 | 329 |
330 /* | 330 /* |
331 * Initialize Simulation Scenario: 1 eNB and m_nUser UEs | 331 * Initialize Simulation Scenario: 1 eNB and m_nUser UEs |
332 */ | 332 */ |
333 | 333 |
334 int64_t stream = 1; | 334 int64_t stream = 1; |
335 Ptr<LteHelper> lena = CreateObject<LteHelper> (); | 335 Ptr<LteHelper> lena = CreateObject<LteHelper> (); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 NS_LOG_INFO ("\tUser " << i << " imsi " << imsi << " DOWNLINK" | 419 NS_LOG_INFO ("\tUser " << i << " imsi " << imsi << " DOWNLINK" |
420 << " pkts rx " << dlRxPackets << " tx " << dlTxPackets | 420 << " pkts rx " << dlRxPackets << " tx " << dlTxPackets |
421 << " BLER " << dlBler << " Err " << std::fabs (m_blerRef - dl
Bler) | 421 << " BLER " << dlBler << " Err " << std::fabs (m_blerRef - dl
Bler) |
422 << " expected rx " << expectedDlRxPackets | 422 << " expected rx " << expectedDlRxPackets |
423 << " difference " << std::abs (expectedDlRxPackets - dlRxPack
ets) | 423 << " difference " << std::abs (expectedDlRxPackets - dlRxPack
ets) |
424 << " tolerance " << m_toleranceRxPackets); | 424 << " tolerance " << m_toleranceRxPackets); |
425 NS_UNUSED (dlBler); | 425 NS_UNUSED (dlBler); |
426 | 426 |
427 // sanity check for whether the tx packets reported by the stats are corre
ct | 427 // sanity check for whether the tx packets reported by the stats are corre
ct |
428 // we expect one packet per TTI | 428 // we expect one packet per TTI |
429 double expectedDlTxPackets = statsDuration.GetMilliSeconds (); | 429 double expectedDlTxPackets = static_cast<double>(statsDuration.GetMilliSec
onds ()); |
430 NS_TEST_ASSERT_MSG_EQ_TOL (dlTxPackets, expectedDlTxPackets, expectedDlTxP
ackets * 0.005,· | 430 NS_TEST_ASSERT_MSG_EQ_TOL (dlTxPackets, expectedDlTxPackets, expectedDlTxP
ackets * 0.005,· |
431 " too different DL TX packets reported"); | 431 " too different DL TX packets reported"); |
432 | 432 |
433 // this is the main test condition: check that the RX packets are within t
he expected range | 433 // this is the main test condition: check that the RX packets are within t
he expected range |
434 NS_TEST_ASSERT_MSG_EQ_TOL (dlRxPackets, expectedDlRxPackets, m_toleranceRx
Packets, | 434 NS_TEST_ASSERT_MSG_EQ_TOL (dlRxPackets, expectedDlRxPackets, m_toleranceRx
Packets, |
435 "too different DL RX packets reported"); | 435 "too different DL RX packets reported"); |
436 | 436 |
437 } | 437 } |
438 ·· | 438 ·· |
439 Simulator::Destroy (); | 439 Simulator::Destroy (); |
440 } | 440 } |
LEFT | RIGHT |