Example #1
0
 def test_optimal_hashrouting_cache_placement_c(self):
     cache_budget = 30
     cache_nodes = 3
     cacheplacement.optimal_hashrouting_cache_placement(self.topo, cache_budget,
                                                        cache_nodes, 0.5)
     self.assertEqual(10, self.topo.node["c1"]['stack'][1]['cache_size'])
     self.assertEqual(10, self.topo.node["c2"]['stack'][1]['cache_size'])
     self.assertEqual(10, self.topo.node["c3"]['stack'][1]['cache_size'])
Example #2
0
 def test_optimal_hashrouting_cache_placement_c(self):
     cache_budget = 30
     cache_nodes = 3
     cacheplacement.optimal_hashrouting_cache_placement(self.topo, cache_budget,
                                                        cache_nodes, 0.5)
     self.assertEqual(10, self.topo.node["c1"]['stack'][1]['cache_size'])
     self.assertEqual(10, self.topo.node["c2"]['stack'][1]['cache_size'])
     self.assertEqual(10, self.topo.node["c3"]['stack'][1]['cache_size'])
Example #3
0
 def test_optimal_hashrouting_cache_placement_c(self):
     cache_budget = 30
     cache_nodes = 3
     cacheplacement.optimal_hashrouting_cache_placement(
         self.topo, cache_budget, cache_nodes, 0.5
     )
     assert self.topo.node["c1"]["stack"][1]["cache_size"] == 10
     assert self.topo.node["c2"]["stack"][1]["cache_size"] == 10
     assert self.topo.node["c3"]["stack"][1]["cache_size"] == 10
Example #4
0
 def test_optimal_hashrouting_cache_placement_b(self):
     cache_budget = 30
     cache_nodes = 2
     cacheplacement.optimal_hashrouting_cache_placement(
         self.topo, cache_budget, cache_nodes, 0.5)
     assert 15 == self.topo.node["c1"]['stack'][1]['cache_size']
     assert 15 == self.topo.node["c2"]['stack'][1]['cache_size']
     if 'cache_size' in self.topo.node["c3"]['stack'][1]:
         assert 0 == self.topo.node["c3"]['stack'][1]['cache_size']
Example #5
0
 def test_optimal_hashrouting_cache_placement_a(self):
     cache_budget = 30
     cache_nodes = 1
     cacheplacement.optimal_hashrouting_cache_placement(
         self.topo, cache_budget, cache_nodes, 0.5)
     if 'cache_size' in self.topo.node["c1"]['stack'][1]:
         assert self.topo.node["c1"]['stack'][1]['cache_size'] == 0
     assert self.topo.node["c2"]['stack'][1]['cache_size'] == 30
     if 'cache_size' in self.topo.node["c3"]['stack'][1]:
         assert self.topo.node["c3"]['stack'][1]['cache_size'] == 0