Created
February 23, 2017 19:10
-
-
Save iyedb/936259c4ebcbb6fbdca89ff2f792177c to your computer and use it in GitHub Desktop.
This file contains 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 characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment