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, 2012 Centre Tecnologic de Telecomunicacions de Catalunya
(CTTC) | 3 * Copyright (c) 2011, 2012 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 estThrPfDl.push_back (37000); // User 2 estimated TTI throughput from PF | 179 estThrPfDl.push_back (37000); // User 2 estimated TTI throughput from PF |
180 estThrPfDl.push_back (17400); // User 3 estimated TTI throughput from PF | 180 estThrPfDl.push_back (17400); // User 3 estimated TTI throughput from PF |
181 estThrPfDl.push_back (17400); // User 4 estimated TTI throughput from PF | 181 estThrPfDl.push_back (17400); // User 4 estimated TTI throughput from PF |
182 std::vector<uint32_t> estThrPfUl; | 182 std::vector<uint32_t> estThrPfUl; |
183 estThrPfUl.push_back (469000); // User 0 estimated TTI throughput from PF | 183 estThrPfUl.push_back (469000); // User 0 estimated TTI throughput from PF |
184 estThrPfUl.push_back (157000); // User 1 estimated TTI throughput from PF | 184 estThrPfUl.push_back (157000); // User 1 estimated TTI throughput from PF |
185 estThrPfUl.push_back (125000); // User 2 estimated TTI throughput from PF | 185 estThrPfUl.push_back (125000); // User 2 estimated TTI throughput from PF |
186 estThrPfUl.push_back (85000); // User 3 estimated TTI throughput from PF | 186 estThrPfUl.push_back (85000); // User 3 estimated TTI throughput from PF |
187 estThrPfUl.push_back (26000); // User 4 estimated TTI throughput from PF | 187 estThrPfUl.push_back (26000); // User 4 estimated TTI throughput from PF |
188 AddTestCase (new LenaPfFfMacSchedulerTestCase2 (dist, estThrPfDl, estThrPfUl,e
rrorModel), TestCase::QUICK); | 188 AddTestCase (new LenaPfFfMacSchedulerTestCase2 (dist, estThrPfDl, estThrPfUl,e
rrorModel), TestCase::QUICK); |
| 189 |
| 190 |
189 } | 191 } |
190 | 192 |
191 static LenaTestPfFfMacSchedulerSuite lenaTestPfFfMacSchedulerSuite; | 193 static LenaTestPfFfMacSchedulerSuite lenaTestPfFfMacSchedulerSuite; |
192 | 194 |
193 | 195 |
194 // --------------- T E S T - C A S E # 1 ------------------------------ | 196 // --------------- T E S T - C A S E # 1 ------------------------------ |
195 | 197 |
196 | 198 |
197 std::string· | 199 std::string· |
198 LenaPfFfMacSchedulerTestCase1::BuildNameString (uint16_t nUser, double dist) | 200 LenaPfFfMacSchedulerTestCase1::BuildNameString (uint16_t nUser, double dist) |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 } | 351 } |
350 | 352 |
351 | 353 |
352 | 354 |
353 // --------------- T E S T - C A S E # 2 ------------------------------ | 355 // --------------- T E S T - C A S E # 2 ------------------------------ |
354 | 356 |
355 | 357 |
356 std::string· | 358 std::string· |
357 LenaPfFfMacSchedulerTestCase2::BuildNameString (uint16_t nUser, std::vector<doub
le> dist) | 359 LenaPfFfMacSchedulerTestCase2::BuildNameString (uint16_t nUser, std::vector<doub
le> dist) |
358 { | 360 { |
359 NS_UNUSED(nUser); | 361 NS_UNUSED (nUser); |
360 std::ostringstream oss; | 362 std::ostringstream oss; |
361 oss << "distances (m) = [ " ; | 363 oss << "distances (m) = [ " ; |
362 for (std::vector<double>::iterator it = dist.begin (); it != dist.end (); ++it
) | 364 for (std::vector<double>::iterator it = dist.begin (); it != dist.end (); ++it
) |
363 { | 365 { |
364 oss << *it << " "; | 366 oss << *it << " "; |
365 } | 367 } |
366 oss << "]"; | 368 oss << "]"; |
367 return oss.str (); | 369 return oss.str (); |
368 } | 370 } |
369 | 371 |
370 | 372 |
371 LenaPfFfMacSchedulerTestCase2::LenaPfFfMacSchedulerTestCase2 (std::vector<double
> dist, std::vector<uint32_t> estThrPfDl, std::vector<uint32_t> estThrPfUl, bool
errorModelEnabled) | 373 LenaPfFfMacSchedulerTestCase2::LenaPfFfMacSchedulerTestCase2 (std::vector<double
> dist, std::vector<uint32_t> estThrPfDl, std::vector<uint32_t> estThrPfUl, bool
errorModelEnabled) |
372 : TestCase (BuildNameString (static_cast<uint16_t>(dist.size ()), dist)), | 374 : TestCase (BuildNameString (static_cast<uint16_t> (dist.size ()), dist)), |
373 m_nUser (static_cast<uint16_t>(dist.size ())), | 375 m_nUser (static_cast<uint16_t> (dist.size ())), |
374 m_dist (dist), | 376 m_dist (dist), |
375 m_estThrPfDl (estThrPfDl), | 377 m_estThrPfDl (estThrPfDl), |
376 m_estThrPfUl (estThrPfUl), | 378 m_estThrPfUl (estThrPfUl), |
377 m_errorModelEnabled (errorModelEnabled) | 379 m_errorModelEnabled (errorModelEnabled) |
378 { | 380 { |
379 } | 381 } |
380 | 382 |
381 LenaPfFfMacSchedulerTestCase2::~LenaPfFfMacSchedulerTestCase2 () | 383 LenaPfFfMacSchedulerTestCase2::~LenaPfFfMacSchedulerTestCase2 () |
382 { | 384 { |
383 } | 385 } |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 uint64_t imsi = ueDevs.Get (i)->GetObject<LteUeNetDevice> ()->GetImsi (); | 501 uint64_t imsi = ueDevs.Get (i)->GetObject<LteUeNetDevice> ()->GetImsi (); |
500 // get the lcId | 502 // get the lcId |
501 uint8_t lcId = 3; | 503 uint8_t lcId = 3; |
502 ulDataRxed.push_back (rlcStats->GetUlRxData (imsi, lcId)); | 504 ulDataRxed.push_back (rlcStats->GetUlRxData (imsi, lcId)); |
503 NS_LOG_INFO ("\tUser " << i << " dist " << m_dist.at (i) << " bytes rxed "
<< (double)ulDataRxed.at (i) << " thr " << (double)ulDataRxed.at (i) / statsDu
ration << " ref " << (double)m_estThrPfUl.at (i)); | 505 NS_LOG_INFO ("\tUser " << i << " dist " << m_dist.at (i) << " bytes rxed "
<< (double)ulDataRxed.at (i) << " thr " << (double)ulDataRxed.at (i) / statsDu
ration << " ref " << (double)m_estThrPfUl.at (i)); |
504 NS_TEST_ASSERT_MSG_EQ_TOL ((double)ulDataRxed.at (i) / statsDuration, (dou
ble)m_estThrPfUl.at (i), (double)m_estThrPfUl.at (i) * tolerance, " Unfair Throu
ghput!"); | 506 NS_TEST_ASSERT_MSG_EQ_TOL ((double)ulDataRxed.at (i) / statsDuration, (dou
ble)m_estThrPfUl.at (i), (double)m_estThrPfUl.at (i) * tolerance, " Unfair Throu
ghput!"); |
505 } | 507 } |
506 Simulator::Destroy (); | 508 Simulator::Destroy (); |
507 | 509 |
508 } | 510 } |
LEFT | RIGHT |