11#include <ns3/building-position-allocator.h>
12#include <ns3/building.h>
13#include <ns3/buildings-helper.h>
14#include <ns3/constant-position-mobility-model.h>
15#include <ns3/mobility-building-info.h>
16#include <ns3/mobility-helper.h>
17#include <ns3/mobility-model.h>
18#include <ns3/simulator.h>
61 return ((a.
x < b.
x) || ((a.
x == b.
x) && (a.
y < b.
y)) ||
62 ((a.
x == b.
x) && (a.
y == b.
y) && (a.
z < b.
z)));
76 void DoRun()
override;
80 :
TestCase(
"RandomRoom, 12 rooms, 24 nodes")
91 b->SetBoundaries(
Box(1, 3, 1, 4, 1, 3));
100 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
102 mobility.SetPositionAllocator(positionAlloc);
103 mobility.Install(
nodes);
106 std::map<Room, uint32_t> roomCounter;
111 NS_ASSERT_MSG(mm,
"no mobility model aggregated to this node");
114 "MobilityBuildingInfo has not been aggregated to this node mobility model");
117 Room r(bmm->GetRoomNumberX(), bmm->GetRoomNumberY(), bmm->GetFloorNumber());
120 Vector p = mm->GetPosition();
129 for (
auto it = roomCounter.begin(); it != roomCounter.end(); ++it)
153 void DoRun()
override;
168 b->SetBoundaries(
Box(-10, -6, 20, 26, -1, 5));
177 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
179 mobility.SetPositionAllocator(positionAlloc);
180 mobility.Install(
nodes);
186 mobility.SetPositionAllocator(positionAlloc);
187 mobility.Install(copyNodes);
190 std::map<Room, uint32_t> roomCounter;
192 for (
auto it = copyNodes.
Begin(); it != copyNodes.
End(); ++it)
195 NS_ASSERT_MSG(mm,
"no mobility model aggregated to this node");
198 "MobilityBuildingInfo has not been aggregated to this node mobility model");
201 Room r(bmm->GetRoomNumberX(), bmm->GetRoomNumberY(), bmm->GetFloorNumber());
205 for (
auto it = roomCounter.begin(); it != roomCounter.end(); ++it)
bool operator<(const Room &a, const Room &b)
static BuildingPositionAllocatorTestSuite buildingsPositionAllocatorTestSuiteInstance
Static variable for test initialization.
RandomRoomPositionAllocator TestSuite.
BuildingPositionAllocatorTestSuite()
RandomRoomPositionAllocator test.
void DoRun() override
Implementation to actually run this TestCase.
RandomRoomPositionAllocatorTestCase()
SameRoomPositionAllocator test.
SameRoomPositionAllocatorTestCase()
void DoRun() override
Implementation to actually run this TestCase.
static void Install(Ptr< Node > node)
Install the MobilityBuildingInfo to a node.
mobility buildings information (to be used by mobility models)
Helper class used to assign positions and mobility models to nodes.
Keep track of the current position and velocity of an object.
keep track of a set of node pointers.
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Iterator Begin() const
Get an iterator which refers to the first Node in the container.
Smart pointer class similar to boost::intrusive_ptr.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#define NS_TEST_ASSERT_MSG_LT(actual, limit, msg)
Test that an actual value is less than a limit and report and abort if not.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
#define NS_TEST_ASSERT_MSG_GT(actual, limit, msg)
Test that an actual value is greater than a limit and report and abort if not.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint32_t z
Z coord (floor)
Room(uint32_t xx, uint32_t yy, uint32_t zz)
Constructor.