pick row/column IDs without replacement

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
Csaba Kiraly 2022-12-07 10:59:41 +01:00
parent c2ea4b9b09
commit 13580cd44d
No known key found for this signature in database
GPG Key ID: 0FE274EE8C95166E
1 changed files with 2 additions and 7 deletions

View File

@ -36,13 +36,8 @@ class Validator:
self.columnIDs = []
if deterministic:
random.seed(self.ID)
lr = [i for i in range(self.blockSize)]
lc = [i for i in range(self.blockSize)]
random.shuffle(lr)
random.shuffle(lc)
for i in range(self.chi): # TODO : Avoid doubles
self.rowIDs.append(lr.pop())
self.columnIDs.append(lc.pop())
self.rowIDs = random.sample(range(self.blockSize), self.chi)
self.columnIDs = random.sample(range(self.blockSize), self.chi)
def logIDs(self):
if self.proposer == 1: