mirror of
https://github.com/status-im/das-research.git
synced 2025-02-23 11:58:14 +00:00
33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
#!/bin/python3
|
|
|
|
class Shape:
|
|
"""This class represents a set of parameters for a specific simulation."""
|
|
|
|
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
|
|
self.blockSize = blockSize
|
|
self.failureRate = failureRate
|
|
self.netDegree = netDegree
|
|
self.chi = chi
|
|
self.randomSeed = ""
|
|
self.bwUplink = bwUplink
|
|
|
|
def __repr__(self):
|
|
"""Returns a printable representation of the shape"""
|
|
shastr = ""
|
|
shastr += "bs-"+str(self.blockSize)
|
|
shastr += "-nbv-"+str(self.numberValidators)
|
|
shastr += "-fr-"+str(self.failureRate)
|
|
shastr += "-chi-"+str(self.chi)
|
|
shastr += "-bwu-"+str(self.bwUplink)
|
|
shastr += "-nd-"+str(self.netDegree)
|
|
shastr += "-r-"+str(self.run)
|
|
return shastr
|
|
|
|
def setSeed(self, seed):
|
|
"""Adds the random seed to the shape"""
|
|
self.randomSeed = seed
|
|
|