mirror of
https://github.com/status-im/das-research.git
synced 2025-02-23 11:58: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:
|
class Shape:
|
||||||
"""This class represents a set of parameters for a specific simulation."""
|
"""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."""
|
"""Initializes the shape with the parameters passed in argument."""
|
||||||
self.run = run
|
self.run = run
|
||||||
self.numberValidators = numberValidators
|
self.numberValidators = numberValidators
|
||||||
@ -12,6 +12,7 @@ class Shape:
|
|||||||
self.netDegree = netDegree
|
self.netDegree = netDegree
|
||||||
self.chi = chi
|
self.chi = chi
|
||||||
self.randomSeed = ""
|
self.randomSeed = ""
|
||||||
|
self.bwUplink = bwUplink
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
"""Returns a printable representation of the shape"""
|
"""Returns a printable representation of the shape"""
|
||||||
|
@ -77,7 +77,7 @@ class Validator:
|
|||||||
# Set uplink bandwidth. In segments (~560 bytes) per timestep (50ms?)
|
# Set uplink bandwidth. In segments (~560 bytes) per timestep (50ms?)
|
||||||
# 1 Mbps ~= 1e6 / 20 / 8 / 560 ~= 11
|
# 1 Mbps ~= 1e6 / 20 / 8 / 560 ~= 11
|
||||||
# TODO: this should be a parameter
|
# 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.repairOnTheFly = True
|
||||||
self.sendLineUntil = (self.shape.blockSize + 1) // 2 # stop sending on a p2p link if at least this amount of samples passed
|
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
|
# Number of rows and columns a validator is interested in
|
||||||
chis = range(4, 9, 2)
|
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
|
# Set to True if you want your run to be deterministic, False if not
|
||||||
deterministic = False
|
deterministic = False
|
||||||
|
|
||||||
@ -55,7 +59,8 @@ def nextShape():
|
|||||||
for blockSize in blockSizes:
|
for blockSize in blockSizes:
|
||||||
for nv in numberValidators:
|
for nv in numberValidators:
|
||||||
for netDegree in netDegrees:
|
for netDegree in netDegrees:
|
||||||
# Network Degree has to be an even number
|
for bwUplink in bwUplinks:
|
||||||
if netDegree % 2 == 0:
|
# Network Degree has to be an even number
|
||||||
shape = Shape(blockSize, nv, fr, chi, netDegree, run)
|
if netDegree % 2 == 0:
|
||||||
yield shape
|
shape = Shape(blockSize, nv, fr, chi, netDegree, bwUplink, run)
|
||||||
|
yield shape
|
||||||
|
2
study.py
2
study.py
@ -40,7 +40,7 @@ def study():
|
|||||||
print("You need to pass a configuration file in parameter")
|
print("You need to pass a configuration file in parameter")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
shape = Shape(0, 0, 0, 0, 0, 0)
|
shape = Shape(0, 0, 0, 0, 0, 0, 0)
|
||||||
sim = Simulator(shape, config)
|
sim = Simulator(shape, config)
|
||||||
sim.initLogger()
|
sim.initLogger()
|
||||||
results = []
|
results = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user