Created
February 23, 2017 19:10
-
-
Save iyedb/936259c4ebcbb6fbdca89ff2f792177c to your computer and use it in GitHub Desktop.
Revisions
-
iyedb created this gist
Feb 23, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,44 @@ class Cache(object): def __init__(self, seq, size, latency): self.size = size self.seq = seq self.latency = latency def put(self, video): if self.size >= video: self.size -= video return True return False class Endpoint(object): def __init__(self, seq, caches, dc_latency): self.seq = seq self.caches = caches self.dc_latency = dc_latency def place_video(self, video): pass class Demand(object): def __init__(self, nbreqs, endpoint, video): self.nbreqs = nbreqs self.endpoint = endpoint self.video = video def buildrepartition(demand): pass repartition = [] demands = [] for d in demands: repartition.append(buildrepartition(d)) # 1500 requests for video 3 coming from endpoint 0