43 uint32_t bufferPosition,
44 std::string graphTitle,
51 m_buffer = control->GetBufferByDestinationNode (dst);
62 m_plotFileName = (graphTitle.empty()) ?
"QKD_key_material" : graphTitle;
65 if(graphTitle.empty()){
66 std::ostringstream temp1;
112 std::string outputTerminalCommand;
115 outputTerminalCommand =
"pngcair";
117 outputTerminalCommand =
"epslatex";
122 std::ostringstream yrange;
123 yrange <<
"set yrange[1:" <<
m_tempMax <<
"];";
130 m_gnuplot.
AppendExtra (
"set terminal " + outputTerminalCommand +
" size 1524,768 enhanced font 'Helvetica,18'");
150 m_gnuplot.
AppendExtra (
"set arrow from graph 1,0 to graph 1.03,0 size screen 0.025,15,60 filled ls 3");
151 m_gnuplot.
AppendExtra (
"set arrow from graph 0,1 to graph 0,1.03 size screen 0.025,15,60 filled ls 3");
164 std::string plotTitle;
166 if(graphTitle.empty()){
167 plotTitle =
"QKD Key Buffer on node ";
170 std::ostringstream tempSource;
173 std::ostringstream tempDestination;
176 plotTitle = plotTitle + tempSource.str() +
"\\n QKD link between nodes " + tempSource.str() +
" and " + tempDestination.str();
179 plotTitle = graphTitle;
196 tempPlotFileName1 +=
"_data.dat";
197 std::ofstream tempPlotFile1 (tempPlotFileName1.c_str());
199 for(uint i=1;i<=30;i++){
void SetStyle(enum Style style)
void Add(double x, double y)
void SetExtra(const std::string &extra)
Add extra formatting parameters to this dataset.
void SetTitle(const std::string &title)
Change line title.
void AddDataset(const GnuplotDataset &dataset)
void SetLegend(const std::string &xLegend, const std::string &yLegend)
void AppendExtra(const std::string &extra)
void GenerateOutput(std::ostream &os)
Writes gnuplot commands and data values to a single output stream.
void SetTitle(const std::string &title)
void SetOutputFilename(const std::string &outputFilename)
A base class which provides memory management and object aggregation.
Smart pointer class similar to boost::intrusive_ptr.
std::string m_plotFileType
Gnuplot2dDataset m_datasetWorkingState_3
Ptr< QKDBuffer > m_buffer
QKDBuffer associated with the QKDGraph.
uint32_t m_keymMax
get some boundaries for the graph
std::string m_plotFileName
output filename
virtual ~QKDGraph()
Destructor.
Ptr< Node > m_src
source node, info required for graph title
Gnuplot2dDataset m_datasetMaximum
QKDGraph(Ptr< QKDControl > control, Ptr< Node > src, Ptr< Node > dst, uint32_t bufferID, std::string graphTitle, std::string graphType)
Constructor.
Gnuplot m_gnuplot
Gluplot object settings.
void ProcessMStatus(uint32_t value)
The status of the QKDBuffer changed, so plot it on the graph.
void ProcessMStatusHelpFunction(double time, uint32_t newValue)
Help function for detection of status change value.
uint32_t m_keymCurrent
get some boundaries for the graph
Gnuplot2dDataset m_datasetThreshold
uint32_t m_keymMin
get some boundaries for the graph
Gnuplot2dDataset m_datasetWorkingState_0
void InitTotalGraph() const
Initialized function for total graph.
uint32_t m_keymThreshold
get some boundaries for the graph
static TypeId GetTypeId(void)
Get the type ID.
Ptr< Node > m_dst
destination node, info required for graph title
void PrintGraph()
Print the graph.
uint32_t m_graphStatusEntry
temp variable
Gnuplot2dDataset m_datasetWorkingState_1
void ProcessMCurrent(uint32_t value)
MCurrent value of the QKDBuffer changed, so plot it on the graph.
double m_simulationTime
time value, x-axis
void ProcessMThrStatus(uint32_t value)
The Mthr value of the QKDBuffer changed, so plot it on the graph.
Gnuplot2dDataset m_dataset
uint32_t m_tempMax
get some boundaries for the graph
Gnuplot2dDataset m_datasetWorkingState_2
Gnuplot2dDataset m_datasetMinimum
static Time Now()
Return the current simulation virtual time.
double GetSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.