fixup: use vpn1 and vpn2 correctly

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
Csaba Kiraly 2023-03-15 12:53:43 +01:00
parent c366c05616
commit 353efec141
No known key found for this signature in database
GPG Key ID: 0FE274EE8C95166E
1 changed files with 3 additions and 9 deletions

View File

@ -60,21 +60,15 @@ class Validator:
elif self.shape.chi > self.shape.blockSize:
self.logger.error("Chi has to be smaller than %d" % self.shape.blockSize, extra=self.format)
else:
self.chi = shape.chi
if amIproposer:
self.rowIDs = range(shape.blockSize)
self.columnIDs = range(shape.blockSize)
else:
#if shape.deterministic:
# random.seed(self.ID)
if rows:
self.rowIDs = rows
else:
self.rowIDs = unionOfSamples(range(self.shape.blockSize), self.chi, self.shape.vpn1)
if columns:
self.columnIDs = columns
else:
self.columnIDs = unionOfSamples(range(self.shape.blockSize), self.chi, self.shape.vpn1)
vpn = self.shape.vpn1 if (self.ID <= shape.numberNodes * shape.class1ratio) else self.shape.vpn2
self.rowIDs = rows if rows else unionOfSamples(range(self.shape.blockSize), self.shape.chi, vpn)
self.columnIDs = columns if columns else unionOfSamples(range(self.shape.blockSize), self.shape.chi, vpn)
self.rowNeighbors = collections.defaultdict(dict)
self.columnNeighbors = collections.defaultdict(dict)