2023-01-23 18:04:54 +01:00
|
|
|
#!/bin/python3
|
|
|
|
|
|
|
|
class Shape:
|
2023-02-15 15:06:42 +01:00
|
|
|
"""This class represents a set of parameters for a specific simulation."""
|
2023-01-23 18:04:54 +01:00
|
|
|
|
2023-07-15 02:18:30 +02:00
|
|
|
def __init__(self, blockSizeR, blockSizeRK, blockSizeC, blockSizeCK,
|
|
|
|
numberNodes, failureModel, failureRate, class1ratio, chiR, chiC, vpn1, vpn2, netDegree, bwUplinkProd, bwUplink1, bwUplink2, run):
|
2023-02-15 15:06:42 +01:00
|
|
|
"""Initializes the shape with the parameters passed in argument."""
|
2023-01-25 21:51:59 +01:00
|
|
|
self.run = run
|
2023-03-13 15:03:55 +01:00
|
|
|
self.numberNodes = numberNodes
|
2023-07-12 13:21:27 +02:00
|
|
|
self.blockSizeR = blockSizeR
|
2023-07-15 02:18:30 +02:00
|
|
|
self.blockSizeRK = blockSizeRK
|
2023-07-12 13:21:27 +02:00
|
|
|
self.blockSizeC = blockSizeC
|
2023-07-15 02:18:30 +02:00
|
|
|
self.blockSizeCK = blockSizeCK
|
2023-04-09 23:49:11 +02:00
|
|
|
self.failureModel = failureModel
|
2023-01-25 21:51:59 +01:00
|
|
|
self.failureRate = failureRate
|
2023-01-23 18:04:54 +01:00
|
|
|
self.netDegree = netDegree
|
2023-03-07 13:24:11 +01:00
|
|
|
self.class1ratio = class1ratio
|
2023-07-12 13:44:23 +02:00
|
|
|
self.chiR = chiR
|
|
|
|
self.chiC = chiC
|
2023-03-13 15:00:43 +01:00
|
|
|
self.vpn1 = vpn1
|
|
|
|
self.vpn2 = vpn2
|
2023-03-07 13:24:11 +01:00
|
|
|
self.bwUplinkProd = bwUplinkProd
|
|
|
|
self.bwUplink1 = bwUplink1
|
|
|
|
self.bwUplink2 = bwUplink2
|
2023-03-15 13:18:02 +01:00
|
|
|
self.randomSeed = ""
|
2023-01-23 18:04:54 +01:00
|
|
|
|
2023-03-15 12:37:23 +01:00
|
|
|
def __repr__(self):
|
|
|
|
"""Returns a printable representation of the shape"""
|
|
|
|
shastr = ""
|
2023-07-15 02:18:30 +02:00
|
|
|
shastr += "bsrn-"+str(self.blockSizeR)
|
2024-02-16 15:42:52 +05:30
|
|
|
shastr += "-bsrk-"+str(self.blockSizeRK)
|
|
|
|
shastr += "-bscn-"+str(self.blockSizeC)
|
|
|
|
shastr += "-bsck-"+str(self.blockSizeCK)
|
2023-03-13 15:03:55 +01:00
|
|
|
shastr += "-nn-"+str(self.numberNodes)
|
2023-04-09 23:49:11 +02:00
|
|
|
shastr += "-fm-"+str(self.failureModel)
|
2023-03-15 12:37:23 +01:00
|
|
|
shastr += "-fr-"+str(self.failureRate)
|
2023-03-07 13:24:11 +01:00
|
|
|
shastr += "-c1r-"+str(self.class1ratio)
|
2023-07-12 13:44:23 +02:00
|
|
|
shastr += "-chir-"+str(self.chiR)
|
|
|
|
shastr += "-chic-"+str(self.chiC)
|
2023-03-13 15:00:43 +01:00
|
|
|
shastr += "-vpn1-"+str(self.vpn1)
|
|
|
|
shastr += "-vpn2-"+str(self.vpn2)
|
2023-03-07 13:24:11 +01:00
|
|
|
shastr += "-bwupprod-"+str(self.bwUplinkProd)
|
|
|
|
shastr += "-bwup1-"+str(self.bwUplink1)
|
|
|
|
shastr += "-bwup2-"+str(self.bwUplink2)
|
2023-03-15 12:37:23 +01:00
|
|
|
shastr += "-nd-"+str(self.netDegree)
|
|
|
|
shastr += "-r-"+str(self.run)
|
2023-03-15 13:18:02 +01:00
|
|
|
return shastr
|
2023-01-23 18:04:54 +01:00
|
|
|
|
2023-03-15 13:18:02 +01:00
|
|
|
def setSeed(self, seed):
|
|
|
|
"""Adds the random seed to the shape"""
|
|
|
|
self.randomSeed = seed
|
2023-01-23 18:04:54 +01:00
|
|
|
|