Пример #1
0
 def test_reset(self):
     r = FRandomStream()
     first_seed = r.get_current_seed()
     r.generate_new_seed()
     second_seed = r.get_current_seed()
     self.assertTrue(first_seed != second_seed)
     r.reset()
     self.assertEqual(r.get_current_seed(), r.get_initial_seed())
Пример #2
0
 def test_vrand_cone(self):
     r = FRandomStream()
     self.assertTrue((1.0 - r.vrand_cone(FVector(0, 0, 1), 30, 22).length()) < 0.1)
Пример #3
0
 def test_vrand(self):
     r = FRandomStream()
     self.assertTrue((1.0 - r.vrand().length()) < 0.1)
Пример #4
0
 def test_frand(self):
     r = FRandomStream()
     self.assertTrue(type(r.frand()) is float)
Пример #5
0
 def test_rand_helper(self):
     r = FRandomStream()
     value = r.rand_helper(30)
     self.assertTrue(type(value) is int)
     self.assertTrue(value >= 0)
     self.assertTrue(value <= 30)
Пример #6
0
 def test_rand_range(self):
     r = FRandomStream()
     value = r.rand_range(17, 30)
     self.assertTrue(type(value) is int)
     self.assertTrue(value >= 17)
     self.assertTrue(value <= 30)
Пример #7
0
 def test_get_unsigned_int(self):
     r = FRandomStream()
     value = r.get_unsigned_int()
     self.assertTrue(type(value) is int)
     self.assertTrue(value >= 0)
Пример #8
0
 def test_initialize(self):
     r = FRandomStream()
     r.initialize(17)
     self.assertEqual(r.get_initial_seed(), 17)
Пример #9
0
 def test_get_unit_vector(self):
     r = FRandomStream()
     self.assertTrue((1.0 - r.get_unit_vector().length()) < 0.1)
Пример #10
0
 def test_get_fraction(self):
     r = FRandomStream()
     first_seed = r.get_current_seed()
     initial_seed = r.get_initial_seed()
     self.assertEqual(first_seed, initial_seed)
Пример #11
0
 def test_get_fraction(self):
     r = FRandomStream()
     value = r.get_fraction()
     self.assertTrue(type(value) is float)
     self.assertTrue(value >= 0.0)
     self.assertTrue(value <= 1.0)
Пример #12
0
 def test_generate_new_seed(self):
     r = FRandomStream()
     first_seed = r.get_current_seed()
     r.generate_new_seed()
     second_seed = r.get_current_seed()
     self.assertTrue(first_seed != second_seed)
Пример #13
0
 def test_frand_range(self):
     r = FRandomStream()
     value = r.frand_range(17, 22)
     self.assertTrue(value >= 17)
     self.assertTrue(value <= 22)