public static QuadTree<Integer> testBigWind( int nItems, int MAX, int DYNAMIC, double BUCKET_EXP, double windowShift, QuadTree.ListProvider LP) { QuadTree<Integer> q = new QuadTree<>(); if (LP != null) q.LIST_PROVIDER = LP; q.LEAF_MAX_OBJECTS = MAX; if (DYNAMIC > 0) q.DYNAMIC_MAX_OBJECTS = true; q.MAX_OBJ_TARGET_EXPONENT = BUCKET_EXP; for (int i = 0; i < nItems; i++) { q.place( Math.round(Math.random() * 1000) + (windowShift * i / (double) nItems), Math.round(Math.random() * 1000), i); } return q; }
private void findAll(QuadTree<Integer> quad, double w, double part) { double x0 = Math.random() * w - part / 2, y0 = Math.random() * w - part / 2; quad.findAll(x0, y0, x0 + part, y0 + part); }