A Discrete-Event Network Simulator
API
group-mobility-helper.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2008 INRIA
4 * Copyright (c) 2021 University of Washington: Group mobility changes
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 * Adapted from 'mobility-helper.h' for group mobility by Tom Henderson
21 */
22
23#ifndef GROUP_MOBILITY_HELPER_H
24#define GROUP_MOBILITY_HELPER_H
25
26#include <vector>
27#include "ns3/object-factory.h"
28#include "ns3/attribute.h"
29#include "ns3/node-container.h"
30
31namespace ns3 {
32
33class PositionAllocator;
34class MobilityModel;
35
47{
48public:
53
58
66
91 void SetReferencePositionAllocator (std::string type,
92 std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
93 std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
94 std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
95 std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
96 std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
97 std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
98 std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue (),
99 std::string n8 = "", const AttributeValue &v8 = EmptyAttributeValue (),
100 std::string n9 = "", const AttributeValue &v9 = EmptyAttributeValue ());
101
109
134 void SetMemberPositionAllocator (std::string type,
135 std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
136 std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
137 std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
138 std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
139 std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
140 std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
141 std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue (),
142 std::string n8 = "", const AttributeValue &v8 = EmptyAttributeValue (),
143 std::string n9 = "", const AttributeValue &v9 = EmptyAttributeValue ());
144
152
177 void SetReferenceMobilityModel (std::string type,
178 std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
179 std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
180 std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
181 std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
182 std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
183 std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
184 std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue (),
185 std::string n8 = "", const AttributeValue &v8 = EmptyAttributeValue (),
186 std::string n9 = "", const AttributeValue &v9 = EmptyAttributeValue ());
187
215 void SetMemberMobilityModel (std::string type,
216 std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
217 std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
218 std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
219 std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
220 std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
221 std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
222 std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue (),
223 std::string n8 = "", const AttributeValue &v8 = EmptyAttributeValue (),
224 std::string n9 = "", const AttributeValue &v9 = EmptyAttributeValue ());
225
235 void Install (Ptr<Node> node);
245 void Install (std::string nodeName);
246
256 void Install (NodeContainer container);
257
276 int64_t AssignStreams (NodeContainer c, int64_t stream);
277
278private:
279
285};
286
287} // namespace ns3
288
289#endif /* GROUP_MOBILITY_HELPER_H */
Hold a value for an Attribute.
Definition: attribute.h:69
A class for an empty attribute value.
Definition: attribute.h:233
Helper class used to assign positions and mobility models to nodes for a group mobility configuration...
int64_t AssignStreams(NodeContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by the mobility models on t...
ObjectFactory m_memberMobilityFactory
Object factory to create member mobility models.
void SetMemberPositionAllocator(Ptr< PositionAllocator > allocator)
Set the position allocator which will be used to allocate the initial position of the member mobility...
void Install(Ptr< Node > node)
Install and configure a hierarchical mobility model to the given node, based on the configured refere...
void SetReferenceMobilityModel(Ptr< MobilityModel > mobility)
Set the reference mobility model which will be installed as the parent mobility model during GroupMob...
bool m_referencePositionSet
flag for avoiding multiple SetPosition calls on the reference model
~GroupMobilityHelper()
Destroy a group mobility helper.
Ptr< PositionAllocator > m_referencePosition
Position allocator for use as reference position allocator.
Ptr< PositionAllocator > m_memberPosition
Position allocator for use as member position allocator.
void SetReferencePositionAllocator(Ptr< PositionAllocator > allocator)
Set the position allocator which will be used to allocate the initial position of the reference mobil...
Ptr< MobilityModel > m_referenceMobility
Reference mobility model.
GroupMobilityHelper()
Construct a group mobility helper.
void SetMemberMobilityModel(std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue())
Configure the mobility model which will be installed as the member (child) mobility model during Grou...
keep track of a set of node pointers.
Instantiate subclasses of ns3::Object.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
Every class exported by the ns3 library is enclosed in the ns3 namespace.
mobility
Definition: third.py:107