13#include "ns3/building.h"
14#include "ns3/double.h"
17#include "ns3/uinteger.h"
44 TypeId(
"ns3::GridBuildingAllocator")
46 .AddConstructor<GridBuildingAllocator>()
47 .SetGroupName(
"Buildings")
48 .AddAttribute(
"GridWidth",
49 "The number of objects laid out on a line.",
54 "The x coordinate where the grid starts.",
59 "The y coordinate where the grid starts.",
63 .AddAttribute(
"LengthX",
64 "The length of the wall of each building along the X axis.",
68 .AddAttribute(
"LengthY",
69 "The length of the wall of each building along the X axis.",
73 .AddAttribute(
"DeltaX",
74 "The x space between buildings.",
78 .AddAttribute(
"DeltaY",
79 "The y space between buildings.",
83 .AddAttribute(
"Height",
84 "The height of the building (roof level)",
88 .AddAttribute(
"LayoutType",
89 "The type of layout.",
118 Box box(lowerLeft.x, upperRight.x, lowerLeft.y, upperRight.y, 0,
m_height);
Hold a value for an Attribute.
keep track of a set of building pointers.
void Add(BuildingContainer other)
Append the contents of another BuildingContainer to the end of this container.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Hold variables of type enum.
void SetBuildingAttribute(std::string n, const AttributeValue &v)
Set an attribute to be used for each new building to be created.
~GridBuildingAllocator() override
double m_yMin
The y coordinate where the grid starts.
ObjectFactory m_buildingFactory
The building factory.
GridPositionAllocator::LayoutType m_layoutType
Layout type.
static TypeId GetTypeId()
Get the type ID.
double m_xMin
The x coordinate where the grid starts.
uint32_t m_n
The number of objects laid out on a line.
BuildingContainer Create(uint32_t n) const
Create a set of buildings allocated on a grid.
double m_deltaX
The x space between buildings.
Ptr< GridPositionAllocator > m_lowerLeftPositionAllocator
The upper left position allocator.
double m_lengthX
The length of the wall of each building along the X axis.
void PushAttributes() const
Pushes the attributes into the relevant position allocators.
uint32_t m_current
Current building number.
double m_deltaY
The y space between buildings.
double m_height
The height of the building (roof level)
double m_lengthY
The length of the wall of each building along the Y axis.
Ptr< GridPositionAllocator > m_upperRightPositionAllocator
The upper right position allocator.
@ COLUMN_FIRST
In column-first mode, positions are allocated on the first column until N positions have been allocat...
@ ROW_FIRST
In row-first mode, positions are allocated on the first row until N positions have been allocated.
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
A base class which provides memory management and object aggregation.
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
#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_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeUintegerChecker()
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Ptr< const AttributeChecker > MakeDoubleChecker()
Ptr< const AttributeChecker > MakeEnumChecker(T v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)