From 49354e2ba98cb91b802f974d6119d7cc698aad29 Mon Sep 17 00:00:00 2001 From: Arunima Chaudhuri Date: Tue, 5 Mar 2024 16:08:48 +0530 Subject: [PATCH 1/4] Modify text box positioning to appear outside plots Signed-off-by: Arunima Chaudhuri --- DAS/visualizor.py | 211 ++++++++++++++++++++++++++-------------------- 1 file changed, 120 insertions(+), 91 deletions(-) diff --git a/DAS/visualizor.py b/DAS/visualizor.py index 4a294e8..a10143b 100644 --- a/DAS/visualizor.py +++ b/DAS/visualizor.py @@ -9,12 +9,8 @@ def plotData(conf): plt.clf() fig = plt.figure("9, 3") plt.grid(True) - if conf["desLoc"] == 1: - xDes = 0 - else: - xDes = conf["xdots"][-1] * 0.6 props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(xDes, conf["yaxismax"]/3, conf["textBox"], fontsize=10, verticalalignment='top', bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) if conf["type"] == "plot" or conf["type"] == "plot_with_1line": for i in range(len(conf["data"])): plt.plot(conf["xdots"], conf["data"][i], conf["colors"][i], label=conf["labels"][i]) @@ -41,7 +37,7 @@ def plotBoxData(conf): props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) num_boxes = len(conf["data"]) positions = np.arange(num_boxes) - plt.text(0.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.boxplot(conf["data"], patch_artist=True, showmeans=True, meanline=True, positions=positions) plt.title(conf["title"], fontsize=14) plt.ylabel(conf["ylabel"], fontsize=12) @@ -172,8 +168,9 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Box Plot of Restore Row Count by Nodes" conf["xlabel"] = "Node Type" conf["ylabel"] = "Restore Row Count" @@ -187,7 +184,7 @@ class Visualizor: plt.ylabel(conf["ylabel"]) plt.title(conf["title"]) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(0.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.savefig(plotPath + "/box_restoreRowCount.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/box_restoreRowCount.png")) @@ -196,8 +193,9 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Box Plot of Restore Column Count by Nodes" conf["xlabel"] = "Node Type" conf["ylabel"] = "Restore Column Count" @@ -211,7 +209,7 @@ class Visualizor: plt.ylabel(conf["ylabel"]) plt.title(conf["title"]) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(0.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.savefig(plotPath + "/box_restoreColumnCount.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/box_restoreColumnCount.png")) @@ -220,8 +218,9 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Boxen Plot of Restore Row Count by Nodes" conf["xlabel"] = "Restore Row Count" conf["ylabel"] = "Nodes" @@ -233,7 +232,7 @@ class Visualizor: plt.ylabel(conf["ylabel"]) plt.title(conf["title"]) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(0.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.savefig(plotPath + "/boxen_restoreRowCount.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/boxen_restoreRowCount.png")) @@ -242,8 +241,9 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Boxen Plot of Restore Column Count by Nodes" conf["xlabel"] = "Restore Column Count" conf["ylabel"] = "Nodes" @@ -255,7 +255,7 @@ class Visualizor: plt.ylabel(conf["ylabel"]) plt.title(conf["title"]) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(0.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.savefig(plotPath + "/boxen_restoreColumnCount.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/boxen_restoreColumnCount.png")) @@ -264,8 +264,9 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "ECDF of Restore Row Count by Nodes" conf["xlabel"] = "Restore Row Count" conf["ylabel"] = "ECDF" @@ -279,7 +280,7 @@ class Visualizor: plt.title(conf["title"]) plt.xlim(left=0, right=max(result.restoreRowCount) * 1.1) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(0.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.legend(title='Node Class', labels=['Class 1 Nodes', 'Class 2 Nodes'], loc=1) plt.savefig(plotPath + "/ecdf_restoreRowCount.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/ecdf_restoreRowCount.png")) @@ -289,8 +290,9 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "ECDF of Restore Column Count by Nodes" conf["xlabel"] = "Restore Column Count" conf["ylabel"] = "ECDF" @@ -304,7 +306,7 @@ class Visualizor: plt.title(conf["title"]) plt.xlim(left=0, right=max(result.restoreColumnCount) * 1.1) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(0.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.legend(title='Node Class', labels=['Class 1 Nodes', 'Class 2 Nodes'], loc=1) plt.savefig(plotPath + "/ecdf_restoreColumnCount.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/ecdf_restoreColumnCount.png")) @@ -314,8 +316,9 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "ECDF of Messages Sent by Nodes" conf["xlabel"] = "Number of Messages Sent" conf["ylabel"] = "ECDF" @@ -330,7 +333,7 @@ class Visualizor: plt.title(conf["title"]) plt.xlim(left=0, right=max(result.msgSentCount) * 1.1) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(0.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.savefig(plotPath + "/ecdf_messagesSent.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/ecdf_messagesSent.png")) @@ -339,8 +342,9 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "ECDF of Messages Received by Nodes" conf["xlabel"] = "Number of Messages Received" conf["ylabel"] = "ECDF" @@ -355,7 +359,7 @@ class Visualizor: plt.title(conf["title"]) plt.xlim(left=0, right=max(result.msgRecvCount) * 1.1) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(0.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.savefig(plotPath + "/ecdf_messagesRecv.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/ecdf_messagesRecv.png")) @@ -364,8 +368,9 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "ECDF of Samples Received by Nodes" conf["xlabel"] = "Number of Samples Received" conf["ylabel"] = "ECDF" @@ -380,19 +385,20 @@ class Visualizor: plt.title(conf["title"]) plt.xlim(left=0, right=max(result.sampleRecvCount) * 1.1) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(0.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.savefig(plotPath + "/ecdf_samplesReceived.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/ecdf_samplesReceived.png")) def plotECDFRowColDist(self, result, plotPath): - """Plots the ECDF of row col distance by all nodes using seaborn's ecdfplot""" + """Plots the ECDF of row col distribution by all nodes using seaborn's ecdfplot""" plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] - conf["title"] = "ECDF of Row-Col Distance by Nodes" - conf["xlabel"] = "Row-Col Distance" + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] + conf["title"] = "ECDF of Row-Col Distribution by Nodes" + conf["xlabel"] = "Row-Col Distribution" conf["ylabel"] = "ECDF" vector1 = result.metrics["rowDist"] vector2 = result.metrics["columnDist"] @@ -405,7 +411,7 @@ class Visualizor: plt.xlim(left=0, right=max(max(vector1), max(vector2)) * 1.1) plt.legend(labels=['Row Dist', 'Column Dist'], loc=1) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(0.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.savefig(plotPath + "/ecdf_rowColDist.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/ecdf_rowColDist.png")) @@ -414,8 +420,9 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "ECDF of Samples Repaired by Nodes" conf["xlabel"] = "Number of Samples Repaired" conf["ylabel"] = "ECDF" @@ -430,7 +437,7 @@ class Visualizor: plt.title(conf["title"]) plt.xlim(left=0, right=max(result.repairedSampleCount) * 1.1) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(0.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.savefig(plotPath + "/ecdf_samplesRepaired.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/ecdf_samplesRepaired.png")) @@ -439,8 +446,9 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Number of Samples Received by Nodes" conf["xlabel"] = "Node Type" conf["ylabel"] = "Number of Samples Received" @@ -452,7 +460,7 @@ class Visualizor: plt.ylabel(conf["ylabel"]) plt.title(conf["title"]) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(0.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.tight_layout() plt.savefig(plotPath + "/boxen_samplesRecv.png") plt.close() @@ -463,8 +471,9 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Number of Samples Repaired by Nodes" conf["xlabel"] = "Node Type" conf["ylabel"] = "Number of Samples Repaired" @@ -476,7 +485,7 @@ class Visualizor: plt.ylabel(conf["ylabel"]) plt.title(conf["title"]) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(0.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.tight_layout() plt.savefig(plotPath + "/boxen_samplesRepaired.png") plt.close() @@ -487,8 +496,9 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Row/Column Distribution" conf["xlabel"] = "Row/Column Type" conf["ylabel"] = "Validators Subscribed" @@ -505,7 +515,7 @@ class Visualizor: plt.ylabel(conf["ylabel"]) plt.title(conf["title"]) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(0.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.tight_layout() plt.savefig(plotPath + "/boxen_rowColDist.png") plt.close() @@ -516,8 +526,9 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Number of Messages Sent by Nodes" conf["xlabel"] = "Node Type" conf["ylabel"] = "Number of Messages Sent" @@ -529,7 +540,7 @@ class Visualizor: plt.ylabel(conf["ylabel"]) plt.title(conf["title"]) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(0.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.savefig(plotPath + "/boxen_messagesSent.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/boxen_messagesSent.png")) @@ -538,8 +549,9 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Number of Messages Received by Nodes" conf["xlabel"] = "Node Type" conf["ylabel"] = "Number of Messages Received" @@ -551,7 +563,7 @@ class Visualizor: plt.ylabel(conf["ylabel"]) plt.title(conf["title"]) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(0.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.savefig(plotPath + "/boxen_messagesRecv.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/boxen_messagesRecv.png")) @@ -560,8 +572,9 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Number of Samples Repaired by Nodes" conf["type"] = "individual_bar" conf["legLoc"] = 1 @@ -579,8 +592,9 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Row/Column Distribution" conf["xlabel"] = "" conf["ylabel"] = "Validators Subscribed" @@ -600,8 +614,9 @@ class Visualizor: """Plots the restoreRowCount for each node""" conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Restore Row Count for Each Node" conf["type"] = "individual_bar" conf["legLoc"] = 1 @@ -620,8 +635,9 @@ class Visualizor: """Plots the restoreColumnCount for each node""" conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Restore Column Count for Each Node" conf["type"] = "individual_bar" conf["legLoc"] = 1 @@ -640,8 +656,9 @@ class Visualizor: """Plots the percentage sampleRecv for each node""" conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Percentage of Samples Received by Nodes" conf["type"] = "individual_bar_with_2line" conf["legLoc"] = 1 @@ -673,8 +690,9 @@ class Visualizor: """Box Plot of the sampleRecv for each node""" conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Number of Samples Received by Nodes" conf["type"] = "individual_bar_with_2line" conf["legLoc"] = 1 @@ -692,8 +710,9 @@ class Visualizor: """Plots the missing samples in the network""" conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Missing Samples" conf["type"] = "plot_with_1line" conf["legLoc"] = 1 @@ -723,8 +742,9 @@ class Visualizor: vector3 = [x * 100 for x in result.metrics["progress"]["samples received"]] conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Nodes/validators ready" conf["type"] = "plot" conf["legLoc"] = 2 @@ -755,8 +775,9 @@ class Visualizor: vector3[i] = (vector3[i] * 8 * (1000/self.config.stepDuration) * self.config.segmentSize) / 1000000 conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Sent data" conf["type"] = "plot" conf["legLoc"] = 2 @@ -785,8 +806,9 @@ class Visualizor: vector2[i] = (vector2[i] * 8 * (1000/self.config.stepDuration) * self.config.segmentSize) / 1000000 conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Received data" conf["type"] = "plot" conf["legLoc"] = 2 @@ -815,8 +837,9 @@ class Visualizor: vector2[i] = (vector2[i] * 8 * (1000/self.config.stepDuration) * self.config.segmentSize) / 1000000 conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Duplicated data" conf["type"] = "plot" conf["legLoc"] = 2 @@ -846,8 +869,9 @@ class Visualizor: vector1 += [np.nan] * (len(vector2) - len(vector1)) conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Row/Column distribution" conf["type"] = "grouped_bar" conf["legLoc"] = 2 @@ -871,8 +895,9 @@ class Visualizor: """Plots the number of messages sent by all nodes""" conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Number of Messages Sent by Nodes" conf["type"] = "individual_bar" conf["legLoc"] = 1 @@ -891,8 +916,9 @@ class Visualizor: """Box Plot of the number of messages sent by all nodes""" conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Number of Messages Sent by Nodes" conf["xlabel"] = "Node Type" conf["ylabel"] = "Number of Messages Sent" @@ -906,8 +932,9 @@ class Visualizor: """Plots the number of messages received by all nodes""" conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Number of Messages Received by Nodes" conf["type"] = "individual_bar" conf["legLoc"] = 1 @@ -926,8 +953,9 @@ class Visualizor: """Plots the number of messages received by all nodes""" conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Number of Messages Received by Nodes" conf["type"] = "individual_bar" conf["legLoc"] = 1 @@ -947,8 +975,9 @@ class Visualizor: """Plots the number of samples repaired by all nodes""" conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Block Size R: "+attrbs['bsrn']+"\nBlock Size C: "+attrbs['bscn']\ - +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd'] + conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ + +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Number of Samples Repaired by Nodes" conf["type"] = "individual_bar" conf["legLoc"] = 1 From 312ff6a1d220044ab55e8926b472f76e1795c201 Mon Sep 17 00:00:00 2001 From: Arunima Chaudhuri Date: Thu, 7 Mar 2024 18:25:36 +0530 Subject: [PATCH 2/4] fix warnings on ecdfRestore row col Count Signed-off-by: Arunima Chaudhuri --- DAS/visualizor.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/DAS/visualizor.py b/DAS/visualizor.py index a10143b..5c48eaa 100644 --- a/DAS/visualizor.py +++ b/DAS/visualizor.py @@ -278,7 +278,8 @@ class Visualizor: plt.xlabel(conf["xlabel"]) plt.ylabel(conf["ylabel"]) plt.title(conf["title"]) - plt.xlim(left=0, right=max(result.restoreRowCount) * 1.1) + max_val = max(result.restoreRowCount) * 1.1 + plt.xlim(left=0, right=max_val if max_val > 0 else 1) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.legend(title='Node Class', labels=['Class 1 Nodes', 'Class 2 Nodes'], loc=1) @@ -304,7 +305,8 @@ class Visualizor: plt.xlabel(conf["xlabel"]) plt.ylabel(conf["ylabel"]) plt.title(conf["title"]) - plt.xlim(left=0, right=max(result.restoreColumnCount) * 1.1) + max_val = max(result.restoreColumnCount) * 1.1 + plt.xlim(left=0, right=max_val if max_val > 0 else 1) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.legend(title='Node Class', labels=['Class 1 Nodes', 'Class 2 Nodes'], loc=1) From ea064dd51aa1e4547f9d31377feacd4ad94ad94c Mon Sep 17 00:00:00 2001 From: Arunima Chaudhuri Date: Thu, 7 Mar 2024 18:42:00 +0530 Subject: [PATCH 3/4] fix warnings Signed-off-by: Arunima Chaudhuri --- DAS/visualizor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DAS/visualizor.py b/DAS/visualizor.py index 5c48eaa..9bfe2d0 100644 --- a/DAS/visualizor.py +++ b/DAS/visualizor.py @@ -27,7 +27,7 @@ def plotData(conf): plt.title(conf["title"]) plt.ylabel(conf["ylabel"]) plt.xlabel(conf["xlabel"]) - plt.ylim(0, conf["yaxismax"]*1.1) + plt.ylim(0, conf["yaxismax"]*1.1 if conf["yaxismax"] > 0 else 1) plt.legend(loc=conf["legLoc"]) plt.savefig(conf["path"], bbox_inches="tight") From bbe5f08edbd0bf061fcbbed66901c6168ccb598b Mon Sep 17 00:00:00 2001 From: Arunima Chaudhuri Date: Sat, 9 Mar 2024 16:11:42 +0530 Subject: [PATCH 4/4] increase fontsize & add K, N dimensions to textbox Signed-off-by: Arunima Chaudhuri --- DAS/visualizor.py | 237 ++++++++++++++++++++++++++-------------------- 1 file changed, 135 insertions(+), 102 deletions(-) diff --git a/DAS/visualizor.py b/DAS/visualizor.py index 9bfe2d0..96a70cc 100644 --- a/DAS/visualizor.py +++ b/DAS/visualizor.py @@ -10,7 +10,7 @@ def plotData(conf): fig = plt.figure("9, 3") plt.grid(True) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=14, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) if conf["type"] == "plot" or conf["type"] == "plot_with_1line": for i in range(len(conf["data"])): plt.plot(conf["xdots"], conf["data"][i], conf["colors"][i], label=conf["labels"][i]) @@ -24,9 +24,9 @@ def plotData(conf): plt.axhline(y = conf["expected_value2"], color='g', linestyle='--', label=conf["line_label2"]) if conf["type"] == "plot_with_1line": plt.axhline(y = conf["expected_value"], color='g', linestyle='--', label=conf["line_label"]) - plt.title(conf["title"]) - plt.ylabel(conf["ylabel"]) - plt.xlabel(conf["xlabel"]) + plt.title(conf["title"], fontsize=14) + plt.ylabel(conf["ylabel"], fontsize=12) + plt.xlabel(conf["xlabel"], fontsize=12) plt.ylim(0, conf["yaxismax"]*1.1 if conf["yaxismax"] > 0 else 1) plt.legend(loc=conf["legLoc"]) plt.savefig(conf["path"], bbox_inches="tight") @@ -37,7 +37,7 @@ def plotBoxData(conf): props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) num_boxes = len(conf["data"]) positions = np.arange(num_boxes) - plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=14, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.boxplot(conf["data"], patch_artist=True, showmeans=True, meanline=True, positions=positions) plt.title(conf["title"], fontsize=14) plt.ylabel(conf["ylabel"], fontsize=12) @@ -168,7 +168,8 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Box Plot of Restore Row Count by Nodes" @@ -180,11 +181,11 @@ class Visualizor: data = [class1_data, class2_data] plt.boxplot(data) plt.xticks([1, 2], ['Class 1 Nodes', 'Class 2 Nodes']) - plt.xlabel(conf["xlabel"]) - plt.ylabel(conf["ylabel"]) - plt.title(conf["title"]) + plt.xlabel(conf["xlabel"], fontsize=12) + plt.ylabel(conf["ylabel"], fontsize=12) + plt.title(conf["title"], fontsize=14) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=14, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.savefig(plotPath + "/box_restoreRowCount.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/box_restoreRowCount.png")) @@ -193,7 +194,8 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Box Plot of Restore Column Count by Nodes" @@ -205,11 +207,11 @@ class Visualizor: data = [class1_data, class2_data] plt.boxplot(data) plt.xticks([1, 2], ['Class 1 Nodes', 'Class 2 Nodes']) - plt.xlabel(conf["xlabel"]) - plt.ylabel(conf["ylabel"]) - plt.title(conf["title"]) + plt.xlabel(conf["xlabel"], fontsize=12) + plt.ylabel(conf["ylabel"], fontsize=12) + plt.title(conf["title"], fontsize=14) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=14, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.savefig(plotPath + "/box_restoreColumnCount.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/box_restoreColumnCount.png")) @@ -218,7 +220,8 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Boxen Plot of Restore Row Count by Nodes" @@ -228,11 +231,11 @@ class Visualizor: data = [result.restoreRowCount[1: n1], result.restoreRowCount[n1+1: ]] plt.figure(figsize=(8, 6)) sns.boxenplot(data=data, width=0.8) - plt.xlabel(conf["xlabel"]) - plt.ylabel(conf["ylabel"]) - plt.title(conf["title"]) + plt.xlabel(conf["xlabel"], fontsize=12) + plt.ylabel(conf["ylabel"], fontsize=12) + plt.title(conf["title"], fontsize=14) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=14, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.savefig(plotPath + "/boxen_restoreRowCount.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/boxen_restoreRowCount.png")) @@ -241,7 +244,8 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Boxen Plot of Restore Column Count by Nodes" @@ -251,11 +255,11 @@ class Visualizor: data = [result.restoreColumnCount[1: n1], result.restoreColumnCount[n1+1: ]] plt.figure(figsize=(8, 6)) sns.boxenplot(data=data, width=0.8) - plt.xlabel(conf["xlabel"]) - plt.ylabel(conf["ylabel"]) - plt.title(conf["title"]) + plt.xlabel(conf["xlabel"], fontsize=12) + plt.ylabel(conf["ylabel"], fontsize=12) + plt.title(conf["title"], fontsize=14) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=14, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.savefig(plotPath + "/boxen_restoreColumnCount.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/boxen_restoreColumnCount.png")) @@ -264,7 +268,8 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "ECDF of Restore Row Count by Nodes" @@ -275,13 +280,13 @@ class Visualizor: class2_data = result.restoreRowCount[n1+1: ] sns.ecdfplot(data=class1_data, label='Class 1 Nodes') sns.ecdfplot(data=class2_data, label='Class 2 Nodes') - plt.xlabel(conf["xlabel"]) - plt.ylabel(conf["ylabel"]) - plt.title(conf["title"]) + plt.xlabel(conf["xlabel"], fontsize=12) + plt.ylabel(conf["ylabel"], fontsize=12) + plt.title(conf["title"], fontsize=14) max_val = max(result.restoreRowCount) * 1.1 plt.xlim(left=0, right=max_val if max_val > 0 else 1) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=14, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.legend(title='Node Class', labels=['Class 1 Nodes', 'Class 2 Nodes'], loc=1) plt.savefig(plotPath + "/ecdf_restoreRowCount.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/ecdf_restoreRowCount.png")) @@ -291,7 +296,8 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "ECDF of Restore Column Count by Nodes" @@ -302,13 +308,13 @@ class Visualizor: class2_data = result.restoreColumnCount[n1+1: ] sns.ecdfplot(data=class1_data, label='Class 1 Nodes') sns.ecdfplot(data=class2_data, label='Class 2 Nodes') - plt.xlabel(conf["xlabel"]) - plt.ylabel(conf["ylabel"]) - plt.title(conf["title"]) + plt.xlabel(conf["xlabel"], fontsize=12) + plt.ylabel(conf["ylabel"], fontsize=12) + plt.title(conf["title"], fontsize=14) max_val = max(result.restoreColumnCount) * 1.1 plt.xlim(left=0, right=max_val if max_val > 0 else 1) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=14, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.legend(title='Node Class', labels=['Class 1 Nodes', 'Class 2 Nodes'], loc=1) plt.savefig(plotPath + "/ecdf_restoreColumnCount.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/ecdf_restoreColumnCount.png")) @@ -318,7 +324,8 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "ECDF of Messages Sent by Nodes" @@ -330,12 +337,12 @@ class Visualizor: sns.ecdfplot(data=class1_data, label='Class 1 Nodes') sns.ecdfplot(data=class2_data, label='Class 2 Nodes') plt.legend(title='Node Class', labels=['Class 1 Nodes', 'Class 2 Nodes'], loc=1) - plt.xlabel(conf["xlabel"]) - plt.ylabel(conf["ylabel"]) - plt.title(conf["title"]) + plt.xlabel(conf["xlabel"], fontsize=12) + plt.ylabel(conf["ylabel"], fontsize=12) + plt.title(conf["title"], fontsize=14) plt.xlim(left=0, right=max(result.msgSentCount) * 1.1) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=14, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.savefig(plotPath + "/ecdf_messagesSent.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/ecdf_messagesSent.png")) @@ -344,7 +351,8 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "ECDF of Messages Received by Nodes" @@ -356,12 +364,12 @@ class Visualizor: sns.ecdfplot(data=class1_data, label='Class 1 Nodes') sns.ecdfplot(data=class2_data, label='Class 2 Nodes') plt.legend(title='Node Class', labels=['Class 1 Nodes', 'Class 2 Nodes'], loc=1) - plt.xlabel(conf["xlabel"]) - plt.ylabel(conf["ylabel"]) - plt.title(conf["title"]) + plt.xlabel(conf["xlabel"], fontsize=12) + plt.ylabel(conf["ylabel"], fontsize=12) + plt.title(conf["title"], fontsize=14) plt.xlim(left=0, right=max(result.msgRecvCount) * 1.1) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=14, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.savefig(plotPath + "/ecdf_messagesRecv.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/ecdf_messagesRecv.png")) @@ -370,7 +378,8 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "ECDF of Samples Received by Nodes" @@ -382,12 +391,12 @@ class Visualizor: sns.ecdfplot(data=class1_data, label='Class 1 Nodes') sns.ecdfplot(data=class2_data, label='Class 2 Nodes') plt.legend(title='Node Class', labels=['Class 1 Nodes', 'Class 2 Nodes'], loc=1) - plt.xlabel(conf["xlabel"]) - plt.ylabel(conf["ylabel"]) - plt.title(conf["title"]) + plt.xlabel(conf["xlabel"], fontsize=12) + plt.ylabel(conf["ylabel"], fontsize=12) + plt.title(conf["title"], fontsize=14) plt.xlim(left=0, right=max(result.sampleRecvCount) * 1.1) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=14, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.savefig(plotPath + "/ecdf_samplesReceived.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/ecdf_samplesReceived.png")) @@ -396,7 +405,8 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "ECDF of Row-Col Distribution by Nodes" @@ -407,13 +417,13 @@ class Visualizor: n1 = int(result.numberNodes * result.class1ratio) sns.ecdfplot(data=vector1, label='Rows') sns.ecdfplot(data=vector2, label='Columns') - plt.xlabel(conf["xlabel"]) - plt.ylabel(conf["ylabel"]) - plt.title(conf["title"]) + plt.xlabel(conf["xlabel"], fontsize=12) + plt.ylabel(conf["ylabel"], fontsize=12) + plt.title(conf["title"], fontsize=14) plt.xlim(left=0, right=max(max(vector1), max(vector2)) * 1.1) plt.legend(labels=['Row Dist', 'Column Dist'], loc=1) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=14, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.savefig(plotPath + "/ecdf_rowColDist.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/ecdf_rowColDist.png")) @@ -422,7 +432,8 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "ECDF of Samples Repaired by Nodes" @@ -434,12 +445,12 @@ class Visualizor: sns.ecdfplot(data=class1_data, label='Class 1 Nodes') sns.ecdfplot(data=class2_data, label='Class 2 Nodes') plt.legend(title='Node Class', labels=['Class 1 Nodes', 'Class 2 Nodes']) - plt.xlabel(conf["xlabel"]) - plt.ylabel(conf["ylabel"]) - plt.title(conf["title"]) + plt.xlabel(conf["xlabel"], fontsize=12) + plt.ylabel(conf["ylabel"], fontsize=12) + plt.title(conf["title"], fontsize=14) plt.xlim(left=0, right=max(result.repairedSampleCount) * 1.1) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=14, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.savefig(plotPath + "/ecdf_samplesRepaired.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/ecdf_samplesRepaired.png")) @@ -448,7 +459,8 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Number of Samples Received by Nodes" @@ -458,11 +470,11 @@ class Visualizor: data = [result.sampleRecvCount[1: n1], result.sampleRecvCount[n1+1: ]] plt.figure(figsize=(8, 6)) sns.boxenplot(data=data, width=0.8) - plt.xlabel(conf["xlabel"]) - plt.ylabel(conf["ylabel"]) - plt.title(conf["title"]) + plt.xlabel(conf["xlabel"], fontsize=12) + plt.ylabel(conf["ylabel"], fontsize=12) + plt.title(conf["title"], fontsize=14) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=14, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.tight_layout() plt.savefig(plotPath + "/boxen_samplesRecv.png") plt.close() @@ -473,7 +485,8 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Number of Samples Repaired by Nodes" @@ -483,11 +496,11 @@ class Visualizor: data = [result.repairedSampleCount[1: n1], result.repairedSampleCount[n1+1: ]] plt.figure(figsize=(8, 6)) sns.boxenplot(data=data, width=0.8) - plt.xlabel(conf["xlabel"]) - plt.ylabel(conf["ylabel"]) - plt.title(conf["title"]) + plt.xlabel(conf["xlabel"], fontsize=12) + plt.ylabel(conf["ylabel"], fontsize=12) + plt.title(conf["title"], fontsize=14) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=14, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.tight_layout() plt.savefig(plotPath + "/boxen_samplesRepaired.png") plt.close() @@ -498,7 +511,8 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Row/Column Distribution" @@ -513,11 +527,11 @@ class Visualizor: data = [vector1, vector2] plt.figure(figsize=(8, 6)) sns.boxenplot(data=data, width=0.8) - plt.xlabel(conf["xlabel"]) - plt.ylabel(conf["ylabel"]) - plt.title(conf["title"]) + plt.xlabel(conf["xlabel"], fontsize=12) + plt.ylabel(conf["ylabel"], fontsize=12) + plt.title(conf["title"], fontsize=14) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=14, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.tight_layout() plt.savefig(plotPath + "/boxen_rowColDist.png") plt.close() @@ -528,7 +542,8 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Number of Messages Sent by Nodes" @@ -538,11 +553,11 @@ class Visualizor: data = [result.msgSentCount[1: n1], result.msgSentCount[n1+1: ]] labels = ["Class 1", "Class 2"] sns.boxenplot(data=data, palette="Set2", ax=plt.gca()) - plt.xlabel(conf["xlabel"]) - plt.ylabel(conf["ylabel"]) - plt.title(conf["title"]) + plt.xlabel(conf["xlabel"], fontsize=12) + plt.ylabel(conf["ylabel"], fontsize=12) + plt.title(conf["title"], fontsize=14) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=14, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.savefig(plotPath + "/boxen_messagesSent.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/boxen_messagesSent.png")) @@ -551,7 +566,8 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Number of Messages Received by Nodes" @@ -561,11 +577,11 @@ class Visualizor: data = [result.msgRecvCount[1: n1], result.msgRecvCount[n1+1: ]] labels = ["Class 1", "Class 2"] sns.boxenplot(data=data, palette="Set2", ax=plt.gca()) - plt.xlabel(conf["xlabel"]) - plt.ylabel(conf["ylabel"]) - plt.title(conf["title"]) + plt.xlabel(conf["xlabel"], fontsize=12) + plt.ylabel(conf["ylabel"], fontsize=12) + plt.title(conf["title"], fontsize=14) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) - plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) + plt.text(1.05, 0.05, conf["textBox"], fontsize=14, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.savefig(plotPath + "/boxen_messagesRecv.png", bbox_inches="tight") print("Plot %s created." % (plotPath + "/boxen_messagesRecv.png")) @@ -574,7 +590,8 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Number of Samples Repaired by Nodes" @@ -594,7 +611,8 @@ class Visualizor: plt.clf() conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Row/Column Distribution" @@ -616,7 +634,8 @@ class Visualizor: """Plots the restoreRowCount for each node""" conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Restore Row Count for Each Node" @@ -637,7 +656,8 @@ class Visualizor: """Plots the restoreColumnCount for each node""" conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Restore Column Count for Each Node" @@ -658,7 +678,8 @@ class Visualizor: """Plots the percentage sampleRecv for each node""" conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Percentage of Samples Received by Nodes" @@ -692,7 +713,8 @@ class Visualizor: """Box Plot of the sampleRecv for each node""" conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Number of Samples Received by Nodes" @@ -712,7 +734,8 @@ class Visualizor: """Plots the missing samples in the network""" conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Missing Samples" @@ -744,7 +767,8 @@ class Visualizor: vector3 = [x * 100 for x in result.metrics["progress"]["samples received"]] conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Nodes/validators ready" @@ -777,7 +801,8 @@ class Visualizor: vector3[i] = (vector3[i] * 8 * (1000/self.config.stepDuration) * self.config.segmentSize) / 1000000 conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Sent data" @@ -808,7 +833,8 @@ class Visualizor: vector2[i] = (vector2[i] * 8 * (1000/self.config.stepDuration) * self.config.segmentSize) / 1000000 conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Received data" @@ -839,7 +865,8 @@ class Visualizor: vector2[i] = (vector2[i] * 8 * (1000/self.config.stepDuration) * self.config.segmentSize) / 1000000 conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Duplicated data" @@ -871,7 +898,8 @@ class Visualizor: vector1 += [np.nan] * (len(vector2) - len(vector1)) conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Row/Column distribution" @@ -897,7 +925,8 @@ class Visualizor: """Plots the number of messages sent by all nodes""" conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Number of Messages Sent by Nodes" @@ -918,7 +947,8 @@ class Visualizor: """Box Plot of the number of messages sent by all nodes""" conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Number of Messages Sent by Nodes" @@ -934,7 +964,8 @@ class Visualizor: """Plots the number of messages received by all nodes""" conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Number of Messages Received by Nodes" @@ -955,7 +986,8 @@ class Visualizor: """Plots the number of messages received by all nodes""" conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Number of Messages Received by Nodes" @@ -977,7 +1009,8 @@ class Visualizor: """Plots the number of samples repaired by all nodes""" conf = {} attrbs = self.__get_attrbs__(result) - conf["textBox"] = "Row Size: "+attrbs['bsrn']+"\nColumn Size: "+attrbs['bscn']\ + conf["textBox"] = "Row Size (N, K): "+attrbs['bsrn']+ ", "+attrbs['bscn']\ + +"\nColumn Size: (N, K): "+attrbs['bscn']+ ", "+attrbs['bscn']\ +"\nNumber of nodes: "+attrbs['nn']+"\nFailure rate: "+attrbs['fr']+"\nMalicious Node: "+attrbs['mn']+"\nNetwork degree: "+attrbs['nd']\ +"\nCustody Rows: "+attrbs['cusr']+"\nCustody Cols: "+attrbs['cusc']+"\nCustody 1: "+attrbs['vpn1']+"\nCustody 2: "+attrbs['vpn2'] conf["title"] = "Number of Samples Repaired by Nodes"