A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
buildings
helper
building-allocator.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2007 INRIA
4
* Copyright (C) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License version 2 as
8
* published by the Free Software Foundation;
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
*
19
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
20
* Author: Nicola Baldo <nbaldo@cttc.es> (took position-allocator and turned it into building-allocator)
21
*/
22
#ifndef BUILDING_ALLOCATOR_H
23
#define BUILDING_ALLOCATOR_H
24
25
#include "ns3/object.h"
26
#include "ns3/object-factory.h"
27
#include "ns3/vector.h"
28
#include "ns3/building-container.h"
29
#include "ns3/position-allocator.h"
30
31
namespace
ns3
{
32
33
class
Building;
34
35
44
class
GridBuildingAllocator
:
public
Object
45
{
46
public
:
47
GridBuildingAllocator
();
48
virtual
~GridBuildingAllocator
();
49
50
// inherited from Object
51
static
TypeId
GetTypeId
(
void
);
52
59
void
SetBuildingAttribute
(std::string
n
,
const
AttributeValue
&v);
60
68
BuildingContainer
Create
(uint32_t
n
)
const
;
69
70
private
:
71
72
void
PushAttributes
()
const
;
73
mutable
uint32_t
m_current
;
74
enum
GridPositionAllocator::LayoutType
m_layoutType
;
75
double
m_xMin
;
76
double
m_yMin
;
77
uint32_t
m_n
;
78
double
m_lengthX
;
79
double
m_lengthY
;
80
double
m_deltaX
;
81
double
m_deltaY
;
82
double
m_height
;
83
84
mutable
ObjectFactory
m_buildingFactory
;
85
Ptr<GridPositionAllocator>
m_lowerLeftPositionAllocator
;
86
Ptr<GridPositionAllocator>
m_upperRightPositionAllocator
;
87
88
};
89
90
}
// namespace ns3
91
92
#endif
/* BUILDING_ALLOCATOR_H */
ns3::GridBuildingAllocator::m_height
double m_height
Definition:
building-allocator.h:82
ns3::GridBuildingAllocator::m_lengthY
double m_lengthY
Definition:
building-allocator.h:79
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:73
ns3::GridBuildingAllocator::GetTypeId
static TypeId GetTypeId(void)
Definition:
building-allocator.cc:49
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:68
ns3::GridBuildingAllocator::Create
BuildingContainer Create(uint32_t n) const
Create a set of buildings allocated on a grid.
Definition:
building-allocator.cc:104
ns3::GridBuildingAllocator::m_lowerLeftPositionAllocator
Ptr< GridPositionAllocator > m_lowerLeftPositionAllocator
Definition:
building-allocator.h:85
ns3::GridBuildingAllocator::PushAttributes
void PushAttributes() const
Definition:
building-allocator.cc:125
ns3::GridBuildingAllocator
Allocate buildings on a rectangular 2d grid.
Definition:
building-allocator.h:44
ns3::GridBuildingAllocator::m_buildingFactory
ObjectFactory m_buildingFactory
Definition:
building-allocator.h:84
ns3::GridBuildingAllocator::m_deltaX
double m_deltaX
Definition:
building-allocator.h:80
ns3::GridBuildingAllocator::m_layoutType
enum GridPositionAllocator::LayoutType m_layoutType
Definition:
building-allocator.h:74
ns3::GridBuildingAllocator::m_upperRightPositionAllocator
Ptr< GridPositionAllocator > m_upperRightPositionAllocator
Definition:
building-allocator.h:86
sample-rng-plot.n
n
Definition:
sample-rng-plot.py:37
ns3::BuildingContainer
keep track of a set of building pointers.
Definition:
building-container.h:40
ns3::GridBuildingAllocator::m_current
uint32_t m_current
Definition:
building-allocator.h:73
ns3::GridBuildingAllocator::m_yMin
double m_yMin
Definition:
building-allocator.h:76
ns3::GridBuildingAllocator::~GridBuildingAllocator
virtual ~GridBuildingAllocator()
Definition:
building-allocator.cc:44
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::GridBuildingAllocator::GridBuildingAllocator
GridBuildingAllocator()
Definition:
building-allocator.cc:36
ns3::GridBuildingAllocator::m_n
uint32_t m_n
Definition:
building-allocator.h:77
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:97
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition:
object-factory.h:47
ns3::GridBuildingAllocator::m_lengthX
double m_lengthX
Definition:
building-allocator.h:78
ns3::GridBuildingAllocator::m_xMin
double m_xMin
Definition:
building-allocator.h:75
ns3::GridBuildingAllocator::m_deltaY
double m_deltaY
Definition:
building-allocator.h:81
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:87
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
ns3::GridPositionAllocator::LayoutType
LayoutType
Determine whether positions are allocated row first or column first.
Definition:
position-allocator.h:117
Generated on Wed Nov 7 2018 10:01:48 for ns-3 by
1.8.14