A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
qkd-total-graph.h
Go to the documentation of this file.
1
/*
2
* Copyright(c) 2020 DOTFEESA www.tk.etf.unsa.ba
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
*
7
*
8
* Author: Miralem Mehic <miralem.mehic@ieee.org>
9
*/
10
11
#ifndef QKD_TOTAL_GRAPH_H
12
#define QKD_TOTAL_GRAPH_H
13
14
#include <fstream>
15
#include "ns3/object.h"
16
#include "ns3/gnuplot.h"
17
#include "ns3/core-module.h"
18
#include "ns3/node-list.h"
19
#include <sstream>
20
21
namespace
ns3
{
22
23
/**
24
* @ingroup qkd
25
* @class QKDTotalGraph
26
* @brief QKDTotalGraph is implemented to allow easier access to the state of
27
* ALL QBuffers and easier monitoring of the overall key material consumption.
28
*
29
* @note QKDTotalGraph is used to show the overall consumption of key material in QKD Network.
30
* QKD Total Graph is updated each time when key material is generated or consumed on a
31
* network link. Only one QKDTotalGraph in the whole simulation is allowed!
32
*/
33
class
QKDTotalGraph
:
public
Object
34
{
35
public
:
36
37
/**
38
* @brief Get the type ID.
39
* @return the object TypeId
40
*/
41
static
TypeId
GetTypeId
();
42
43
/**
44
* @brief Constructor
45
*/
46
QKDTotalGraph
();
47
48
/**
49
* @brief Constructor
50
* @param std::string graphTitle
51
* @param std::string graphType
52
*/
53
QKDTotalGraph
(
54
std::string
graphName
,
55
std::string
graphType
56
);
57
58
/**
59
* @brief Initialized function used in constructor
60
*/
61
void
Init
(
62
std::string
graphName
,
63
std::string
graphType
64
);
65
66
/**
67
* @brief Destructor
68
*/
69
~QKDTotalGraph
()
override
;
70
71
/**
72
* @brief Print the graph
73
*/
74
void
PrintGraph
();
75
76
/**
77
* @brief MCurrent value of the QBuffer changed, so plot it on the graph
78
* @param uint32_t value
79
* @param char signToBePloted
80
*/
81
void
ProcessMCurrent
(
uint32_t
value
,
char
sign
);
82
83
private
:
84
85
uint32_t
m_keymCurrent
;
//!< get some boundaries for the graph
86
uint32_t
m_keymThreshold
;
//!< get some boundaries for the graph
87
uint32_t
m_keymMax
;
//!< get some boundaries for the graph
88
89
std::string
m_plotFileName
;
//!< output filename
90
std::string
m_plotFileType
;
//png or svg
91
double
m_simulationTime
;
//!< time value, x-axis
92
93
Gnuplot
m_gnuplot
;
94
Gnuplot2dDataset
m_dataset
;
95
};
96
}
97
98
#endif
/* QKDTotalGraph */
ns3::Gnuplot2dDataset
Class to represent a 2D points plot.
Definition
gnuplot.h:105
ns3::Gnuplot
a simple class to generate gnuplot-ready plotting commands from a set of datasets.
Definition
gnuplot.h:360
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::QKDTotalGraph
QKDTotalGraph is implemented to allow easier access to the state of ALL QBuffers and easier monitorin...
Definition
qkd-total-graph.h:34
ns3::QKDTotalGraph::m_simulationTime
double m_simulationTime
time value, x-axis
Definition
qkd-total-graph.h:91
ns3::QKDTotalGraph::~QKDTotalGraph
~QKDTotalGraph() override
Destructor.
Definition
qkd-total-graph.cc:27
ns3::QKDTotalGraph::m_dataset
Gnuplot2dDataset m_dataset
Definition
qkd-total-graph.h:94
ns3::QKDTotalGraph::PrintGraph
void PrintGraph()
Print the graph.
Definition
qkd-total-graph.cc:122
ns3::QKDTotalGraph::m_plotFileName
std::string m_plotFileName
output filename
Definition
qkd-total-graph.h:89
ns3::QKDTotalGraph::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
qkd-total-graph.cc:19
ns3::QKDTotalGraph::m_keymCurrent
uint32_t m_keymCurrent
get some boundaries for the graph
Definition
qkd-total-graph.h:85
ns3::QKDTotalGraph::m_gnuplot
Gnuplot m_gnuplot
Definition
qkd-total-graph.h:93
ns3::QKDTotalGraph::ProcessMCurrent
void ProcessMCurrent(uint32_t value, char sign)
MCurrent value of the QBuffer changed, so plot it on the graph.
Definition
qkd-total-graph.cc:148
ns3::QKDTotalGraph::Init
void Init(std::string graphName, std::string graphType)
Initialized function used in constructor.
Definition
qkd-total-graph.cc:41
ns3::QKDTotalGraph::m_keymThreshold
uint32_t m_keymThreshold
get some boundaries for the graph
Definition
qkd-total-graph.h:86
ns3::QKDTotalGraph::m_keymMax
uint32_t m_keymMax
get some boundaries for the graph
Definition
qkd-total-graph.h:87
ns3::QKDTotalGraph::QKDTotalGraph
QKDTotalGraph()
Constructor.
Definition
qkd-total-graph.cc:29
ns3::QKDTotalGraph::m_plotFileType
std::string m_plotFileType
Definition
qkd-total-graph.h:90
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:49
uint32_t
ns3::Create
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition
ptr.h:436
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::value
static unsigned int value(char c)
Definition
qkd-encryptor.cc:267
src
qkd
model
qkd-total-graph.h
Generated on Mon Dec 15 2025 15:22:03 for ns-3 by
1.9.8