23 #include "ns3/building.h"
24 #include "ns3/double.h"
25 #include "ns3/uinteger.h"
51 static TypeId tid =
TypeId (
"ns3::GridBuildingAllocator")
53 .AddConstructor<GridBuildingAllocator> ()
54 .SetGroupName (
"Buildings")
55 .AddAttribute (
"GridWidth",
"The number of objects laid out on a line.",
58 MakeUintegerChecker<uint32_t> ())
59 .AddAttribute (
"MinX",
"The x coordinate where the grid starts.",
62 MakeDoubleChecker<double> ())
63 .AddAttribute (
"MinY",
"The y coordinate where the grid starts.",
66 MakeDoubleChecker<double> ())
67 .AddAttribute (
"LengthX",
" the length of the wall of each building along the X axis.",
70 MakeDoubleChecker<double> ())
71 .AddAttribute (
"LengthY",
" the length of the wall of each building along the X axis.",
74 MakeDoubleChecker<double> ())
75 .AddAttribute (
"DeltaX",
"The x space between buildings.",
78 MakeDoubleChecker<double> ())
79 .AddAttribute (
"DeltaY",
"The y space between buildings.",
82 MakeDoubleChecker<double> ())
83 .AddAttribute (
"Height",
"The height of the building (roof level)",
86 MakeDoubleChecker<double> ())
87 .AddAttribute (
"LayoutType",
"The type of layout.",
114 Box box (lowerLeft.x, upperRight.x, lowerLeft.y, upperRight.y, 0,
m_height);
Hold a value for an Attribute.
AttributeValue implementation for Box.
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.
enum GridPositionAllocator::LayoutType m_layoutType
void SetBuildingAttribute(std::string n, const AttributeValue &v)
Set an attribute to be used for each new building to be created.
static TypeId GetTypeId(void)
ObjectFactory m_buildingFactory
BuildingContainer Create(uint32_t n) const
Create a set of buildings allocated on a grid.
virtual ~GridBuildingAllocator()
Ptr< GridPositionAllocator > m_lowerLeftPositionAllocator
void PushAttributes() const
Ptr< GridPositionAllocator > m_upperRightPositionAllocator
@ 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.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
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.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#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 ",...
#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 > MakeEnumChecker(int v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.