Loading...
Searching...
No Matches
satellite-stats-helper.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2014 Magister Solutions
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: Budiarto Herman <budiarto.herman@magister.fi>
19 *
20 */
21
22#ifndef SATELLITE_STATS_HELPER_H
23#define SATELLITE_STATS_HELPER_H
24
25#include "ns3/attribute.h"
26#include "ns3/net-device-container.h"
27#include "ns3/object.h"
28#include "ns3/ptr.h"
29
30#include <map>
31#include <string>
32
33namespace ns3
34{
35
36class SatHelper;
37class Node;
38class CollectorMap;
39class DataCollectionObject;
40
53
88class SatStatsHelper : public Object
89{
90 public:
91 // COMMON ENUM DATA TYPES ///////////////////////////////////////////////////
92
109
114 static std::string GetIdentifierTypeName(IdentifierType_t identifierType);
115
120 typedef enum
121 {
126 OUTPUT_PDF_FILE, // probability distribution function
127 OUTPUT_CDF_FILE, // cumulative distribution function
131 OUTPUT_PDF_PLOT, // probability distribution function
132 OUTPUT_CDF_PLOT, // cumulative distribution function
133 } OutputType_t;
134
139 static std::string GetOutputTypeName(OutputType_t outputType);
140
141 // CONSTRUCTOR AND DESTRUCTOR ///////////////////////////////////////////////
142
148 SatStatsHelper(Ptr<const SatHelper> satHelper);
149
153 virtual ~SatStatsHelper();
154
158 static TypeId GetTypeId();
159
160 // PUBLIC METHODS ///////////////////////////////////////////////////////////
161
168 void Install();
169
170 // SETTER AND GETTER METHODS ////////////////////////////////////////////////
171
175 void SetName(std::string name);
176
180 std::string GetName() const;
181
186 void SetIdentifierType(IdentifierType_t identifierType);
187
192
197 void SetOutputType(OutputType_t outputType);
198
203
207 bool IsInstalled() const;
208
213 Ptr<const SatHelper> GetSatHelper() const;
214
221 virtual void UpdateAddressAndIdentifier(Ptr<Node> utNode);
222
228 virtual void UpdateIdentifierOnProbes();
229
230 protected:
238 virtual void DoInstall() = 0;
239
245 virtual std::string GetOutputPath() const;
246
255 virtual std::string GetOutputFileName() const;
256
262 virtual std::string GetIdentifierHeading(std::string dataLabel) const;
263
269 virtual std::string GetTimeHeading(std::string dataLabel) const;
270
276 virtual std::string GetDistributionHeading(std::string dataLabel) const;
277
293 Ptr<DataCollectionObject> CreateAggregator(std::string aggregatorTypeId,
294 std::string n1 = "",
295 const AttributeValue& v1 = EmptyAttributeValue(),
296 std::string n2 = "",
297 const AttributeValue& v2 = EmptyAttributeValue(),
298 std::string n3 = "",
299 const AttributeValue& v3 = EmptyAttributeValue(),
300 std::string n4 = "",
301 const AttributeValue& v4 = EmptyAttributeValue(),
302 std::string n5 = "",
303 const AttributeValue& v5 = EmptyAttributeValue());
304
317 uint32_t CreateCollectorPerIdentifier(CollectorMap& collectorMap) const;
318
319 // IDENTIFIER RELATED METHODS ///////////////////////////////////////////////
320
327 uint32_t GetUtUserId(Ptr<Node> utUserNode) const;
328
335 uint32_t GetUtId(Ptr<Node> utNode) const;
336
343 uint32_t GetGwId(Ptr<Node> gwNode) const;
344
351 uint32_t GetSatId(Ptr<Node> satNode) const;
352
357 uint32_t GetIdentifierForUtUser(Ptr<Node> utUserNode) const;
358
363 uint32_t GetIdentifierForUt(Ptr<Node> utNode) const;
364
369 uint32_t GetIdentifierForBeam(uint32_t satId, uint32_t beamId) const;
370
375 uint32_t GetIdentifierForGroup(uint32_t groupId) const;
376
381 uint32_t GetIdentifierForGw(Ptr<Node> gwNode) const;
382
387 uint32_t GetIdentifierForSat(Ptr<Node> satNode) const;
388
393 uint32_t GetIdentifierForIsl(Ptr<Node> satNodeSrc, Ptr<Node> satNodeDst) const;
394
395 // DEVICE RETRIEVAL METHODS /////////////////////////////////////////////////
396
400 static NetDeviceContainer GetGwSatNetDevice(Ptr<Node> gwNode);
401
405 static Ptr<NetDevice> GetUtSatNetDevice(Ptr<Node> utNode);
406
410 static Ptr<NetDevice> GetSatSatOrbiterNetDevice(Ptr<Node> satNode);
411
419 virtual void SaveAddressAndIdentifier(Ptr<Node> utNode);
420
422 std::map<const Address, uint32_t> m_identifierMap;
423
424 private:
425 std::string m_name;
429 Ptr<const SatHelper> m_satHelper;
430
431}; // end of class SatStatsHelper
432
433} // end of namespace ns3
434
435#endif /* SATELLITE_STATS_HELPER_H */
Build a satellite network set with needed objects and configuration.
virtual void UpdateIdentifierOnProbes()
Change identifier used on probes, when handovers occur.
Ptr< const SatHelper > m_satHelper
uint32_t GetIdentifierForBeam(uint32_t satId, uint32_t beamId) const
uint32_t GetIdentifierForGw(Ptr< Node > gwNode) const
uint32_t GetSatId(Ptr< Node > satNode) const
static Ptr< NetDevice > GetSatSatOrbiterNetDevice(Ptr< Node > satNode)
Ptr< const SatHelper > GetSatHelper() const
uint32_t GetIdentifierForUtUser(Ptr< Node > utUserNode) const
static NetDeviceContainer GetGwSatNetDevice(Ptr< Node > gwNode)
IdentifierType_t m_identifierType
void SetIdentifierType(IdentifierType_t identifierType)
void SetName(std::string name)
virtual void SaveAddressAndIdentifier(Ptr< Node > utNode)
Save the address and the proper identifier from the given UT node.
IdentifierType_t GetIdentifierType() const
virtual ~SatStatsHelper()
/ Destructor.
static std::string GetOutputTypeName(OutputType_t outputType)
SatStatsHelper(Ptr< const SatHelper > satHelper)
Creates a new helper instance.
virtual std::string GetIdentifierHeading(std::string dataLabel) const
virtual std::string GetOutputPath() const
static std::string GetIdentifierTypeName(IdentifierType_t identifierType)
Ptr< DataCollectionObject > CreateAggregator(std::string aggregatorTypeId, 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())
Create the aggregator according to the output type.
virtual std::string GetOutputFileName() const
Compute the path and file name where statistics output should be written to.
virtual void UpdateAddressAndIdentifier(Ptr< Node > utNode)
Update the address and the proper identifier from the given UT node.
static TypeId GetTypeId()
inherited from ObjectBase base class
uint32_t GetIdentifierForGroup(uint32_t groupId) const
uint32_t GetUtId(Ptr< Node > utNode) const
void SetOutputType(OutputType_t outputType)
uint32_t CreateCollectorPerIdentifier(CollectorMap &collectorMap) const
Create one collector instance for each identifier in the simulation.
virtual void DoInstall()=0
Install the probes, collectors, and aggregators necessary to produce the statistics output.
OutputType_t
Possible types and formats of statistics output.
uint32_t GetIdentifierForSat(Ptr< Node > satNode) const
static Ptr< NetDevice > GetUtSatNetDevice(Ptr< Node > utNode)
void Install()
Install the probes, collectors, and aggregators necessary to produce the statistics output.
uint32_t GetIdentifierForIsl(Ptr< Node > satNodeSrc, Ptr< Node > satNodeDst) const
OutputType_t GetOutputType() const
uint32_t GetIdentifierForUt(Ptr< Node > utNode) const
std::map< const Address, uint32_t > m_identifierMap
Map of address and the identifier associated with it.
IdentifierType_t
Possible categorization of statistics output.
uint32_t GetUtUserId(Ptr< Node > utUserNode) const
std::string GetName() const
uint32_t GetGwId(Ptr< Node > gwNode) const
virtual std::string GetTimeHeading(std::string dataLabel) const
virtual std::string GetDistributionHeading(std::string dataLabel) const
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.