A Discrete-Event Network Simulator
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
21namespace 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 */
33class QKDTotalGraph : public Object
34{
35public:
36
37 /**
38 * @brief Get the type ID.
39 * @return the object TypeId
40 */
41 static TypeId GetTypeId();
42
43 /**
44 * @brief Constructor
45 */
47
48 /**
49 * @brief Constructor
50 * @param std::string graphTitle
51 * @param std::string graphType
52 */
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 */
82
83private:
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
95};
96}
97
98#endif /* QKDTotalGraph */
Class to represent a 2D points plot.
Definition gnuplot.h:105
a simple class to generate gnuplot-ready plotting commands from a set of datasets.
Definition gnuplot.h:360
A base class which provides memory management and object aggregation.
Definition object.h:78
QKDTotalGraph is implemented to allow easier access to the state of ALL QBuffers and easier monitorin...
double m_simulationTime
time value, x-axis
~QKDTotalGraph() override
Destructor.
Gnuplot2dDataset m_dataset
void PrintGraph()
Print the graph.
std::string m_plotFileName
output filename
static TypeId GetTypeId()
Get the type ID.
uint32_t m_keymCurrent
get some boundaries for the graph
void ProcessMCurrent(uint32_t value, char sign)
MCurrent value of the QBuffer changed, so plot it on the graph.
void Init(std::string graphName, std::string graphType)
Initialized function used in constructor.
uint32_t m_keymThreshold
get some boundaries for the graph
uint32_t m_keymMax
get some boundaries for the graph
QKDTotalGraph()
Constructor.
std::string m_plotFileType
a unique identifier for an interface.
Definition type-id.h:49
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static unsigned int value(char c)