rowIDs and columnIDs are sets

Fixes issue 29, where multiple instances of an ID in rowIDs
created a topology with nodes with a huge degree.

This huge degree then created lots of duplicates, eating up available
bandwidth.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
Csaba Kiraly 2023-03-29 15:54:44 +02:00
parent f85cdb401b
commit 9f3089c232
No known key found for this signature in database
GPG Key ID: 0FE274EE8C95166E
1 changed files with 2 additions and 2 deletions

View File

@ -69,8 +69,8 @@ class Validator:
# random.seed(self.ID)
self.nodeClass = 1 if (self.ID <= shape.numberNodes * shape.class1ratio) else 2
self.vpn = self.shape.vpn1 if (self.nodeClass == 1) else self.shape.vpn2
self.rowIDs = rows if rows else unionOfSamples(range(self.shape.blockSize), self.shape.chi, self.vpn)
self.columnIDs = columns if columns else unionOfSamples(range(self.shape.blockSize), self.shape.chi, self.vpn)
self.rowIDs = set(rows) if rows else unionOfSamples(range(self.shape.blockSize), self.shape.chi, self.vpn)
self.columnIDs = set(columns) if columns else unionOfSamples(range(self.shape.blockSize), self.shape.chi, self.vpn)
self.rowNeighbors = collections.defaultdict(dict)
self.columnNeighbors = collections.defaultdict(dict)