Skip to content

Instantly share code, notes, and snippets.

@iyedb
Created February 23, 2017 19:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iyedb/936259c4ebcbb6fbdca89ff2f792177c to your computer and use it in GitHub Desktop.
Save iyedb/936259c4ebcbb6fbdca89ff2f792177c to your computer and use it in GitHub Desktop.
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