Unix line endings
authorPeter D. Barnes, Jr. <barnes26@llnl.gov>
Thu, 14 Nov 2013 09:22:14 -0800
changeset 10403 798e90c6c12f
parent 10402 b4e0285d2f22
child 10404 eb6495608840
Unix line endings
examples/tcp/tcp-nsc-comparison.cc
src/lte/examples/lena-profiling.cc
src/lte/examples/lena-rem-sector-antenna.cc
--- a/examples/tcp/tcp-nsc-comparison.cc	Wed Nov 13 16:49:02 2013 -0500
+++ b/examples/tcp/tcp-nsc-comparison.cc	Thu Nov 14 09:22:14 2013 -0800
@@ -1,180 +1,180 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2012 NICT
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Author: Hajime Tazaki <tazaki@nict.go.jp>
- *
- * This code is a modified version of the code used for the the experiments in the paper
- * "DCE Cradle: Simulate Network Protocols with Real Stacks for Better Realism"
- * by Hajime Tazaki, Frederic Urbani and Thierry Turlett presented at WNS3 2013
- *
- */
-
-#include "ns3/log.h"
-#include "ns3/core-module.h"
-#include "ns3/network-module.h"
-#include "ns3/internet-module.h"
-#include "ns3/point-to-point-module.h"
-#include "ns3/applications-module.h"
-#include "ns3/flow-monitor-module.h"
-
-using namespace ns3;
-
-NS_LOG_COMPONENT_DEFINE ("TcpNscComparison");
-
-std::string m_stack = "nsc-linux";
-std::string sock_factory;
-int m_seed = 1;
-double startTime = 4.0;
-double stopTime = 20.0;
-uint32_t m_nNodes = 2;
-bool enablePcap = false;
-
-int
-main (int argc, char *argv[])
-{
-
-  //ensure the ns3 TCP default values match what nsc is using
-  Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (1448));
-  Config::SetDefault ("ns3::TcpSocket::DelAckCount", UintegerValue (1));
-
-  CommandLine cmd;
-  cmd.AddValue ("stack", "choose network stack", m_stack);
-  cmd.AddValue ("seed", "randomize seed", m_seed);
-  cmd.AddValue ("nNodes", "the number of nodes in left side", m_nNodes);
-  cmd.AddValue ("stopTime", "duration", stopTime);
-  cmd.AddValue ("enablePcap", "pcap", enablePcap);
-  cmd.Parse (argc, argv);
-
-  SeedManager::SetSeed (m_seed);
-
-  NodeContainer lefts, routers, rights, nodes;
-  lefts.Create (m_nNodes);
-  routers.Create (2);
-  rights.Create (m_nNodes);
-  nodes = NodeContainer (lefts, routers, rights);
-
-  InternetStackHelper internetStack;
-
-  GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true));
-  if (m_stack == "ns3")
-    {
-      sock_factory = "ns3::TcpSocketFactory";
-      internetStack.Install (nodes);
-    }
-  else if (m_stack == "nsc-linux")
-    {
-      internetStack.Install (routers);
-      sock_factory = "ns3::TcpSocketFactory";
-      internetStack.SetTcp ("ns3::NscTcpL4Protocol",
-                            "Library", StringValue ("liblinux2.6.26.so"));
-      internetStack.Install (lefts);
-      internetStack.Install (rights);
-
-      //these are not implemented in ns3 tcp so disable for comparison
-      Config::Set ("/NodeList/*/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_sack", StringValue ("0"));
-      Config::Set ("/NodeList/*/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_timestamps", StringValue ("0"));
-      Config::Set ("/NodeList/*/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_window_scaling", StringValue ("0"));
-    }
-
-  PointToPointHelper pointToPoint;
-  pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
-  pointToPoint.SetChannelAttribute ("Delay", StringValue ("1ns"));
-
-  Ipv4AddressHelper address;
-  Ipv4InterfaceContainer interfaces;
-
-  NetDeviceContainer dev0, dev1, dev2;
-  for (uint32_t i = 0; i < m_nNodes; i++)
-    {
-      std::ostringstream oss;
-      oss << "10.0." << i << ".0";
-      address.SetBase (oss.str ().c_str (), "255.255.255.0");
-      dev0 = pointToPoint.Install (NodeContainer (lefts.Get (i), routers.Get (0)));
-      address.Assign (dev0);
-    }
-
-  // bottle neck link
-  pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("2Mbps"));
-  pointToPoint.SetChannelAttribute ("Delay", StringValue ("100ms"));
-  dev1 = pointToPoint.Install (NodeContainer (routers.Get (0), routers.Get (1)));
-
-  pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
-  pointToPoint.SetChannelAttribute ("Delay", StringValue ("1ns"));
-  // for right links
-  for (uint32_t i = 0; i < m_nNodes; i++)
-    {
-      std::ostringstream oss;
-      oss << "10.2." << i << ".0";
-      address.SetBase (oss.str ().c_str (), "255.255.255.0");
-      dev2 = pointToPoint.Install (NodeContainer (routers.Get (1), rights.Get (i)));
-      address.Assign (dev2);
-    }
-
-  // bottle neck link
-  Ptr<RateErrorModel> em1 =
-    CreateObjectWithAttributes<RateErrorModel> (
-      "ErrorRate", DoubleValue (0.05),
-      "ErrorUnit", EnumValue (RateErrorModel::ERROR_UNIT_PACKET)
-      );
-  dev1.Get (1)->SetAttribute ("ReceiveErrorModel", PointerValue (em1));
-
-  address.SetBase ("10.1.0.0", "255.255.255.0");
-  address.Assign (dev1);
-  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
-
-  ApplicationContainer apps;
-
-  OnOffHelper onoff = OnOffHelper (sock_factory,
-                                   InetSocketAddress (Ipv4Address ("10.2.0.2"), 2000));
-  onoff.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1]"));
-  onoff.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0]"));
-
-  // Flow 1 - n
-  for (uint32_t i = 0; i < m_nNodes; i++)
-    {
-      std::ostringstream oss;
-      oss << "10.2." << i << ".2";
-      onoff.SetAttribute ("Remote", AddressValue (InetSocketAddress (Ipv4Address (oss.str ().c_str ()), 2000)));
-      onoff.SetAttribute ("PacketSize", StringValue ("1024"));
-      onoff.SetAttribute ("DataRate", StringValue ("1Mbps"));
-      onoff.SetAttribute ("StartTime", TimeValue (Seconds (startTime)));
-      apps = onoff.Install (lefts.Get (i));
-    }
-
-  PacketSinkHelper sink = PacketSinkHelper (sock_factory,
-                                            InetSocketAddress (Ipv4Address::GetAny (), 2000));
-  apps = sink.Install (rights);
-  apps.Start (Seconds (3.9999));
-
-  pointToPoint.EnablePcapAll ("nsc.pcap");
-
-  Simulator::Stop (Seconds (stopTime));
-  Simulator::Run ();
-
-  Ptr<PacketSink> pktsink;
-  std::cout << "Total ";
-  for (uint32_t i = 0; i < m_nNodes; i++)
-    {
-      pktsink = apps.Get (i)->GetObject<PacketSink> ();
-      std::cout << "Rx(" << i << ") = " << pktsink->GetTotalRx () <<
-      " bytes (" << pktsink->GetTotalRx () * 8 / (stopTime - startTime) << " bps), ";
-    }
-  std::cout << std::endl;
-
-  Simulator::Destroy ();
-  return 0;
-}
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2012 NICT
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Hajime Tazaki <tazaki@nict.go.jp>
+ *
+ * This code is a modified version of the code used for the the experiments in the paper
+ * "DCE Cradle: Simulate Network Protocols with Real Stacks for Better Realism"
+ * by Hajime Tazaki, Frederic Urbani and Thierry Turlett presented at WNS3 2013
+ *
+ */
+
+#include "ns3/log.h"
+#include "ns3/core-module.h"
+#include "ns3/network-module.h"
+#include "ns3/internet-module.h"
+#include "ns3/point-to-point-module.h"
+#include "ns3/applications-module.h"
+#include "ns3/flow-monitor-module.h"
+
+using namespace ns3;
+
+NS_LOG_COMPONENT_DEFINE ("TcpNscComparison");
+
+std::string m_stack = "nsc-linux";
+std::string sock_factory;
+int m_seed = 1;
+double startTime = 4.0;
+double stopTime = 20.0;
+uint32_t m_nNodes = 2;
+bool enablePcap = false;
+
+int
+main (int argc, char *argv[])
+{
+
+  //ensure the ns3 TCP default values match what nsc is using
+  Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (1448));
+  Config::SetDefault ("ns3::TcpSocket::DelAckCount", UintegerValue (1));
+
+  CommandLine cmd;
+  cmd.AddValue ("stack", "choose network stack", m_stack);
+  cmd.AddValue ("seed", "randomize seed", m_seed);
+  cmd.AddValue ("nNodes", "the number of nodes in left side", m_nNodes);
+  cmd.AddValue ("stopTime", "duration", stopTime);
+  cmd.AddValue ("enablePcap", "pcap", enablePcap);
+  cmd.Parse (argc, argv);
+
+  SeedManager::SetSeed (m_seed);
+
+  NodeContainer lefts, routers, rights, nodes;
+  lefts.Create (m_nNodes);
+  routers.Create (2);
+  rights.Create (m_nNodes);
+  nodes = NodeContainer (lefts, routers, rights);
+
+  InternetStackHelper internetStack;
+
+  GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true));
+  if (m_stack == "ns3")
+    {
+      sock_factory = "ns3::TcpSocketFactory";
+      internetStack.Install (nodes);
+    }
+  else if (m_stack == "nsc-linux")
+    {
+      internetStack.Install (routers);
+      sock_factory = "ns3::TcpSocketFactory";
+      internetStack.SetTcp ("ns3::NscTcpL4Protocol",
+                            "Library", StringValue ("liblinux2.6.26.so"));
+      internetStack.Install (lefts);
+      internetStack.Install (rights);
+
+      //these are not implemented in ns3 tcp so disable for comparison
+      Config::Set ("/NodeList/*/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_sack", StringValue ("0"));
+      Config::Set ("/NodeList/*/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_timestamps", StringValue ("0"));
+      Config::Set ("/NodeList/*/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_window_scaling", StringValue ("0"));
+    }
+
+  PointToPointHelper pointToPoint;
+  pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
+  pointToPoint.SetChannelAttribute ("Delay", StringValue ("1ns"));
+
+  Ipv4AddressHelper address;
+  Ipv4InterfaceContainer interfaces;
+
+  NetDeviceContainer dev0, dev1, dev2;
+  for (uint32_t i = 0; i < m_nNodes; i++)
+    {
+      std::ostringstream oss;
+      oss << "10.0." << i << ".0";
+      address.SetBase (oss.str ().c_str (), "255.255.255.0");
+      dev0 = pointToPoint.Install (NodeContainer (lefts.Get (i), routers.Get (0)));
+      address.Assign (dev0);
+    }
+
+  // bottle neck link
+  pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("2Mbps"));
+  pointToPoint.SetChannelAttribute ("Delay", StringValue ("100ms"));
+  dev1 = pointToPoint.Install (NodeContainer (routers.Get (0), routers.Get (1)));
+
+  pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
+  pointToPoint.SetChannelAttribute ("Delay", StringValue ("1ns"));
+  // for right links
+  for (uint32_t i = 0; i < m_nNodes; i++)
+    {
+      std::ostringstream oss;
+      oss << "10.2." << i << ".0";
+      address.SetBase (oss.str ().c_str (), "255.255.255.0");
+      dev2 = pointToPoint.Install (NodeContainer (routers.Get (1), rights.Get (i)));
+      address.Assign (dev2);
+    }
+
+  // bottle neck link
+  Ptr<RateErrorModel> em1 =
+    CreateObjectWithAttributes<RateErrorModel> (
+      "ErrorRate", DoubleValue (0.05),
+      "ErrorUnit", EnumValue (RateErrorModel::ERROR_UNIT_PACKET)
+      );
+  dev1.Get (1)->SetAttribute ("ReceiveErrorModel", PointerValue (em1));
+
+  address.SetBase ("10.1.0.0", "255.255.255.0");
+  address.Assign (dev1);
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
+
+  ApplicationContainer apps;
+
+  OnOffHelper onoff = OnOffHelper (sock_factory,
+                                   InetSocketAddress (Ipv4Address ("10.2.0.2"), 2000));
+  onoff.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1]"));
+  onoff.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0]"));
+
+  // Flow 1 - n
+  for (uint32_t i = 0; i < m_nNodes; i++)
+    {
+      std::ostringstream oss;
+      oss << "10.2." << i << ".2";
+      onoff.SetAttribute ("Remote", AddressValue (InetSocketAddress (Ipv4Address (oss.str ().c_str ()), 2000)));
+      onoff.SetAttribute ("PacketSize", StringValue ("1024"));
+      onoff.SetAttribute ("DataRate", StringValue ("1Mbps"));
+      onoff.SetAttribute ("StartTime", TimeValue (Seconds (startTime)));
+      apps = onoff.Install (lefts.Get (i));
+    }
+
+  PacketSinkHelper sink = PacketSinkHelper (sock_factory,
+                                            InetSocketAddress (Ipv4Address::GetAny (), 2000));
+  apps = sink.Install (rights);
+  apps.Start (Seconds (3.9999));
+
+  pointToPoint.EnablePcapAll ("nsc.pcap");
+
+  Simulator::Stop (Seconds (stopTime));
+  Simulator::Run ();
+
+  Ptr<PacketSink> pktsink;
+  std::cout << "Total ";
+  for (uint32_t i = 0; i < m_nNodes; i++)
+    {
+      pktsink = apps.Get (i)->GetObject<PacketSink> ();
+      std::cout << "Rx(" << i << ") = " << pktsink->GetTotalRx () <<
+      " bytes (" << pktsink->GetTotalRx () * 8 / (stopTime - startTime) << " bps), ";
+    }
+  std::cout << std::endl;
+
+  Simulator::Destroy ();
+  return 0;
+}
--- a/src/lte/examples/lena-profiling.cc	Wed Nov 13 16:49:02 2013 -0500
+++ b/src/lte/examples/lena-profiling.cc	Thu Nov 14 09:22:14 2013 -0800
@@ -1,208 +1,208 @@
-/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Author: Jaume Nin <jnin@cttc.es>
- */
-
-#include "ns3/core-module.h"
-#include "ns3/network-module.h"
-#include "ns3/mobility-module.h"
-#include "ns3/lte-module.h"
-#include "ns3/config-store.h"
-#include <ns3/buildings-module.h>
-#include <iomanip>
-#include <string>
-#include <vector>
-//#include "ns3/gtk-config-store.h"
-
-using namespace ns3;
-
-int
-main (int argc, char *argv[])
-{
-  uint32_t nEnbPerFloor = 1;
-  uint32_t nUe = 1;
-  uint32_t nFloors = 0;
-  double simTime = 1.0;
-  CommandLine cmd;
-
-  cmd.AddValue ("nEnb", "Number of eNodeBs per floor", nEnbPerFloor);
-  cmd.AddValue ("nUe", "Number of UEs", nUe);
-  cmd.AddValue ("nFloors", "Number of floors, 0 for Friis propagation model",
-                nFloors);
-  cmd.AddValue ("simTime", "Total duration of the simulation (in seconds)",
-                simTime);
-  cmd.Parse (argc, argv);
-
-  ConfigStore inputConfig;
-  inputConfig.ConfigureDefaults ();
-
-  // parse again so you can override default values from the command line
-  cmd.Parse (argc, argv);
-
-  // Geometry of the scenario (in meters)
-  // Assume squared building
-  double nodeHeight = 1.5;
-  double roomHeight = 3;
-  double roomLength = 8;
-  uint32_t nRooms = std::ceil (std::sqrt (nEnbPerFloor));
-  uint32_t nEnb;
-
-  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
-  //lteHelper->EnableLogComponents ();
-  //LogComponentEnable ("BuildingsPropagationLossModel", LOG_LEVEL_ALL);
-  if (nFloors == 0)
-    {
-      lteHelper->SetAttribute ("PathlossModel",
-                               StringValue ("ns3::FriisPropagationLossModel"));
-      nEnb = nEnbPerFloor;
-    }
-  else
-    {
-      lteHelper->SetAttribute ("PathlossModel",
-                               StringValue ("ns3::HybridBuildingsPropagationLossModel"));
-      nEnb = nFloors * nEnbPerFloor;
-    }
-
-  // Create Nodes: eNodeB and UE
-  NodeContainer enbNodes;
-  std::vector<NodeContainer> ueNodes;
-
-  enbNodes.Create (nEnb);
-  for (uint32_t i = 0; i < nEnb; i++)
-    {
-      NodeContainer ueNode;
-      ueNode.Create (nUe);
-      ueNodes.push_back (ueNode);
-    }
-
-  MobilityHelper mobility;
-  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
-  std::vector<Vector> enbPosition;
-  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
-  Ptr<Building> building;
-
-  if (nFloors == 0)
-    {
-      // Position of eNBs
-      uint32_t plantedEnb = 0;
-      for (uint32_t row = 0; row < nRooms; row++)
-        {
-          for (uint32_t column = 0; column < nRooms && plantedEnb < nEnbPerFloor; column++, plantedEnb++)
-            {
-              Vector v (roomLength * (column + 0.5), roomLength * (row + 0.5), nodeHeight);
-              positionAlloc->Add (v);
-              enbPosition.push_back (v);
-              mobility.Install (ueNodes.at(plantedEnb));
-            }
-        }
-      mobility.SetPositionAllocator (positionAlloc);
-      mobility.Install (enbNodes);
-      BuildingsHelper::Install (enbNodes);
-
-      // Position of UEs attached to eNB
-      for (uint32_t i = 0; i < nEnb; i++)
-        {
-          Ptr<UniformRandomVariable> posX = CreateObject<UniformRandomVariable> ();
-          posX->SetAttribute ("Min", DoubleValue (enbPosition.at(i).x - roomLength * 0.5));
-          posX->SetAttribute ("Max", DoubleValue (enbPosition.at(i).x + roomLength * 0.5));
-          Ptr<UniformRandomVariable> posY = CreateObject<UniformRandomVariable> ();
-          posY->SetAttribute ("Min", DoubleValue (enbPosition.at(i).y - roomLength * 0.5));
-          posY->SetAttribute ("Max", DoubleValue (enbPosition.at(i).y + roomLength * 0.5));
-          positionAlloc = CreateObject<ListPositionAllocator> ();
-          for (uint32_t j = 0; j < nUe; j++)
-            {
-              positionAlloc->Add (Vector (posX->GetValue (), posY->GetValue (), nodeHeight));
-              mobility.SetPositionAllocator (positionAlloc);
-            }
-          mobility.Install (ueNodes.at(i));
-          BuildingsHelper::Install (ueNodes.at(i));
-        }
-
-    }
-  else
-    {
-      building = CreateObject<Building> ();
-      building->SetBoundaries (Box (0.0, nRooms * roomLength,
-                                    0.0, nRooms * roomLength,
-                                    0.0, nFloors* roomHeight));
-      building->SetBuildingType (Building::Residential);
-      building->SetExtWallsType (Building::ConcreteWithWindows);
-      building->SetNFloors (nFloors);
-      building->SetNRoomsX (nRooms);
-      building->SetNRoomsY (nRooms);
-      mobility.Install (enbNodes);
-      BuildingsHelper::Install (enbNodes);
-      uint32_t plantedEnb = 0;
-      for (uint32_t floor = 0; floor < nFloors; floor++)
-        {
-          uint32_t plantedEnbPerFloor = 0;
-          for (uint32_t row = 0; row < nRooms; row++)
-            {
-              for (uint32_t column = 0; column < nRooms && plantedEnbPerFloor < nEnbPerFloor; column++, plantedEnb++, plantedEnbPerFloor++)
-                {
-                  Vector v (roomLength * (column + 0.5),
-                            roomLength * (row + 0.5),
-                            nodeHeight + roomHeight * floor);
-                  positionAlloc->Add (v);
-                  enbPosition.push_back (v);
-                  Ptr<MobilityModel> mmEnb = enbNodes.Get (plantedEnb)->GetObject<MobilityModel> ();
-                  mmEnb->SetPosition (v);
-
-                  // Positioning UEs attached to eNB
-                  mobility.Install (ueNodes.at(plantedEnb));
-                  BuildingsHelper::Install (ueNodes.at(plantedEnb));
-                  for (uint32_t ue = 0; ue < nUe; ue++)
-                    {
-                      Ptr<MobilityModel> mmUe = ueNodes.at(plantedEnb).Get (ue)->GetObject<MobilityModel> ();
-                      Vector vUe (v.x, v.y, v.z);
-                      mmUe->SetPosition (vUe);
-                    }
-                }
-            }
-        }
-    }
-
-
-  // Create Devices and install them in the Nodes (eNB and UE)
-  NetDeviceContainer enbDevs;
-  std::vector<NetDeviceContainer> ueDevs;
-  enbDevs = lteHelper->InstallEnbDevice (enbNodes);
-  for (uint32_t i = 0; i < nEnb; i++)
-    {
-      NetDeviceContainer ueDev = lteHelper->InstallUeDevice (ueNodes.at(i));
-      ueDevs.push_back (ueDev);
-      lteHelper->Attach (ueDev, enbDevs.Get (i));
-      enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
-      EpsBearer bearer (q);
-      lteHelper->ActivateDataRadioBearer (ueDev, bearer);
-    }
-
-
-  BuildingsHelper::MakeMobilityModelConsistent ();
-
-  Simulator::Stop (Seconds (simTime));
-  lteHelper->EnableTraces ();
-
-  Simulator::Run ();
-
-  /*GtkConfigStore config;
-  config.ConfigureAttributes ();*/
-
-  Simulator::Destroy ();
-  return 0;
-}
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Jaume Nin <jnin@cttc.es>
+ */
+
+#include "ns3/core-module.h"
+#include "ns3/network-module.h"
+#include "ns3/mobility-module.h"
+#include "ns3/lte-module.h"
+#include "ns3/config-store.h"
+#include <ns3/buildings-module.h>
+#include <iomanip>
+#include <string>
+#include <vector>
+//#include "ns3/gtk-config-store.h"
+
+using namespace ns3;
+
+int
+main (int argc, char *argv[])
+{
+  uint32_t nEnbPerFloor = 1;
+  uint32_t nUe = 1;
+  uint32_t nFloors = 0;
+  double simTime = 1.0;
+  CommandLine cmd;
+
+  cmd.AddValue ("nEnb", "Number of eNodeBs per floor", nEnbPerFloor);
+  cmd.AddValue ("nUe", "Number of UEs", nUe);
+  cmd.AddValue ("nFloors", "Number of floors, 0 for Friis propagation model",
+                nFloors);
+  cmd.AddValue ("simTime", "Total duration of the simulation (in seconds)",
+                simTime);
+  cmd.Parse (argc, argv);
+
+  ConfigStore inputConfig;
+  inputConfig.ConfigureDefaults ();
+
+  // parse again so you can override default values from the command line
+  cmd.Parse (argc, argv);
+
+  // Geometry of the scenario (in meters)
+  // Assume squared building
+  double nodeHeight = 1.5;
+  double roomHeight = 3;
+  double roomLength = 8;
+  uint32_t nRooms = std::ceil (std::sqrt (nEnbPerFloor));
+  uint32_t nEnb;
+
+  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
+  //lteHelper->EnableLogComponents ();
+  //LogComponentEnable ("BuildingsPropagationLossModel", LOG_LEVEL_ALL);
+  if (nFloors == 0)
+    {
+      lteHelper->SetAttribute ("PathlossModel",
+                               StringValue ("ns3::FriisPropagationLossModel"));
+      nEnb = nEnbPerFloor;
+    }
+  else
+    {
+      lteHelper->SetAttribute ("PathlossModel",
+                               StringValue ("ns3::HybridBuildingsPropagationLossModel"));
+      nEnb = nFloors * nEnbPerFloor;
+    }
+
+  // Create Nodes: eNodeB and UE
+  NodeContainer enbNodes;
+  std::vector<NodeContainer> ueNodes;
+
+  enbNodes.Create (nEnb);
+  for (uint32_t i = 0; i < nEnb; i++)
+    {
+      NodeContainer ueNode;
+      ueNode.Create (nUe);
+      ueNodes.push_back (ueNode);
+    }
+
+  MobilityHelper mobility;
+  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
+  std::vector<Vector> enbPosition;
+  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
+  Ptr<Building> building;
+
+  if (nFloors == 0)
+    {
+      // Position of eNBs
+      uint32_t plantedEnb = 0;
+      for (uint32_t row = 0; row < nRooms; row++)
+        {
+          for (uint32_t column = 0; column < nRooms && plantedEnb < nEnbPerFloor; column++, plantedEnb++)
+            {
+              Vector v (roomLength * (column + 0.5), roomLength * (row + 0.5), nodeHeight);
+              positionAlloc->Add (v);
+              enbPosition.push_back (v);
+              mobility.Install (ueNodes.at(plantedEnb));
+            }
+        }
+      mobility.SetPositionAllocator (positionAlloc);
+      mobility.Install (enbNodes);
+      BuildingsHelper::Install (enbNodes);
+
+      // Position of UEs attached to eNB
+      for (uint32_t i = 0; i < nEnb; i++)
+        {
+          Ptr<UniformRandomVariable> posX = CreateObject<UniformRandomVariable> ();
+          posX->SetAttribute ("Min", DoubleValue (enbPosition.at(i).x - roomLength * 0.5));
+          posX->SetAttribute ("Max", DoubleValue (enbPosition.at(i).x + roomLength * 0.5));
+          Ptr<UniformRandomVariable> posY = CreateObject<UniformRandomVariable> ();
+          posY->SetAttribute ("Min", DoubleValue (enbPosition.at(i).y - roomLength * 0.5));
+          posY->SetAttribute ("Max", DoubleValue (enbPosition.at(i).y + roomLength * 0.5));
+          positionAlloc = CreateObject<ListPositionAllocator> ();
+          for (uint32_t j = 0; j < nUe; j++)
+            {
+              positionAlloc->Add (Vector (posX->GetValue (), posY->GetValue (), nodeHeight));
+              mobility.SetPositionAllocator (positionAlloc);
+            }
+          mobility.Install (ueNodes.at(i));
+          BuildingsHelper::Install (ueNodes.at(i));
+        }
+
+    }
+  else
+    {
+      building = CreateObject<Building> ();
+      building->SetBoundaries (Box (0.0, nRooms * roomLength,
+                                    0.0, nRooms * roomLength,
+                                    0.0, nFloors* roomHeight));
+      building->SetBuildingType (Building::Residential);
+      building->SetExtWallsType (Building::ConcreteWithWindows);
+      building->SetNFloors (nFloors);
+      building->SetNRoomsX (nRooms);
+      building->SetNRoomsY (nRooms);
+      mobility.Install (enbNodes);
+      BuildingsHelper::Install (enbNodes);
+      uint32_t plantedEnb = 0;
+      for (uint32_t floor = 0; floor < nFloors; floor++)
+        {
+          uint32_t plantedEnbPerFloor = 0;
+          for (uint32_t row = 0; row < nRooms; row++)
+            {
+              for (uint32_t column = 0; column < nRooms && plantedEnbPerFloor < nEnbPerFloor; column++, plantedEnb++, plantedEnbPerFloor++)
+                {
+                  Vector v (roomLength * (column + 0.5),
+                            roomLength * (row + 0.5),
+                            nodeHeight + roomHeight * floor);
+                  positionAlloc->Add (v);
+                  enbPosition.push_back (v);
+                  Ptr<MobilityModel> mmEnb = enbNodes.Get (plantedEnb)->GetObject<MobilityModel> ();
+                  mmEnb->SetPosition (v);
+
+                  // Positioning UEs attached to eNB
+                  mobility.Install (ueNodes.at(plantedEnb));
+                  BuildingsHelper::Install (ueNodes.at(plantedEnb));
+                  for (uint32_t ue = 0; ue < nUe; ue++)
+                    {
+                      Ptr<MobilityModel> mmUe = ueNodes.at(plantedEnb).Get (ue)->GetObject<MobilityModel> ();
+                      Vector vUe (v.x, v.y, v.z);
+                      mmUe->SetPosition (vUe);
+                    }
+                }
+            }
+        }
+    }
+
+
+  // Create Devices and install them in the Nodes (eNB and UE)
+  NetDeviceContainer enbDevs;
+  std::vector<NetDeviceContainer> ueDevs;
+  enbDevs = lteHelper->InstallEnbDevice (enbNodes);
+  for (uint32_t i = 0; i < nEnb; i++)
+    {
+      NetDeviceContainer ueDev = lteHelper->InstallUeDevice (ueNodes.at(i));
+      ueDevs.push_back (ueDev);
+      lteHelper->Attach (ueDev, enbDevs.Get (i));
+      enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
+      EpsBearer bearer (q);
+      lteHelper->ActivateDataRadioBearer (ueDev, bearer);
+    }
+
+
+  BuildingsHelper::MakeMobilityModelConsistent ();
+
+  Simulator::Stop (Seconds (simTime));
+  lteHelper->EnableTraces ();
+
+  Simulator::Run ();
+
+  /*GtkConfigStore config;
+  config.ConfigureAttributes ();*/
+
+  Simulator::Destroy ();
+  return 0;
+}
--- a/src/lte/examples/lena-rem-sector-antenna.cc	Wed Nov 13 16:49:02 2013 -0500
+++ b/src/lte/examples/lena-rem-sector-antenna.cc	Thu Nov 14 09:22:14 2013 -0800
@@ -1,230 +1,230 @@
-/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Author: Jaume Nin <jnin@cttc.es>
- */
-
-#include "ns3/core-module.h"
-#include "ns3/network-module.h"
-#include "ns3/mobility-module.h"
-#include "ns3/lte-module.h"
-#include "ns3/config-store.h"
-#include <ns3/buildings-propagation-loss-model.h>
-#include <ns3/buildings-helper.h>
-#include <ns3/radio-environment-map-helper.h>
-#include <iomanip>
-#include <string>
-#include <vector>
-//#include "ns3/gtk-config-store.h"
-
-using namespace ns3;
-using std::vector;
-
-int
-main (int argc, char *argv[])
-{
-  CommandLine cmd;
-  cmd.Parse (argc, argv);
-
-  ConfigStore inputConfig;
-  inputConfig.ConfigureDefaults ();
-
-  cmd.Parse (argc, argv);
-
-  // Geometry of the scenario (in meters)
-  // Assume squared building
-  double nodeHeight = 1.5;
-  double roomHeight = 3;
-  double roomLength = 500;
-  uint32_t nRooms = 2;
-  // Create one eNodeB per room + one 3 sector eNodeB (i.e. 3 eNodeB) + one regular eNodeB
-  uint32_t nEnb = nRooms*nRooms + 4;
-  uint32_t nUe = 1;
-
-  Ptr < LteHelper > lteHelper = CreateObject<LteHelper> ();
-  //lteHelper->EnableLogComponents ();
-  lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisPropagationLossModel"));
-
-  // Create Nodes: eNodeB and UE
-  NodeContainer enbNodes;
-  NodeContainer oneSectorNodes;
-  NodeContainer threeSectorNodes;
-  vector < NodeContainer > ueNodes;
-
-  oneSectorNodes.Create (nEnb-3);
-  threeSectorNodes.Create (3);
-
-  enbNodes.Add (oneSectorNodes);
-  enbNodes.Add (threeSectorNodes);
-
-  for (uint32_t i = 0; i < nEnb; i++)
-    {
-      NodeContainer ueNode;
-      ueNode.Create (nUe);
-      ueNodes.push_back (ueNode);
-    }
-
-  MobilityHelper mobility;
-  vector<Vector> enbPosition;
-  Ptr < ListPositionAllocator > positionAlloc = CreateObject<ListPositionAllocator> ();
-  Ptr < Building > building;
-  building = Create<Building> ();
-  building->SetBoundaries (Box (0.0, nRooms * roomLength,
-                                0.0, nRooms * roomLength,
-                                0.0, roomHeight));
-  building->SetBuildingType (Building::Residential);
-  building->SetExtWallsType (Building::ConcreteWithWindows);
-  building->SetNFloors (1);
-  building->SetNRoomsX (nRooms);
-  building->SetNRoomsY (nRooms);
-  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
-  mobility.Install (enbNodes);
-  BuildingsHelper::Install (enbNodes);
-  uint32_t plantedEnb = 0;
-  for (uint32_t row = 0; row < nRooms; row++)
-    {
-      for (uint32_t column = 0; column < nRooms; column++, plantedEnb++)
-        {
-          Vector v (roomLength * (column + 0.5),
-                    roomLength * (row + 0.5),
-                    nodeHeight );
-          positionAlloc->Add (v);
-          enbPosition.push_back (v);
-          Ptr<MobilityModel> mmEnb = enbNodes.Get (plantedEnb)->GetObject<MobilityModel> ();
-          mmEnb->SetPosition (v);
-        }
-    }
-
-  // Add a 1-sector site
-  Vector v (500, 3000, nodeHeight);
-  positionAlloc->Add (v);
-  enbPosition.push_back (v);
-  mobility.Install (ueNodes.at(plantedEnb));
-  plantedEnb++;
-
-  // Add the 3-sector site
-  for (uint32_t index = 0; index < 3; index++, plantedEnb++)
-    {
-      Vector v (500, 2000, nodeHeight);
-      positionAlloc->Add (v);
-      enbPosition.push_back (v);
-      mobility.Install (ueNodes.at(plantedEnb));
-    }
-
-
-  mobility.SetPositionAllocator (positionAlloc);
-  mobility.Install (enbNodes);
-
-  // Position of UEs attached to eNB
-  for (uint32_t i = 0; i < nEnb; i++)
-    {
-      Ptr<UniformRandomVariable> posX = CreateObject<UniformRandomVariable> ();
-      posX->SetAttribute ("Min", DoubleValue (enbPosition.at(i).x - roomLength * 0));
-      posX->SetAttribute ("Max", DoubleValue (enbPosition.at(i).x + roomLength * 0));
-      Ptr<UniformRandomVariable> posY = CreateObject<UniformRandomVariable> ();
-      posY->SetAttribute ("Min", DoubleValue (enbPosition.at(i).y - roomLength * 0));
-      posY->SetAttribute ("Max", DoubleValue (enbPosition.at(i).y + roomLength * 0));
-      positionAlloc = CreateObject<ListPositionAllocator> ();
-      for (uint32_t j = 0; j < nUe; j++)
-        {
-          if ( i == nEnb - 3 )
-            {
-              positionAlloc->Add (Vector (enbPosition.at(i).x + 10, enbPosition.at(i).y, nodeHeight));
-            }
-          else if ( i == nEnb - 2 )
-            {
-              positionAlloc->Add (Vector (enbPosition.at(i).x - std::sqrt (10), enbPosition.at(i).y + std::sqrt (10), nodeHeight));
-            }
-          else if ( i == nEnb - 1 )
-            {
-              positionAlloc->Add (Vector (enbPosition.at(i).x - std::sqrt (10), enbPosition.at(i).y - std::sqrt (10), nodeHeight));
-            }
-          else
-            {
-              positionAlloc->Add (Vector (posX->GetValue (), posY->GetValue (), nodeHeight));
-            }
-          mobility.SetPositionAllocator (positionAlloc);
-        }
-      mobility.Install (ueNodes.at(i));
-      BuildingsHelper::Install (ueNodes.at(i));
-    }
-
-  // Create Devices and install them in the Nodes (eNB and UE)
-  NetDeviceContainer enbDevs;
-  vector < NetDeviceContainer > ueDevs;
-
-  // power setting in dBm for small cells
-  Config::SetDefault ("ns3::LteEnbPhy::TxPower", DoubleValue (20.0));
-  enbDevs = lteHelper->InstallEnbDevice (oneSectorNodes);
-
-
-  // power setting for three-sector macrocell
-  Config::SetDefault ("ns3::LteEnbPhy::TxPower", DoubleValue (43.0));
-
-  // Beam width is made quite narrow so sectors can be noticed in the REM
-  lteHelper->SetEnbAntennaModelType ("ns3::CosineAntennaModel");
-  lteHelper->SetEnbAntennaModelAttribute ("Orientation", DoubleValue (0));
-  lteHelper->SetEnbAntennaModelAttribute ("Beamwidth",   DoubleValue (100));
-  lteHelper->SetEnbAntennaModelAttribute ("MaxGain",     DoubleValue (0.0));
-  enbDevs.Add ( lteHelper->InstallEnbDevice (threeSectorNodes.Get (0)));
-
-  lteHelper->SetEnbAntennaModelType ("ns3::CosineAntennaModel");
-  lteHelper->SetEnbAntennaModelAttribute ("Orientation", DoubleValue (360/3));
-  lteHelper->SetEnbAntennaModelAttribute ("Beamwidth",   DoubleValue (100));
-  lteHelper->SetEnbAntennaModelAttribute ("MaxGain",     DoubleValue (0.0));
-  enbDevs.Add ( lteHelper->InstallEnbDevice (threeSectorNodes.Get (1)));
-
-  lteHelper->SetEnbAntennaModelType ("ns3::CosineAntennaModel");
-  lteHelper->SetEnbAntennaModelAttribute ("Orientation", DoubleValue (2*360/3));
-  lteHelper->SetEnbAntennaModelAttribute ("Beamwidth",   DoubleValue (100));
-  lteHelper->SetEnbAntennaModelAttribute ("MaxGain",     DoubleValue (0.0));
-  enbDevs.Add ( lteHelper->InstallEnbDevice (threeSectorNodes.Get (2)));
-
-  for (uint32_t i = 0; i < nEnb; i++)
-    {
-      NetDeviceContainer ueDev = lteHelper->InstallUeDevice (ueNodes.at(i));
-      ueDevs.push_back (ueDev);
-      lteHelper->Attach (ueDev, enbDevs.Get (i));
-      enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
-      EpsBearer bearer (q);
-      lteHelper->ActivateDataRadioBearer (ueDev, bearer);
-    }
-
-  BuildingsHelper::MakeMobilityModelConsistent ();
-
-  // by default, simulation will anyway stop right after the REM has been generated
-  Simulator::Stop (Seconds (0.0069));  
-
-  Ptr<RadioEnvironmentMapHelper> remHelper = CreateObject<RadioEnvironmentMapHelper> ();
-  remHelper->SetAttribute ("ChannelPath", StringValue ("/ChannelList/0"));
-  remHelper->SetAttribute ("OutputFile", StringValue ("rem.out"));
-  remHelper->SetAttribute ("XMin", DoubleValue (-2000.0));
-  remHelper->SetAttribute ("XMax", DoubleValue (+2000.0));
-  remHelper->SetAttribute ("YMin", DoubleValue (-500.0));
-  remHelper->SetAttribute ("YMax", DoubleValue (+3500.0));
-  remHelper->SetAttribute ("Z", DoubleValue (1.5));
-  remHelper->Install ();
-
-  Simulator::Run ();
-
-//  GtkConfigStore config;
-//  config.ConfigureAttributes ();
-
-  lteHelper = 0;
-  Simulator::Destroy ();
-  return 0;
-}
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Jaume Nin <jnin@cttc.es>
+ */
+
+#include "ns3/core-module.h"
+#include "ns3/network-module.h"
+#include "ns3/mobility-module.h"
+#include "ns3/lte-module.h"
+#include "ns3/config-store.h"
+#include <ns3/buildings-propagation-loss-model.h>
+#include <ns3/buildings-helper.h>
+#include <ns3/radio-environment-map-helper.h>
+#include <iomanip>
+#include <string>
+#include <vector>
+//#include "ns3/gtk-config-store.h"
+
+using namespace ns3;
+using std::vector;
+
+int
+main (int argc, char *argv[])
+{
+  CommandLine cmd;
+  cmd.Parse (argc, argv);
+
+  ConfigStore inputConfig;
+  inputConfig.ConfigureDefaults ();
+
+  cmd.Parse (argc, argv);
+
+  // Geometry of the scenario (in meters)
+  // Assume squared building
+  double nodeHeight = 1.5;
+  double roomHeight = 3;
+  double roomLength = 500;
+  uint32_t nRooms = 2;
+  // Create one eNodeB per room + one 3 sector eNodeB (i.e. 3 eNodeB) + one regular eNodeB
+  uint32_t nEnb = nRooms*nRooms + 4;
+  uint32_t nUe = 1;
+
+  Ptr < LteHelper > lteHelper = CreateObject<LteHelper> ();
+  //lteHelper->EnableLogComponents ();
+  lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisPropagationLossModel"));
+
+  // Create Nodes: eNodeB and UE
+  NodeContainer enbNodes;
+  NodeContainer oneSectorNodes;
+  NodeContainer threeSectorNodes;
+  vector < NodeContainer > ueNodes;
+
+  oneSectorNodes.Create (nEnb-3);
+  threeSectorNodes.Create (3);
+
+  enbNodes.Add (oneSectorNodes);
+  enbNodes.Add (threeSectorNodes);
+
+  for (uint32_t i = 0; i < nEnb; i++)
+    {
+      NodeContainer ueNode;
+      ueNode.Create (nUe);
+      ueNodes.push_back (ueNode);
+    }
+
+  MobilityHelper mobility;
+  vector<Vector> enbPosition;
+  Ptr < ListPositionAllocator > positionAlloc = CreateObject<ListPositionAllocator> ();
+  Ptr < Building > building;
+  building = Create<Building> ();
+  building->SetBoundaries (Box (0.0, nRooms * roomLength,
+                                0.0, nRooms * roomLength,
+                                0.0, roomHeight));
+  building->SetBuildingType (Building::Residential);
+  building->SetExtWallsType (Building::ConcreteWithWindows);
+  building->SetNFloors (1);
+  building->SetNRoomsX (nRooms);
+  building->SetNRoomsY (nRooms);
+  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
+  mobility.Install (enbNodes);
+  BuildingsHelper::Install (enbNodes);
+  uint32_t plantedEnb = 0;
+  for (uint32_t row = 0; row < nRooms; row++)
+    {
+      for (uint32_t column = 0; column < nRooms; column++, plantedEnb++)
+        {
+          Vector v (roomLength * (column + 0.5),
+                    roomLength * (row + 0.5),
+                    nodeHeight );
+          positionAlloc->Add (v);
+          enbPosition.push_back (v);
+          Ptr<MobilityModel> mmEnb = enbNodes.Get (plantedEnb)->GetObject<MobilityModel> ();
+          mmEnb->SetPosition (v);
+        }
+    }
+
+  // Add a 1-sector site
+  Vector v (500, 3000, nodeHeight);
+  positionAlloc->Add (v);
+  enbPosition.push_back (v);
+  mobility.Install (ueNodes.at(plantedEnb));
+  plantedEnb++;
+
+  // Add the 3-sector site
+  for (uint32_t index = 0; index < 3; index++, plantedEnb++)
+    {
+      Vector v (500, 2000, nodeHeight);
+      positionAlloc->Add (v);
+      enbPosition.push_back (v);
+      mobility.Install (ueNodes.at(plantedEnb));
+    }
+
+
+  mobility.SetPositionAllocator (positionAlloc);
+  mobility.Install (enbNodes);
+
+  // Position of UEs attached to eNB
+  for (uint32_t i = 0; i < nEnb; i++)
+    {
+      Ptr<UniformRandomVariable> posX = CreateObject<UniformRandomVariable> ();
+      posX->SetAttribute ("Min", DoubleValue (enbPosition.at(i).x - roomLength * 0));
+      posX->SetAttribute ("Max", DoubleValue (enbPosition.at(i).x + roomLength * 0));
+      Ptr<UniformRandomVariable> posY = CreateObject<UniformRandomVariable> ();
+      posY->SetAttribute ("Min", DoubleValue (enbPosition.at(i).y - roomLength * 0));
+      posY->SetAttribute ("Max", DoubleValue (enbPosition.at(i).y + roomLength * 0));
+      positionAlloc = CreateObject<ListPositionAllocator> ();
+      for (uint32_t j = 0; j < nUe; j++)
+        {
+          if ( i == nEnb - 3 )
+            {
+              positionAlloc->Add (Vector (enbPosition.at(i).x + 10, enbPosition.at(i).y, nodeHeight));
+            }
+          else if ( i == nEnb - 2 )
+            {
+              positionAlloc->Add (Vector (enbPosition.at(i).x - std::sqrt (10), enbPosition.at(i).y + std::sqrt (10), nodeHeight));
+            }
+          else if ( i == nEnb - 1 )
+            {
+              positionAlloc->Add (Vector (enbPosition.at(i).x - std::sqrt (10), enbPosition.at(i).y - std::sqrt (10), nodeHeight));
+            }
+          else
+            {
+              positionAlloc->Add (Vector (posX->GetValue (), posY->GetValue (), nodeHeight));
+            }
+          mobility.SetPositionAllocator (positionAlloc);
+        }
+      mobility.Install (ueNodes.at(i));
+      BuildingsHelper::Install (ueNodes.at(i));
+    }
+
+  // Create Devices and install them in the Nodes (eNB and UE)
+  NetDeviceContainer enbDevs;
+  vector < NetDeviceContainer > ueDevs;
+
+  // power setting in dBm for small cells
+  Config::SetDefault ("ns3::LteEnbPhy::TxPower", DoubleValue (20.0));
+  enbDevs = lteHelper->InstallEnbDevice (oneSectorNodes);
+
+
+  // power setting for three-sector macrocell
+  Config::SetDefault ("ns3::LteEnbPhy::TxPower", DoubleValue (43.0));
+
+  // Beam width is made quite narrow so sectors can be noticed in the REM
+  lteHelper->SetEnbAntennaModelType ("ns3::CosineAntennaModel");
+  lteHelper->SetEnbAntennaModelAttribute ("Orientation", DoubleValue (0));
+  lteHelper->SetEnbAntennaModelAttribute ("Beamwidth",   DoubleValue (100));
+  lteHelper->SetEnbAntennaModelAttribute ("MaxGain",     DoubleValue (0.0));
+  enbDevs.Add ( lteHelper->InstallEnbDevice (threeSectorNodes.Get (0)));
+
+  lteHelper->SetEnbAntennaModelType ("ns3::CosineAntennaModel");
+  lteHelper->SetEnbAntennaModelAttribute ("Orientation", DoubleValue (360/3));
+  lteHelper->SetEnbAntennaModelAttribute ("Beamwidth",   DoubleValue (100));
+  lteHelper->SetEnbAntennaModelAttribute ("MaxGain",     DoubleValue (0.0));
+  enbDevs.Add ( lteHelper->InstallEnbDevice (threeSectorNodes.Get (1)));
+
+  lteHelper->SetEnbAntennaModelType ("ns3::CosineAntennaModel");
+  lteHelper->SetEnbAntennaModelAttribute ("Orientation", DoubleValue (2*360/3));
+  lteHelper->SetEnbAntennaModelAttribute ("Beamwidth",   DoubleValue (100));
+  lteHelper->SetEnbAntennaModelAttribute ("MaxGain",     DoubleValue (0.0));
+  enbDevs.Add ( lteHelper->InstallEnbDevice (threeSectorNodes.Get (2)));
+
+  for (uint32_t i = 0; i < nEnb; i++)
+    {
+      NetDeviceContainer ueDev = lteHelper->InstallUeDevice (ueNodes.at(i));
+      ueDevs.push_back (ueDev);
+      lteHelper->Attach (ueDev, enbDevs.Get (i));
+      enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
+      EpsBearer bearer (q);
+      lteHelper->ActivateDataRadioBearer (ueDev, bearer);
+    }
+
+  BuildingsHelper::MakeMobilityModelConsistent ();
+
+  // by default, simulation will anyway stop right after the REM has been generated
+  Simulator::Stop (Seconds (0.0069));  
+
+  Ptr<RadioEnvironmentMapHelper> remHelper = CreateObject<RadioEnvironmentMapHelper> ();
+  remHelper->SetAttribute ("ChannelPath", StringValue ("/ChannelList/0"));
+  remHelper->SetAttribute ("OutputFile", StringValue ("rem.out"));
+  remHelper->SetAttribute ("XMin", DoubleValue (-2000.0));
+  remHelper->SetAttribute ("XMax", DoubleValue (+2000.0));
+  remHelper->SetAttribute ("YMin", DoubleValue (-500.0));
+  remHelper->SetAttribute ("YMax", DoubleValue (+3500.0));
+  remHelper->SetAttribute ("Z", DoubleValue (1.5));
+  remHelper->Install ();
+
+  Simulator::Run ();
+
+//  GtkConfigStore config;
+//  config.ConfigureAttributes ();
+
+  lteHelper = 0;
+  Simulator::Destroy ();
+  return 0;
+}