Ejemplo n.º 1
0
def sexer_randompairs(n):
	'''Yields n of each of two sexes, in pairs, in random order.
	Assumes from __future__ import division.
	'''
	sexgen = utilities.n_each_rand(n,itemtuple="MF")
	while True:
		yield sexgen.next() + sexgen.next()
Ejemplo n.º 2
0
def sexer_randompairs(n):
    '''Yields n of each of two sexes, in pairs, in random order.
	Assumes from __future__ import division.
	'''
    sexgen = utilities.n_each_rand(n, itemtuple="MF")
    while True:
        yield sexgen.next() + sexgen.next()
Ejemplo n.º 3
0
 def test_n_each_rand(self):
     n = random.randrange(500)
     TF = n_each_rand(n, (True, False))
     TFlist = list(TF)
     nT = TFlist.count(True)
     nF = TFlist.count(False)
     self.assertEqual(n, nT)
     self.assertEqual(n, nF)
Ejemplo n.º 4
0
 def test_n_each_rand(self):
     n = random.randrange(500)
     TF = n_each_rand(n, (True, False))
     TFlist = list(TF)
     nT = TFlist.count(True)
     nF = TFlist.count(False)
     self.assertEqual(n, nT)
     self.assertEqual(n, nF)