def __init__(self, topology, log_dir, scenario_id, params=None): ''' Constructor ''' super(HashrouteAsymmetric, self).__init__(topology, log_dir, scenario_id) # map id of content to node with cache responsibility self.cache_assignment = assign_caches(topology, self.cache_size, replicas=1)
def __init__(self, topology, log_dir, scenario_id, params=None): ''' Constructor ''' super(HashrouteMulticast, self).__init__(topology, log_dir, scenario_id) # map id of content to node with cache responsibility self.cache_assignment = assign_caches(topology, self.cache_size, replicas=1) self.stretch_logger = StretchLogger(path.join(log_dir, 'RESULTS_%s_STRETCH.txt' % scenario_id))
def __init__(self, topology, log_dir, scenario_id, params=None): ''' Constructor ''' super(HashrouteHybridStretch, self).__init__(topology, log_dir, scenario_id) # map id of content to node with cache responsibility params = {'max_stretch': 0.2} self.cache_assignment = assign_caches(topology, self.cache_size, replicas=1) self.max_stretch = nx.diameter(topology) * params['max_stretch'] self.stretch_logger = StretchLogger(path.join(log_dir, 'RESULTS_%s_STRETCH.txt' % scenario_id))