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) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) | 3 * Copyright (c) 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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 // parse again so you can override input file default values via command line | 389 // parse again so you can override input file default values via command line |
390 cmd.Parse (argc, argv);· | 390 cmd.Parse (argc, argv);· |
391 | 391 |
392 // the scenario parameters get their values from the global attributes defined
above | 392 // the scenario parameters get their values from the global attributes defined
above |
393 UintegerValue uintegerValue; | 393 UintegerValue uintegerValue; |
394 IntegerValue integerValue; | 394 IntegerValue integerValue; |
395 DoubleValue doubleValue; | 395 DoubleValue doubleValue; |
396 BooleanValue booleanValue; | 396 BooleanValue booleanValue; |
397 StringValue stringValue; | 397 StringValue stringValue; |
398 GlobalValue::GetValueByName ("nBlocks", uintegerValue); | 398 GlobalValue::GetValueByName ("nBlocks", uintegerValue); |
399 uint32_t nBlocks = uintegerValue.Get (); | 399 uint32_t nBlocks = static_cast<uint32_t>(uintegerValue.Get ()); |
400 GlobalValue::GetValueByName ("nApartmentsX", uintegerValue); | 400 GlobalValue::GetValueByName ("nApartmentsX", uintegerValue); |
401 uint32_t nApartmentsX = uintegerValue.Get (); | 401 uint32_t nApartmentsX = static_cast<uint32_t>(uintegerValue.Get ()); |
402 GlobalValue::GetValueByName ("nFloors", uintegerValue); | 402 GlobalValue::GetValueByName ("nFloors", uintegerValue); |
403 uint32_t nFloors = uintegerValue.Get (); | 403 uint32_t nFloors = static_cast<uint32_t>(uintegerValue.Get ()); |
404 GlobalValue::GetValueByName ("nMacroEnbSites", uintegerValue); | 404 GlobalValue::GetValueByName ("nMacroEnbSites", uintegerValue); |
405 uint32_t nMacroEnbSites = uintegerValue.Get (); | 405 uint32_t nMacroEnbSites = static_cast<uint32_t>(uintegerValue.Get ()); |
406 GlobalValue::GetValueByName ("nMacroEnbSitesX", uintegerValue); | 406 GlobalValue::GetValueByName ("nMacroEnbSitesX", uintegerValue); |
407 uint32_t nMacroEnbSitesX = uintegerValue.Get (); | 407 uint32_t nMacroEnbSitesX = static_cast<uint32_t>(uintegerValue.Get ()); |
408 GlobalValue::GetValueByName ("interSiteDistance", doubleValue); | 408 GlobalValue::GetValueByName ("interSiteDistance", doubleValue); |
409 double interSiteDistance = doubleValue.Get (); | 409 double interSiteDistance = doubleValue.Get (); |
410 GlobalValue::GetValueByName ("areaMarginFactor", doubleValue); | 410 GlobalValue::GetValueByName ("areaMarginFactor", doubleValue); |
411 double areaMarginFactor = doubleValue.Get (); | 411 double areaMarginFactor = doubleValue.Get (); |
412 GlobalValue::GetValueByName ("macroUeDensity", doubleValue); | 412 GlobalValue::GetValueByName ("macroUeDensity", doubleValue); |
413 double macroUeDensity = doubleValue.Get (); | 413 double macroUeDensity = doubleValue.Get (); |
414 GlobalValue::GetValueByName ("homeEnbDeploymentRatio", doubleValue); | 414 GlobalValue::GetValueByName ("homeEnbDeploymentRatio", doubleValue); |
415 double homeEnbDeploymentRatio = doubleValue.Get (); | 415 double homeEnbDeploymentRatio = doubleValue.Get (); |
416 GlobalValue::GetValueByName ("homeEnbActivationRatio", doubleValue); | 416 GlobalValue::GetValueByName ("homeEnbActivationRatio", doubleValue); |
417 double homeEnbActivationRatio = doubleValue.Get (); | 417 double homeEnbActivationRatio = doubleValue.Get (); |
418 GlobalValue::GetValueByName ("homeUesHomeEnbRatio", doubleValue); | 418 GlobalValue::GetValueByName ("homeUesHomeEnbRatio", doubleValue); |
419 double homeUesHomeEnbRatio = doubleValue.Get (); | 419 double homeUesHomeEnbRatio = doubleValue.Get (); |
420 GlobalValue::GetValueByName ("macroEnbTxPowerDbm", doubleValue); | 420 GlobalValue::GetValueByName ("macroEnbTxPowerDbm", doubleValue); |
421 double macroEnbTxPowerDbm = doubleValue.Get (); | 421 double macroEnbTxPowerDbm = doubleValue.Get (); |
422 GlobalValue::GetValueByName ("homeEnbTxPowerDbm", doubleValue); | 422 GlobalValue::GetValueByName ("homeEnbTxPowerDbm", doubleValue); |
423 double homeEnbTxPowerDbm = doubleValue.Get (); | 423 double homeEnbTxPowerDbm = doubleValue.Get (); |
424 GlobalValue::GetValueByName ("macroEnbDlEarfcn", uintegerValue); | 424 GlobalValue::GetValueByName ("macroEnbDlEarfcn", uintegerValue); |
425 uint32_t macroEnbDlEarfcn = uintegerValue.Get (); | 425 uint32_t macroEnbDlEarfcn = static_cast<uint32_t>(uintegerValue.Get ()); |
426 GlobalValue::GetValueByName ("homeEnbDlEarfcn", uintegerValue); | 426 GlobalValue::GetValueByName ("homeEnbDlEarfcn", uintegerValue); |
427 uint32_t homeEnbDlEarfcn = uintegerValue.Get (); | 427 uint32_t homeEnbDlEarfcn = static_cast<uint32_t>(uintegerValue.Get ()); |
428 GlobalValue::GetValueByName ("macroEnbBandwidth", uintegerValue); | 428 GlobalValue::GetValueByName ("macroEnbBandwidth", uintegerValue); |
429 uint16_t macroEnbBandwidth = uintegerValue.Get (); | 429 uint16_t macroEnbBandwidth = static_cast<uint16_t>(uintegerValue.Get ()); |
430 GlobalValue::GetValueByName ("homeEnbBandwidth", uintegerValue); | 430 GlobalValue::GetValueByName ("homeEnbBandwidth", uintegerValue); |
431 uint16_t homeEnbBandwidth = uintegerValue.Get (); | 431 uint16_t homeEnbBandwidth = static_cast<uint16_t>(uintegerValue.Get ()); |
432 GlobalValue::GetValueByName ("simTime", doubleValue); | 432 GlobalValue::GetValueByName ("simTime", doubleValue); |
433 double simTime = doubleValue.Get (); | 433 double simTime = doubleValue.Get (); |
434 GlobalValue::GetValueByName ("epc", booleanValue); | 434 GlobalValue::GetValueByName ("epc", booleanValue); |
435 bool epc = booleanValue.Get (); | 435 bool epc = booleanValue.Get (); |
436 GlobalValue::GetValueByName ("epcDl", booleanValue); | 436 GlobalValue::GetValueByName ("epcDl", booleanValue); |
437 bool epcDl = booleanValue.Get (); | 437 bool epcDl = booleanValue.Get (); |
438 GlobalValue::GetValueByName ("epcUl", booleanValue); | 438 GlobalValue::GetValueByName ("epcUl", booleanValue); |
439 bool epcUl = booleanValue.Get (); | 439 bool epcUl = booleanValue.Get (); |
440 GlobalValue::GetValueByName ("useUdp", booleanValue); | 440 GlobalValue::GetValueByName ("useUdp", booleanValue); |
441 bool useUdp = booleanValue.Get (); | 441 bool useUdp = booleanValue.Get (); |
442 GlobalValue::GetValueByName ("generateRem", booleanValue); | 442 GlobalValue::GetValueByName ("generateRem", booleanValue); |
443 bool generateRem = booleanValue.Get (); | 443 bool generateRem = booleanValue.Get (); |
444 GlobalValue::GetValueByName ("remRbId", integerValue); | 444 GlobalValue::GetValueByName ("remRbId", integerValue); |
445 int32_t remRbId = integerValue.Get (); | 445 int32_t remRbId = static_cast<int32_t>(integerValue.Get ()); |
446 GlobalValue::GetValueByName ("fadingTrace", stringValue); | 446 GlobalValue::GetValueByName ("fadingTrace", stringValue); |
447 std::string fadingTrace = stringValue.Get (); | 447 std::string fadingTrace = stringValue.Get (); |
448 GlobalValue::GetValueByName ("numBearersPerUe", uintegerValue); | 448 GlobalValue::GetValueByName ("numBearersPerUe", uintegerValue); |
449 uint16_t numBearersPerUe = uintegerValue.Get (); | 449 uint16_t numBearersPerUe = static_cast<uint16_t>(uintegerValue.Get ()); |
450 GlobalValue::GetValueByName ("srsPeriodicity", uintegerValue); | 450 GlobalValue::GetValueByName ("srsPeriodicity", uintegerValue); |
451 uint16_t srsPeriodicity = uintegerValue.Get (); | 451 uint16_t srsPeriodicity = static_cast<uint16_t>(uintegerValue.Get ()); |
452 GlobalValue::GetValueByName ("outdoorUeMinSpeed", doubleValue); | 452 GlobalValue::GetValueByName ("outdoorUeMinSpeed", doubleValue); |
453 uint16_t outdoorUeMinSpeed = doubleValue.Get (); | 453 uint16_t outdoorUeMinSpeed = static_cast<uint16_t>(doubleValue.Get ()); |
454 GlobalValue::GetValueByName ("outdoorUeMaxSpeed", doubleValue); | 454 GlobalValue::GetValueByName ("outdoorUeMaxSpeed", doubleValue); |
455 uint16_t outdoorUeMaxSpeed = doubleValue.Get (); | 455 uint16_t outdoorUeMaxSpeed = static_cast<uint16_t>(doubleValue.Get ()); |
456 | 456 |
457 Config::SetDefault ("ns3::LteEnbRrc::SrsPeriodicity", UintegerValue (srsPeriod
icity)); | 457 Config::SetDefault ("ns3::LteEnbRrc::SrsPeriodicity", UintegerValue (srsPeriod
icity)); |
458 | 458 |
459 Box macroUeBox; | 459 Box macroUeBox; |
460 double ueZ = 1.5; | 460 double ueZ = 1.5; |
461 if (nMacroEnbSites > 0) | 461 if (nMacroEnbSites > 0) |
462 { | 462 { |
463 uint32_t currentSite = nMacroEnbSites -1; | 463 uint32_t currentSite = nMacroEnbSites -1; |
464 uint32_t biRowIndex = (currentSite / (nMacroEnbSitesX + nMacroEnbSitesX +
1)); | 464 uint32_t biRowIndex = (currentSite / (nMacroEnbSitesX + nMacroEnbSitesX +
1)); |
465 uint32_t biRowRemainder = currentSite % (nMacroEnbSitesX + nMacroEnbSitesX
+ 1); | 465 uint32_t biRowRemainder = currentSite % (nMacroEnbSitesX + nMacroEnbSitesX
+ 1); |
(...skipping 14 matching lines...) Expand all Loading... |
480 else | 480 else |
481 { | 481 { |
482 // still need the box to place femtocell blocks | 482 // still need the box to place femtocell blocks |
483 macroUeBox = Box (0, 150, 0, 150, ueZ, ueZ); | 483 macroUeBox = Box (0, 150, 0, 150, ueZ, ueZ); |
484 } | 484 } |
485 | 485 |
486 FemtocellBlockAllocator blockAllocator (macroUeBox, nApartmentsX, nFloors); | 486 FemtocellBlockAllocator blockAllocator (macroUeBox, nApartmentsX, nFloors); |
487 blockAllocator.Create (nBlocks); | 487 blockAllocator.Create (nBlocks); |
488 | 488 |
489 | 489 |
490 uint32_t nHomeEnbs = round (4 * nApartmentsX * nBlocks * nFloors * homeEnbDepl
oymentRatio * homeEnbActivationRatio); | 490 uint32_t nHomeEnbs = static_cast<uint32_t>(round (4 * nApartmentsX * nBlocks *
nFloors * homeEnbDeploymentRatio * homeEnbActivationRatio)); |
491 NS_LOG_LOGIC ("nHomeEnbs = " << nHomeEnbs); | 491 NS_LOG_LOGIC ("nHomeEnbs = " << nHomeEnbs); |
492 uint32_t nHomeUes = round (nHomeEnbs * homeUesHomeEnbRatio); | 492 uint32_t nHomeUes = static_cast<uint32_t>(round (nHomeEnbs * homeUesHomeEnbRat
io)); |
493 NS_LOG_LOGIC ("nHomeUes = " << nHomeUes); | 493 NS_LOG_LOGIC ("nHomeUes = " << nHomeUes); |
494 double macroUeAreaSize = (macroUeBox.xMax - macroUeBox.xMin) * (macroUeBox.yMa
x - macroUeBox.yMin); | 494 double macroUeAreaSize = (macroUeBox.xMax - macroUeBox.xMin) * (macroUeBox.yMa
x - macroUeBox.yMin); |
495 uint32_t nMacroUes = round (macroUeAreaSize * macroUeDensity); | 495 uint32_t nMacroUes = static_cast<uint32_t>(round (macroUeAreaSize * macroUeDen
sity)); |
496 NS_LOG_LOGIC ("nMacroUes = " << nMacroUes << " (density=" << macroUeDensity <<
")"); | 496 NS_LOG_LOGIC ("nMacroUes = " << nMacroUes << " (density=" << macroUeDensity <<
")"); |
497 | 497 |
498 NodeContainer homeEnbs; | 498 NodeContainer homeEnbs; |
499 homeEnbs.Create (nHomeEnbs); | 499 homeEnbs.Create (nHomeEnbs); |
500 NodeContainer macroEnbs; | 500 NodeContainer macroEnbs; |
501 macroEnbs.Create (3 * nMacroEnbSites); | 501 macroEnbs.Create (3 * nMacroEnbSites); |
502 NodeContainer homeUes; | 502 NodeContainer homeUes; |
503 homeUes.Create (nHomeUes); | 503 homeUes.Create (nHomeUes); |
504 NodeContainer macroUes; | 504 NodeContainer macroUes; |
505 macroUes.Create (nMacroUes); | 505 macroUes.Create (nMacroUes); |
506 | 506 |
507 MobilityHelper mobility; | 507 MobilityHelper mobility; |
508 mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); | 508 mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); |
509 | 509 |
510 | 510 |
511 Ptr <LteHelper> lteHelper = CreateObject<LteHelper> (); | 511 Ptr <LteHelper> lteHelper = CreateObject<LteHelper> (); |
512 lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::HybridBuildingsPr
opagationLossModel")); | 512 lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::HybridBuildingsPr
opagationLossModel")); |
513 lteHelper->SetPathlossModelAttribute ("ShadowSigmaExtWalls", DoubleValue (0)); | 513 lteHelper->SetPathlossModelAttribute ("ShadowSigmaExtWalls", DoubleValue (0)); |
514 lteHelper->SetPathlossModelAttribute ("ShadowSigmaOutdoor", DoubleValue (1)); | 514 lteHelper->SetPathlossModelAttribute ("ShadowSigmaOutdoor", DoubleValue (1)); |
515 lteHelper->SetPathlossModelAttribute ("ShadowSigmaIndoor", DoubleValue (1.5)); | 515 lteHelper->SetPathlossModelAttribute ("ShadowSigmaIndoor", DoubleValue (1.5)); |
516 // use always LOS model | 516 // use always LOS model |
517 lteHelper->SetPathlossModelAttribute ("Los2NlosThr", DoubleValue (1e6)); | 517 lteHelper->SetPathlossModelAttribute ("Los2NlosThr", DoubleValue (1e6)); |
518 lteHelper->SetSpectrumChannelType ("ns3::MultiModelSpectrumChannel"); | 518 lteHelper->SetSpectrumChannelType ("ns3::MultiModelSpectrumChannel"); |
519 | 519 |
520 // lteHelper->EnableLogComponents (); | 520 #if 0 |
521 // LogComponentEnable ("PfFfMacScheduler", LOG_LEVEL_ALL); | 521 lteHelper->EnableLogComponents (); |
| 522 LogComponentEnable ("PfFfMacScheduler", LOG_LEVEL_ALL); |
| 523 #endif |
522 | 524 |
523 if (!fadingTrace.empty ()) | 525 if (!fadingTrace.empty ()) |
524 { | 526 { |
525 lteHelper->SetAttribute ("FadingModel", StringValue ("ns3::TraceFadingLoss
Model")); | 527 lteHelper->SetAttribute ("FadingModel", StringValue ("ns3::TraceFadingLoss
Model")); |
526 lteHelper->SetFadingModelAttribute ("TraceFilename", StringValue (fadingTr
ace)); | 528 lteHelper->SetFadingModelAttribute ("TraceFilename", StringValue (fadingTr
ace)); |
527 } | 529 } |
528 | 530 |
529 Ptr<PointToPointEpcHelper> epcHelper; | 531 Ptr<PointToPointEpcHelper> epcHelper; |
530 if (epc) | 532 if (epc) |
531 { | 533 { |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
884 | 886 |
885 Simulator::Run (); | 887 Simulator::Run (); |
886 | 888 |
887 //GtkConfigStore config; | 889 //GtkConfigStore config; |
888 //config.ConfigureAttributes (); | 890 //config.ConfigureAttributes (); |
889 | 891 |
890 lteHelper = 0; | 892 lteHelper = 0; |
891 Simulator::Destroy (); | 893 Simulator::Destroy (); |
892 return 0; | 894 return 0; |
893 } | 895 } |
LEFT | RIGHT |