Change chi to custody

This commit is contained in:
Leonardo Bautista-Gomez 2024-02-27 20:37:38 +01:00
parent 3db9eda5ea
commit d1d81a23cf
2 changed files with 10 additions and 10 deletions

View File

@ -36,9 +36,9 @@ class Validator:
self.rowIDs = rowIDs self.rowIDs = rowIDs
self.columnIDs = columnIDs self.columnIDs = columnIDs
def initValidator(blockSizeC, chiR, blockSizeR, chiC): def initValidator(blockSizeC, custodyRows, blockSizeR, custodyCols):
rowIDs = set(random.sample(range(blockSizeC), chiR)) rowIDs = set(random.sample(range(blockSizeC), custodyRows))
columnIDs = set(random.sample(range(blockSizeR), chiC)) columnIDs = set(random.sample(range(blockSizeR), custodyCols))
return Validator(rowIDs, columnIDs) return Validator(rowIDs, columnIDs)
class Node: class Node:
@ -53,7 +53,7 @@ class Node:
"""It initializes the node, and eventual validators, following the simulation configuration in shape and config. """It initializes the node, and eventual validators, following the simulation configuration in shape and config.
If rows/columns are specified these are observed, otherwise (default) If rows/columns are specified these are observed, otherwise (default)
chiR rows and chiC columns are selected randomly. custodyRows rows and custodyCols columns are selected randomly.
""" """
self.shape = shape self.shape = shape
@ -93,7 +93,7 @@ class Node:
self.statsRxDupInSlot = 0 self.statsRxDupInSlot = 0
self.statsRxDupPerSlot = [] self.statsRxDupPerSlot = []
# Set uplink bandwidth. # Set uplink bandwidth.
# Assuming segments of ~560 bytes and timesteps of 50ms, we get # Assuming segments of ~560 bytes and timesteps of 50ms, we get
# 1 Mbps ~= 1e6 mbps * 0.050 s / (560*8) bits ~= 11 segments/timestep # 1 Mbps ~= 1e6 mbps * 0.050 s / (560*8) bits ~= 11 segments/timestep
if self.amIproposer: if self.amIproposer:

View File

@ -63,7 +63,7 @@ blockSizes = range(64, 113, 128)
netDegrees = range(8, 9, 2) netDegrees = range(8, 9, 2)
# number of rows and columns a validator is interested in # number of rows and columns a validator is interested in
chis = range(2, 3, 2) custody = range(2, 3, 2)
# ratio of class1 nodes (see below for parameters per class) # ratio of class1 nodes (see below for parameters per class)
class1ratios = [0.8] class1ratios = [0.8]
@ -102,12 +102,12 @@ diagnostics = False
saveGit = False saveGit = False
def nextShape(): def nextShape():
for run, fm, fr, class1ratio, chi, vpn1, vpn2, blockSize, nn, netDegree, bwUplinkProd, bwUplink1, bwUplink2 in itertools.product( for run, fm, fr, class1ratio, cust, vpn1, vpn2, blockSize, nn, netDegree, bwUplinkProd, bwUplink1, bwUplink2 in itertools.product(
runs, failureModels, failureRates, class1ratios, chis, validatorsPerNode1, validatorsPerNode2, blockSizes, numberNodes, netDegrees, bwUplinksProd, bwUplinks1, bwUplinks2): runs, failureModels, failureRates, class1ratios, custody, validatorsPerNode1, validatorsPerNode2, blockSizes, numberNodes, netDegrees, bwUplinksProd, bwUplinks1, bwUplinks2):
# Network Degree has to be an even number # Network Degree has to be an even number
if netDegree % 2 == 0: if netDegree % 2 == 0:
blockSizeR = blockSizeC = blockSize blockSizeR = blockSizeC = blockSize
blockSizeRK = blockSizeCK = blockSize // 2 blockSizeRK = blockSizeCK = blockSize // 2
chiR = chiC = chi custodyRows = custodyCols = cust
shape = Shape(blockSizeR, blockSizeRK, blockSizeC, blockSizeCK, nn, fm, fr, class1ratio, chiR, chiC, vpn1, vpn2, netDegree, bwUplinkProd, bwUplink1, bwUplink2, run) shape = Shape(blockSizeR, blockSizeRK, blockSizeC, blockSizeCK, nn, fm, fr, class1ratio, custodyRows, custodyCols, vpn1, vpn2, netDegree, bwUplinkProd, bwUplink1, bwUplink2, run)
yield shape yield shape