Merge pull request #25 from status-im/fix-visualizer

Fix visualizer to loop over all parameters
This commit is contained in:
Csaba Kiraly 2023-03-21 12:50:08 +01:00 committed by GitHub
commit 263558b5a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,15 +38,15 @@ class Visualizer:
bwUplink2 = int(root.find('bwUplink2').text)
tta = int(root.find('tta').text)
# Loop over all possible combinations of length 4 of the parameters
for combination in combinations(self.parameters, 4):
# Loop over all possible combinations of of the parameters minus two
for combination in combinations(self.parameters, len(self.parameters)-2):
# Get the indices and values of the parameters in the combination
indices = [self.parameters.index(element) for element in combination]
selectedValues = [run, blockSize, failureRate, numberNodes, netDegree, chi, vpn1, vpn2, bwUplinkProd, bwUplink1, bwUplink2]
values = [selectedValues[index] for index in indices]
names = [self.parameters[i] for i in indices]
keyComponents = [f"{name}_{value}" for name, value in zip(names, values)]
key = tuple(keyComponents[:4])
key = tuple(keyComponents[:len(self.parameters)-2])
#Get the names of the other 2 parameters that are not included in the key
otherParams = [self.parameters[i] for i in range(len(self.parameters)) if i not in indices]
#Append the values of the other 2 parameters and the ttas to the lists for the key