def __init__(self, view, controller, intra_routing, inter_routing='LCE', **kwargs): """Constructor Parameters ---------- view : NetworkView An instance of the network view controller : NetworkController An instance of the network controller intra_routing : str Intra-cluster content routing scheme: SYMM, ASYMM or MULTICAST inter_routing : str Inter-cluster content routing scheme. Only supported LCE """ super(HashroutingClustered, self).__init__(view, controller) if intra_routing not in ('SYMM', 'ASYMM', 'MULTICAST'): raise ValueError('Intra-cluster routing policy %s not supported' % intra_routing) self.intra_routing = intra_routing self.inter_routing = inter_routing self.cluster_topology = extract_cluster_level_topology(view.topology()) self.cluster_sp = nx.all_pairs_shortest_path(self.cluster_topology)
def __init__(self, view, controller, intra_routing, inter_routing='LCE', **kwargs): """Constructor Parameters ---------- view : NetworkView An instance of the network view controller : NetworkController An instance of the network controller intra_routing : str Intra-cluster content routing scheme: SYMM, ASYMM or MULTICAST inter_routing : str Inter-cluster content routing scheme. Only supported LCE """ super(HashroutingClustered, self).__init__(view, controller) if intra_routing not in ('SYMM', 'ASYMM', 'MULTICAST'): raise ValueError('Intra-cluster routing policy %s not supported' % intra_routing) self.intra_routing = intra_routing self.inter_routing = inter_routing self.cluster_topology = extract_cluster_level_topology(view.topology()) self.cluster_sp = dict(nx.all_pairs_shortest_path(self.cluster_topology))