pick row/column IDs without replacement
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
c2ea4b9b09
commit
13580cd44d
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue