Exemplo n.º 1
0
    def __init__(self, data, param):
        """
        two levels grid
        """

        Grid_pure.__init__(self, data, param)
        self.param.maxHeightHTree = 4

        # compute the best grid size at level 1
        if Params.FIX_GRANULARITY:
            self.m = Params.PARTITION_AG[0]
        else:
            # print self.param.NDATA
            # print self.param.Eps
            # print Params.c
            self.m = int(max(10, int(0.25 * math.ceil((self.param.NDATA * self.param.Eps / param.c) ** (1.0 / 2)))))
        logging.debug("Grid_adaptive: Level 1 size: %d" % self.m)
Exemplo n.º 2
0
 def run_Grid_pure(self, param):
     logging.debug('building Grid_pure...')
     tree = Grid_pure(self.data, param)
     start = time.clock()
     tree.buildIndex()
     if Params.CONSTRAINT_INFERENCE:
         tree.adjustConsistency()
     end = time.clock()
     logging.info('[T] Grid_pure building time: %.2d ' % (end - start))
     return self.query(tree)
 def __init__(self, data, param):
     Grid_pure.__init__(self, data, param)
     # compute the best grid size
     self.param.m = int(math.ceil((Params.NDATA * self.param.Eps / Params.c) ** (1.0 / 2)))
     self.param.maxHeightHTree = 2