Пример #1
0
def getPoissonGap(params):
    dimensions = params['dimensions']
    if len(dimensions) != 1:
        raise ValueError("poisson gap algorithm only implemented for one dimension")
    dim1 = dimensions[0]
    low,high = dim1['range']
    numGeneratedPoints = params['numGeneratedPoints']
    return pg.getGenerator(low, high, numGeneratedPoints)
Пример #2
0
def getPoissonGap(params):
    dimensions = params['dimensions']
    if len(dimensions) != 1:
        raise ValueError(
            "poisson gap algorithm only implemented for one dimension")
    dim1 = dimensions[0]
    low, high = dim1['range']
    numGeneratedPoints = params['numGeneratedPoints']
    return pg.getGenerator(low, high, numGeneratedPoints)
Пример #3
0
 def testTooManyPoints(self):
     (low, high) = 1, 100
     points = pg.getGenerator(low, high, 500)()
     self.assertEqual(len(points), 500,
                      "incorrect number of points generated")
Пример #4
0
 def testBoundsBig(self):
     (low, high) = 1, 10000
     points = pg.getGenerator(low, high, 283)()
     myBool = all([c[0] >= low and c[0] <= high for c in points])
     self.assertTrue(myBool,
                     "points not within boundaries -- bigger example")
Пример #5
0
 def setUp(self):
     self.low = -4
     self.high = 51
     self.numPoints = 34
     gen = pg.getGenerator(self.low, self.high, self.numPoints)
     self.points = gen()
Пример #6
0
 def testTooManyPoints(self):
     (low, high) = 1, 100
     points = pg.getGenerator(low, high, 500)()
     self.assertEqual(len(points), 500, "incorrect number of points generated")
Пример #7
0
 def testBoundsBig(self):
     (low, high) = 1, 10000
     points = pg.getGenerator(low, high, 283)()
     myBool = all([c[0] >= low and c[0] <= high for c in points])
     self.assertTrue(myBool, "points not within boundaries -- bigger example")
Пример #8
0
 def setUp(self):
     self.low = -4
     self.high = 51
     self.numPoints = 34
     gen = pg.getGenerator(self.low, self.high, self.numPoints)
     self.points = gen()