Fixed rounding error for number of nodes

This commit is contained in:
Sudipta Basak 2024-06-10 19:00:29 +00:00
parent 0e51082f71
commit f3f1e8664d
No known key found for this signature in database
1 changed files with 2 additions and 2 deletions

View File

@ -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."""