A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
building-allocator.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007 INRIA
3
* Copyright (C) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
* Author: Nicola Baldo <nbaldo@cttc.es> (took position-allocator and turned it into
20
* building-allocator)
21
*/
22
#ifndef BUILDING_ALLOCATOR_H
23
#define BUILDING_ALLOCATOR_H
24
25
#include "
building-container.h
"
26
27
#include "ns3/object-factory.h"
28
#include "ns3/object.h"
29
#include "ns3/position-allocator.h"
30
#include "ns3/vector.h"
31
32
namespace
ns3
33
{
34
35
class
Building;
36
45
class
GridBuildingAllocator
:
public
Object
46
{
47
public
:
48
GridBuildingAllocator
();
49
~GridBuildingAllocator
()
override
;
50
55
static
TypeId
GetTypeId
();
56
63
void
SetBuildingAttribute
(std::string n,
const
AttributeValue
& v);
64
72
BuildingContainer
Create
(uint32_t n)
const
;
73
74
private
:
78
void
PushAttributes
()
const
;
79
80
mutable
uint32_t
m_current
;
81
GridPositionAllocator::LayoutType
m_layoutType
;
82
double
m_xMin
;
83
double
m_yMin
;
84
uint32_t
m_n
;
85
double
m_lengthX
;
86
double
m_lengthY
;
87
double
m_deltaX
;
88
double
m_deltaY
;
89
double
m_height
;
90
91
mutable
ObjectFactory
m_buildingFactory
;
92
Ptr<GridPositionAllocator>
m_lowerLeftPositionAllocator
;
93
Ptr<GridPositionAllocator>
94
m_upperRightPositionAllocator
;
95
};
96
97
}
// namespace ns3
98
99
#endif
/* BUILDING_ALLOCATOR_H */
building-container.h
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:70
ns3::BuildingContainer
keep track of a set of building pointers.
Definition:
building-container.h:42
ns3::GridBuildingAllocator
Allocate buildings on a rectangular 2d grid.
Definition:
building-allocator.h:46
ns3::GridBuildingAllocator::GridBuildingAllocator
GridBuildingAllocator()
Definition:
building-allocator.cc:39
ns3::GridBuildingAllocator::SetBuildingAttribute
void SetBuildingAttribute(std::string n, const AttributeValue &v)
Set an attribute to be used for each new building to be created.
Definition:
building-allocator.cc:112
ns3::GridBuildingAllocator::~GridBuildingAllocator
~GridBuildingAllocator() override
Definition:
building-allocator.cc:47
ns3::GridBuildingAllocator::m_yMin
double m_yMin
The y coordinate where the grid starts.
Definition:
building-allocator.h:83
ns3::GridBuildingAllocator::m_buildingFactory
ObjectFactory m_buildingFactory
The building factory.
Definition:
building-allocator.h:91
ns3::GridBuildingAllocator::m_layoutType
GridPositionAllocator::LayoutType m_layoutType
Layout type.
Definition:
building-allocator.h:81
ns3::GridBuildingAllocator::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
building-allocator.cc:52
ns3::GridBuildingAllocator::m_xMin
double m_xMin
The x coordinate where the grid starts.
Definition:
building-allocator.h:82
ns3::GridBuildingAllocator::m_n
uint32_t m_n
The number of objects laid out on a line.
Definition:
building-allocator.h:84
ns3::GridBuildingAllocator::Create
BuildingContainer Create(uint32_t n) const
Create a set of buildings allocated on a grid.
Definition:
building-allocator.cc:119
ns3::GridBuildingAllocator::m_deltaX
double m_deltaX
The x space between buildings.
Definition:
building-allocator.h:87
ns3::GridBuildingAllocator::m_lowerLeftPositionAllocator
Ptr< GridPositionAllocator > m_lowerLeftPositionAllocator
The upper left position allocator.
Definition:
building-allocator.h:92
ns3::GridBuildingAllocator::m_lengthX
double m_lengthX
The length of the wall of each building along the X axis.
Definition:
building-allocator.h:85
ns3::GridBuildingAllocator::PushAttributes
void PushAttributes() const
Pushes the attributes into the relevant position allocators.
Definition:
building-allocator.cc:140
ns3::GridBuildingAllocator::m_current
uint32_t m_current
Current building number.
Definition:
building-allocator.h:80
ns3::GridBuildingAllocator::m_deltaY
double m_deltaY
The y space between buildings.
Definition:
building-allocator.h:88
ns3::GridBuildingAllocator::m_height
double m_height
The height of the building (roof level)
Definition:
building-allocator.h:89
ns3::GridBuildingAllocator::m_lengthY
double m_lengthY
The length of the wall of each building along the Y axis.
Definition:
building-allocator.h:86
ns3::GridBuildingAllocator::m_upperRightPositionAllocator
Ptr< GridPositionAllocator > m_upperRightPositionAllocator
The upper right position allocator.
Definition:
building-allocator.h:94
ns3::GridPositionAllocator::LayoutType
LayoutType
Determine whether positions are allocated row first or column first.
Definition:
position-allocator.h:136
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition:
object-factory.h:48
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
buildings
helper
building-allocator.h
Generated on Sun Mar 3 2024 17:10:54 for ns-3 by
1.9.1