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 .AddAttribute (
"GridWidth",
"The number of objects layed out on a line.",
57 MakeUintegerChecker<uint32_t> ())
58 .AddAttribute (
"MinX",
"The x coordinate where the grid starts.",
61 MakeDoubleChecker<double> ())
62 .AddAttribute (
"MinY",
"The y coordinate where the grid starts.",
65 MakeDoubleChecker<double> ())
66 .AddAttribute (
"LengthX",
" the length of the wall of each building along the X axis.",
69 MakeDoubleChecker<double> ())
70 .AddAttribute (
"LengthY",
" the length of the wall of each building along the X axis.",
73 MakeDoubleChecker<double> ())
74 .AddAttribute (
"DeltaX",
"The x space between buildings.",
77 MakeDoubleChecker<double> ())
78 .AddAttribute (
"DeltaY",
"The y space between buildings.",
81 MakeDoubleChecker<double> ())
82 .AddAttribute (
"Height",
"The height of the building (roof level)",
85 MakeDoubleChecker<double> ())
86 .AddAttribute (
"LayoutType",
"The type of layout.",
113 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...
double x
x coordinate of vector
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 "...
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)
static TypeId GetTypeId(void)
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register the class in the ns-3 factory.
Hold a value for an Attribute.
void Add(BuildingContainer other)
Append the contents of another BuildingContainer to the end of this container.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void SetTypeId(TypeId tid)
Ptr< GridPositionAllocator > m_lowerLeftPositionAllocator
ObjectFactory m_buildingFactory
enum GridPositionAllocator::LayoutType m_layoutType
void PushAttributes() const
Ptr< GridPositionAllocator > m_upperRightPositionAllocator
hold variables of type 'enum'
Ptr< Object > Create(void) const
BuildingContainer Create(uint32_t n) const
Create a set of buildings allocated on a grid.
Hold an unsigned integer type.
keep track of a set of building pointers.
hold objects of type ns3::Box
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
virtual ~GridBuildingAllocator()
void Set(std::string name, const AttributeValue &value)
double y
y coordinate of vector
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
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...
a base class which provides memory management and object aggregation
Hold a floating point type.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)