diff --git a/DAS/results.py b/DAS/results.py index 7134ff2..76d96d1 100644 --- a/DAS/results.py +++ b/DAS/results.py @@ -1,6 +1,7 @@ #!/bin/python3 import os +import bisect from xml.dom import minidom from dicttoxml import dicttoxml @@ -20,10 +21,11 @@ class Result: """It populates part of the result data inside a vector.""" self.shape = shape self.missingVector = missingVector - missingSamples = missingVector[-1] - if missingSamples == 0: + v = self.metrics["progress"]["validators ready"] + tta = bisect.bisect(v, config.successCondition) + if v[-1] >= config.successCondition: self.blockAvailable = 1 - self.tta = len(missingVector) * (config.stepDuration) + self.tta = tta * (config.stepDuration) else: self.blockAvailable = 0 self.tta = -1 diff --git a/config_example.py b/config_example.py index 39a0591..7263ca1 100644 --- a/config_example.py +++ b/config_example.py @@ -76,6 +76,9 @@ randomSeed = "DAS" # Number of steps without progress to stop simulation steps4StopCondition = 7 +# Number of validators ready to asume block is available +successCondition = 0.9 + # If True, print diagnostics when the block is not available diagnostics = False