add application to clients
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
a9f473e2d9
commit
079e887c6a
@ -4,5 +4,5 @@ from apps import Application
|
|||||||
class Client:
|
class Client:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.startSlices: list[int] = []
|
self.startSlices: list[int] = []
|
||||||
self.lengthOfTransmission:int = 0
|
self.lengthOfTransmission: int = 0
|
||||||
self.application: Application = Application()
|
self.application: Application = Application()
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
|
|
||||||
from scenarioplanner import Scenarioplanner
|
from scenarioplanner import Scenarioplanner
|
||||||
from src import scenarioplanner
|
|
||||||
|
|
||||||
|
|
||||||
def preparesimulation() -> Scenarioplanner:
|
def preparesimulation() -> Scenarioplanner:
|
||||||
@ -9,6 +8,8 @@ def preparesimulation() -> Scenarioplanner:
|
|||||||
scenarioplanner.simulationLength = 120
|
scenarioplanner.simulationLength = 120
|
||||||
scenarioplanner.createapplications()
|
scenarioplanner.createapplications()
|
||||||
scenarioplanner.createclients(1000)
|
scenarioplanner.createclients(1000)
|
||||||
|
print("Number of Birbnetes clients: " + str(scenarioplanner.statsModule.birbnetesClients))
|
||||||
|
print("Number of Videochat clients: " + str(scenarioplanner.statsModule.videochatClients))
|
||||||
return scenarioplanner
|
return scenarioplanner
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,6 +56,7 @@ class Scenarioplanner:
|
|||||||
currentclient: Client = Client()
|
currentclient: Client = Client()
|
||||||
currentclient.lengthOfTransmission = random.randint(1, self.maxLengthofTransmission)
|
currentclient.lengthOfTransmission = random.randint(1, self.maxLengthofTransmission)
|
||||||
numoftransmissions: int = random.randint(1, 10)
|
numoftransmissions: int = random.randint(1, 10)
|
||||||
|
currentclient.application = self.pickapplicationforclient()
|
||||||
for j in range(numoftransmissions):
|
for j in range(numoftransmissions):
|
||||||
currentclient.startSlices.append(
|
currentclient.startSlices.append(
|
||||||
random.randint(1, self.simulationLength - self.maxLengthofTransmission))
|
random.randint(1, self.simulationLength - self.maxLengthofTransmission))
|
||||||
|
Loading…
Reference in New Issue
Block a user