18 lines
671 B
Python
18 lines
671 B
Python
from apps import Application
|
|
from datacentre import Datacentre
|
|
|
|
|
|
class Client:
|
|
def __init__(self):
|
|
self.startSlices: list[int] = []
|
|
self.lengthOfTransmission: int = 0
|
|
self.application: Application = Application()
|
|
|
|
def firerequest(self, edge: Datacentre, cloud: Datacentre, currentSlice: int) -> bool:
|
|
for i in self.startSlices:
|
|
if i <= currentSlice <= i+self.lengthOfTransmission:
|
|
return edge.fireapplicationmodule(
|
|
applicationmodule=self.application.modules[0]) and cloud.fireapplicationmodule(
|
|
applicationmodule=self.application.modules[1])
|
|
return True
|