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.
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
BuildingContainer Create(uint32_t n) const
Create a set of buildings allocated on a grid.
#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.
keep track of a set of building pointers.
AttributeValue implementation for Box.
virtual ~GridBuildingAllocator()
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void Set(std::string name, const AttributeValue &value)
Set an attribute to be set during construction.
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
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.
Ptr< const AttributeChecker > MakeEnumChecker(int v1, std::string n1, int v2, std::string n2, int v3, std::string n3, int v4, std::string n4, int v5, std::string n5, int v6, std::string n6, int v7, std::string n7, int v8, std::string n8, int v9, std::string n9, int v10, std::string n10, int v11, std::string n11, int v12, std::string n12, int v13, std::string n13, int v14, std::string n14, int v15, std::string n15, int v16, std::string n16, int v17, std::string n17, int v18, std::string n18, int v19, std::string n19, int v20, std::string n20, int v21, std::string n21, int v22, std::string n22)
Make an EnumChecker pre-configured with a set of allowed values by name.
In row-first mode, positions are allocated on the first row until N positions have been allocated...
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.