diff --git a/DAS/simulator.py b/DAS/simulator.py index a51a291..0253bd4 100644 --- a/DAS/simulator.py +++ b/DAS/simulator.py @@ -41,7 +41,8 @@ class Simulator: # pushed out by the proposer. # 1: the data is sent out exactly once on rows and once on columns (2 copies in total) # self.shape.netDegree: default behavior similar (but not same) to previous code - self.proposerPublishTo = self.shape.netDegree # TODO: make this an external parameter + self.proposerPublishToR = config.evalConf(self, config.proposerPublishToR, shape) + self.proposerPublishToC = config.evalConf(self, config.proposerPublishToR, shape) def initValidators(self): """It initializes all the validators in the network.""" @@ -171,12 +172,12 @@ class Simulator: for v in self.validators: if (self.proposerPublishOnly and v.amIproposer): for id in v.rowIDs: - count = min(self.proposerPublishTo, len(rowChannels[id])) + count = min(self.proposerPublishToR, len(rowChannels[id])) publishTo = random.sample(rowChannels[id], count) for vi in publishTo: v.rowNeighbors[id].update({vi.ID : Neighbor(vi, 0, self.shape.blockSizeR)}) for id in v.columnIDs: - count = min(self.proposerPublishTo, len(columnChannels[id])) + count = min(self.proposerPublishToC, len(columnChannels[id])) publishTo = random.sample(columnChannels[id], count) for vi in publishTo: v.columnNeighbors[id].update({vi.ID : Neighbor(vi, 1, self.shape.blockSizeC)}) diff --git a/smallConf.py b/smallConf.py index 065561c..530fb7e 100644 --- a/smallConf.py +++ b/smallConf.py @@ -62,6 +62,11 @@ blockSizes = range(64, 113, 128) # Per-topic mesh neighborhood size netDegrees = range(8, 9, 2) +# How many copies are sent out by the block producer +# Note, previously this was set to match netDegree +proposerPublishToR = "shape.netDegree" +proposerPublishToC = "shape.netDegree" + # number of rows and columns a validator is interested in chis = range(2, 3, 2)