class TestSelector(unittest.TestCase):
    def setUp(self):
        self.g1 = Gaussian(x=numbergen.UniformRandom())
        self.g2 = Gaussian(x=numbergen.UniformRandom())
        self.s = Selector(generators=[self.g1, self.g2])
        self.s.set_dynamic_time_fn(None, 'generators')

    def test_dynamic_index(self):
        """index should always vary"""
        self.assertNotEqual(self.s.index, self.s.index)

    def test_dynamic_inheritance(self):
        """time_fn should have been applied to subpatterns"""
        self.assertNotEqual(self.g1.x, self.g1.x)
Esempio n. 2
0
class TestSelector(unittest.TestCase):

    def setUp(self):
        self.g1 = Gaussian(x=numbergen.UniformRandom())
        self.g2 = Gaussian(x=numbergen.UniformRandom())
        self.s = Selector(generators=[self.g1,self.g2])
        self.s.set_dynamic_time_fn(None,'generators')

    def test_dynamic_index(self):
        """index should always vary"""
        self.assertNotEqual(self.s.index,self.s.index)

    def test_dynamic_inheritance(self):
        """time_fn should have been applied to subpatterns"""
        self.assertNotEqual(self.g1.x,self.g1.x)
Esempio n. 3
0
 def setUp(self):
     self.g1 = Gaussian(x=numbergen.UniformRandom())
     self.g2 = Gaussian(x=numbergen.UniformRandom())
     self.s = Selector(generators=[self.g1,self.g2])
     self.s.set_dynamic_time_fn(None,'generators')
 def setUp(self):
     self.g1 = Gaussian(x=numbergen.UniformRandom())
     self.g2 = Gaussian(x=numbergen.UniformRandom())
     self.s = Selector(generators=[self.g1, self.g2])
     self.s.set_dynamic_time_fn(None, 'generators')