From 293914e1c365fc1433ec089bcc8ed68c4b72b1bf Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Tue, 18 Apr 2023 16:12:46 +0200 Subject: [PATCH] move initBlock code after network setup Signed-off-by: Csaba Kiraly --- DAS/simulator.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/DAS/simulator.py b/DAS/simulator.py index 0a3073e..1250558 100644 --- a/DAS/simulator.py +++ b/DAS/simulator.py @@ -91,10 +91,6 @@ class Simulator: else: val = Validator(i, int(not i!=0), self.logger, self.shape) - if i == self.proposerID: - val.initBlock() - else: - val.logIDs() self.validators.append(val) assignedRows.sort() @@ -219,6 +215,11 @@ class Simulator: def run(self): """It runs the main simulation until the block is available or it gets stucked.""" self.glob.checkRowsColumns(self.validators) + for i in range(0,self.shape.numberNodes): + if i == self.proposerID: + self.validators[i].initBlock() + else: + self.validators[i].logIDs() arrived, expected, ready, validatedall, validated = self.glob.checkStatus(self.validators) missingSamples = expected - arrived missingVector = []