From f3f1e8664d1e9f8798b71d51373baa37a171eb59 Mon Sep 17 00:00:00 2001 From: Sudipta Basak Date: Mon, 10 Jun 2024 19:00:29 +0000 Subject: [PATCH] Fixed rounding error for number of nodes --- DAS/simulator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DAS/simulator.py b/DAS/simulator.py index afbf418..fe6f3f9 100644 --- a/DAS/simulator.py +++ b/DAS/simulator.py @@ -50,8 +50,8 @@ class Simulator: commulativeSum = [sum(nodeCounts[:i+1]) for i in range(len(nodeCounts))] commulativeSum[-1] = self.shape.numberNodes for i, idx in enumerate(commulativeSum): - if nodeIdx < idx: - return i + 1 + if nodeIdx <= idx: + return self.shape.nodeClasses[i + 1] def initValidators(self): """It initializes all the validators in the network."""