Exemplo n.º 1
0
 def test_rcg3(self):
     # random numbers for large array
     users = 10
     subcarriers = 50
     subcarriermap = np.around(8*np.random.rand(subcarriers, users)) # rounding makes it readable
     target = np.repeat(np.array([subcarriers/users]), users)
     outMap, initial = rcg.rcg(subcarriermap, target)
     self.assertTrue((np.bincount(np.int32(outMap)) == target).all())
Exemplo n.º 2
0
 def test_rcg3(self):
     # random numbers for large array
     users = 10
     subcarriers = 50
     subcarriermap = np.around(
         8 *
         np.random.rand(subcarriers, users))  # rounding makes it readable
     target = np.repeat(np.array([subcarriers / users]), users)
     outMap, initial = rcg.rcg(subcarriermap, target)
     self.assertTrue((np.bincount(np.int32(outMap)) == target).all())
Exemplo n.º 3
0
 def test_rcg2(self):
     # example from Kivanc thesis
     outMap, initial = rcg.rcg(self.costmap2, self.target2)
     self.assertTrue((outMap == self.result2).all())
Exemplo n.º 4
0
 def test_rcg1(self):
     # run the example from the Kivanc paper
     outMap, initial = rcg.rcg(self.costmap1, self.target1)
     self.assertTrue((outMap == self.result1).all())
Exemplo n.º 5
0
 def test_rcg2(self):
     # example from Kivanc thesis
     outMap, initial = rcg.rcg(self.costmap2, self.target2)
     self.assertTrue((outMap == self.result2).all())
Exemplo n.º 6
0
 def test_rcg1(self):
     # run the example from the Kivanc paper
     outMap, initial = rcg.rcg(self.costmap1, self.target1) 
     self.assertTrue((outMap == self.result1).all())