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 = [] self.columnIDs = []
if deterministic: if deterministic:
random.seed(self.ID) random.seed(self.ID)
lr = [i for i in range(self.blockSize)] self.rowIDs = random.sample(range(self.blockSize), self.chi)
lc = [i for i in range(self.blockSize)] self.columnIDs = random.sample(range(self.blockSize), self.chi)
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())
def logIDs(self): def logIDs(self):
if self.proposer == 1: if self.proposer == 1: