--- a/src/buildings/model/buildings-mobility-model.h Thu Nov 10 16:00:53 2011 +0100
+++ b/src/buildings/model/buildings-mobility-model.h Fri Nov 11 18:26:01 2011 +0100
@@ -28,11 +28,8 @@
#include <ns3/object.h>
#include <ns3/box.h>
#include <map>
+#include <ns3/building.h>
#include <ns3/constant-velocity-helper.h>
-#include <ns3/building.h>
-//#include "ns3/random-variable.h"
-//#include "ns3/nstime.h"
-//#include "ns3/event-id.h"
@@ -99,4 +96,4 @@
} // namespace ns3
-#endif // BUILDINGS_MOBILITY_MODEL_H
\ No newline at end of file
+#endif // BUILDINGS_MOBILITY_MODEL_H
--- a/src/buildings/test/buildings-pathloss-test.cc Thu Nov 10 16:00:53 2011 +0100
+++ b/src/buildings/test/buildings-pathloss-test.cc Fri Nov 11 18:26:01 2011 +0100
@@ -23,8 +23,6 @@
#include <ns3/log.h>
#include <ns3/buildings-pathloss-test.h>
-#include <ns3/spectrum-model.h>
-#include <ns3/single-model-spectrum-channel.h>
#include "ns3/string.h"
#include "ns3/double.h"
#include <ns3/building.h>
@@ -226,33 +224,18 @@
LogComponentEnable ("BuildingsPropagationLossModel", LOG_LEVEL_ALL);
NS_LOG_INFO ("Testing ");
- Ptr<SpectrumChannel> m_downlinkChannel = CreateObject<SingleModelSpectrumChannel> ();
- Ptr<SpectrumChannel> m_uplinkChannel = CreateObject<SingleModelSpectrumChannel> ();
- Ptr<BuildingsPropagationLossModel> m_downlinkPropagationLossModel = CreateObject<BuildingsPropagationLossModel> ();
- m_downlinkPropagationLossModel->SetAttribute ("Frequency", DoubleValue (m_freq));
- m_downlinkPropagationLossModel->SetAttribute ("Lambda", DoubleValue (300000000.0 /m_freq));
- m_downlinkPropagationLossModel->SetAttribute ("Environment", EnumValue (m_env));
- m_downlinkPropagationLossModel->SetAttribute ("CitySize", EnumValue (m_city));
+
+ Ptr<BuildingsPropagationLossModel> propagationLossModel = CreateObject<BuildingsPropagationLossModel> ();
+ propagationLossModel->SetAttribute ("Frequency", DoubleValue (m_freq));
+ propagationLossModel->SetAttribute ("Lambda", DoubleValue (300000000.0 /m_freq));
+ propagationLossModel->SetAttribute ("Environment", EnumValue (m_env));
+ propagationLossModel->SetAttribute ("CitySize", EnumValue (m_city));
// cancel shadowing effect
- m_downlinkPropagationLossModel->SetAttribute ("ShadowSigmaOutdoor", DoubleValue (0.0));
- m_downlinkPropagationLossModel->SetAttribute ("ShadowSigmaIndoor", DoubleValue (0.0));
- m_downlinkPropagationLossModel->SetAttribute ("ShadowSigmaExtWalls", DoubleValue (0.0));
- Ptr<BuildingsPropagationLossModel> m_uplinkPropagationLossModel = CreateObject<BuildingsPropagationLossModel> ();
- m_uplinkPropagationLossModel->SetAttribute ("Frequency", DoubleValue (m_freq));
- m_uplinkPropagationLossModel->SetAttribute ("Lambda", DoubleValue (300000000.0 /m_freq));
- // cancel shadowing effect
- m_uplinkPropagationLossModel->SetAttribute ("ShadowSigmaOutdoor", DoubleValue (0.0));
- m_uplinkPropagationLossModel->SetAttribute ("ShadowSigmaIndoor", DoubleValue (0.0));
- m_uplinkPropagationLossModel->SetAttribute ("ShadowSigmaExtWalls", DoubleValue (0.0));
- m_downlinkChannel->AddPropagationLossModel (m_downlinkPropagationLossModel);
- m_uplinkChannel->AddPropagationLossModel (m_uplinkPropagationLossModel);
+ propagationLossModel->SetAttribute ("ShadowSigmaOutdoor", DoubleValue (0.0));
+ propagationLossModel->SetAttribute ("ShadowSigmaIndoor", DoubleValue (0.0));
+ propagationLossModel->SetAttribute ("ShadowSigmaExtWalls", DoubleValue (0.0));
-
-
- Simulator::Stop (Seconds (0.1));
- Simulator::Run ();
- Simulator::Destroy ();
- double loss = m_downlinkPropagationLossModel->GetLoss (m_node1, m_node2);
+ double loss = propagationLossModel->GetLoss (m_node1, m_node2);
NS_LOG_INFO ("Calculated loss: " << loss);
NS_LOG_INFO ("Theoretical loss: " << m_lossRef);
--- a/src/buildings/test/buildings-shadowing-test.cc Thu Nov 10 16:00:53 2011 +0100
+++ b/src/buildings/test/buildings-shadowing-test.cc Fri Nov 11 18:26:01 2011 +0100
@@ -22,20 +22,10 @@
#include "ns3/log.h"
#include "ns3/buildings-shadowing-test.h"
#include <ns3/buildings-propagation-loss-model.h>
-#include <ns3/spectrum-model.h>
-#include <ns3/single-model-spectrum-channel.h>
#include "ns3/string.h"
#include "ns3/double.h"
#include <ns3/building.h>
#include <ns3/enum.h>
-// #include <ns3/net-device-container.h>
-// #include <ns3/lte-ue-net-device.h>
-// #include <ns3/lte-enb-net-device.h>
-// #include <ns3/lte-ue-rrc.h>
-// #include <ns3/lena-helper.h>
-// #include <ns3/lte-enb-phy.h>
-// #include <ns3/lte-ue-phy.h>
-// #include <ns3/lte-test-sinr-chunk-processor.h>
NS_LOG_COMPONENT_DEFINE ("BuildingsShadowingTest");
@@ -163,13 +153,8 @@
int samples = 10000;
for (int i = 0; i < samples; i++)
{
- Ptr<SpectrumChannel> m_downlinkChannel = CreateObject<SingleModelSpectrumChannel> ();
- Ptr<SpectrumChannel> m_uplinkChannel = CreateObject<SingleModelSpectrumChannel> ();
- Ptr<BuildingsPropagationLossModel> m_downlinkPropagationLossModel = CreateObject<BuildingsPropagationLossModel> ();
- Ptr<BuildingsPropagationLossModel> m_uplinkPropagationLossModel = CreateObject<BuildingsPropagationLossModel> ();
- m_downlinkChannel->AddPropagationLossModel (m_downlinkPropagationLossModel);
- m_uplinkChannel->AddPropagationLossModel (m_uplinkPropagationLossModel);
- loss.push_back (m_downlinkPropagationLossModel->GetLoss (m_node1, m_node2) - m_lossRef);
+ Ptr<BuildingsPropagationLossModel> propagationLossModel = CreateObject<BuildingsPropagationLossModel> ();
+ loss.push_back (propagationLossModel->GetLoss (m_node1, m_node2) - m_lossRef);
sum += loss.at (loss.size()-1);
sumSquared += (loss.at (loss.size()-1)*loss.at (loss.size()-1));
}