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);
In column-first mode, positions are allocated on the first column until N positions have been allocat...
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
static TypeId GetTypeId(void)
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Hold a value for an Attribute.
void Add(BuildingContainer other)
Append the contents of another BuildingContainer to the end of this container.
BuildingContainer Create(uint32_t n) const
Create a set of buildings allocated on a grid.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Ptr< GridPositionAllocator > m_lowerLeftPositionAllocator
void PushAttributes() const
ObjectFactory m_buildingFactory
enum GridPositionAllocator::LayoutType m_layoutType
Ptr< GridPositionAllocator > m_upperRightPositionAllocator
Hold variables of type enum.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
Hold an unsigned integer type.
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
keep track of a set of building pointers.
AttributeValue implementation for Box.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
virtual ~GridBuildingAllocator()
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
void SetBuildingAttribute(std::string n, const AttributeValue &v)
Set an attribute to be used for each new building to be created.
In row-first mode, positions are allocated on the first row until N positions have been allocated...
Ptr< const AttributeChecker > MakeEnumChecker(int v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
A base class which provides memory management and object aggregation.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.