mirror of
https://github.com/status-im/das-research.git
synced 2025-02-22 19:38:14 +00:00
adding uplinkBw configuration
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
d9d79f9245
commit
99e051e6fc
@ -3,7 +3,7 @@
|
||||
class Shape:
|
||||
"""This class represents a set of parameters for a specific simulation."""
|
||||
|
||||
def __init__(self, blockSize, numberValidators, failureRate, chi, netDegree, run):
|
||||
def __init__(self, blockSize, numberValidators, failureRate, chi, netDegree, bwUplink, run):
|
||||
"""Initializes the shape with the parameters passed in argument."""
|
||||
self.run = run
|
||||
self.numberValidators = numberValidators
|
||||
@ -12,6 +12,7 @@ class Shape:
|
||||
self.netDegree = netDegree
|
||||
self.chi = chi
|
||||
self.randomSeed = ""
|
||||
self.bwUplink = bwUplink
|
||||
|
||||
def __repr__(self):
|
||||
"""Returns a printable representation of the shape"""
|
||||
|
@ -77,7 +77,7 @@ class Validator:
|
||||
# Set uplink bandwidth. In segments (~560 bytes) per timestep (50ms?)
|
||||
# 1 Mbps ~= 1e6 / 20 / 8 / 560 ~= 11
|
||||
# TODO: this should be a parameter
|
||||
self.bwUplink = 110 if not self.amIproposer else 2200 # approx. 10Mbps and 200Mbps
|
||||
self.bwUplink = shape.bwUplink if not self.amIproposer else 2200 # approx. 10Mbps and 200Mbps
|
||||
|
||||
self.repairOnTheFly = True
|
||||
self.sendLineUntil = (self.shape.blockSize + 1) // 2 # stop sending on a p2p link if at least this amount of samples passed
|
||||
|
@ -42,6 +42,10 @@ netDegrees = range(6, 9, 2)
|
||||
# Number of rows and columns a validator is interested in
|
||||
chis = range(4, 9, 2)
|
||||
|
||||
# Set uplink bandwidth. In segments (~560 bytes) per timestep (50ms?)
|
||||
# 1 Mbps ~= 1e6 / 20 / 8 / 560 ~= 11
|
||||
bwUplinks = [11, 110]
|
||||
|
||||
# Set to True if you want your run to be deterministic, False if not
|
||||
deterministic = False
|
||||
|
||||
@ -55,7 +59,8 @@ def nextShape():
|
||||
for blockSize in blockSizes:
|
||||
for nv in numberValidators:
|
||||
for netDegree in netDegrees:
|
||||
# Network Degree has to be an even number
|
||||
if netDegree % 2 == 0:
|
||||
shape = Shape(blockSize, nv, fr, chi, netDegree, run)
|
||||
yield shape
|
||||
for bwUplink in bwUplinks:
|
||||
# Network Degree has to be an even number
|
||||
if netDegree % 2 == 0:
|
||||
shape = Shape(blockSize, nv, fr, chi, netDegree, bwUplink, run)
|
||||
yield shape
|
||||
|
Loading…
x
Reference in New Issue
Block a user