private void generateAllRows(final Supplier<T> initialValueSupplier, final Geometry bounds) { for (double y = getMinY(); y <= quadTree.getMaxNorthing(); y += getCentroidDistanceY()) { generateRow(y, initialValueSupplier, bounds); } }
qTree.getMaxNorthing() >= ptStopCoord.getY() && qTree.getMinNorthing() <= ptStopCoord.getY(); if(!isInBoundary){
this.nodeQuadTree = null; } else if (this.nodeQuadTree.getMinEasting() <= nn.getCoord().getX() && this.nodeQuadTree.getMaxEasting() > nn.getCoord().getX() && this.nodeQuadTree.getMinNorthing() <= nn.getCoord().getY() && this.nodeQuadTree.getMaxNorthing() > nn.getCoord().getY()) { this.nodeQuadTree.put(nn.getCoord().getX(), nn.getCoord().getY(), nn); } else {
private Tuple<QuadTree<ActivityFacilityWithIndex>, ActivityFacilityImpl[]> getTuple(String activityType) { TreesBuilder treesBuilder = new TreesBuilder(CollectionUtils.stringToSet(activityType), this.scenario.getNetwork(), this.dccg); treesBuilder.setActTypeConverter(this.getConverter()); treesBuilder.createTrees(scenario.getActivityFacilities()); ActivityFacilityImpl[] facilities = treesBuilder.getFacilitiesOfType().get(activityType); /* * Create a copy of the treesBuilder.getQuadTreesOfType() outcome where the * ActivityFacility objects are replaced by ActivityFacilityWithIndex objects. * TODO: let the TreeBuilder use ActivityFacilityWithIndex objects directly? */ QuadTree<ActivityFacilityWithIndex> quadTree = null; QuadTree<ActivityFacility> qt = treesBuilder.getQuadTreesOfType().get(activityType); if (qt != null) { double minX = qt.getMinEasting(); double maxX = qt.getMaxEasting(); double minY = qt.getMinNorthing(); double maxY = qt.getMaxNorthing(); quadTree = new QuadTree<ActivityFacilityWithIndex>(minX, minY, maxX, maxY); for (ActivityFacility activityFacility : qt.values()) { quadTree.put(activityFacility.getCoord().getX(), activityFacility.getCoord().getY(), this.faciliesWithIndexMap.get(activityFacility.getId())); } } return new Tuple<QuadTree<ActivityFacilityWithIndex>, ActivityFacilityImpl[]>(quadTree, facilities); }
djc.getClusteredPoints().getMinNorthing(), djc.getClusteredPoints().getMaxEasting(), djc.getClusteredPoints().getMaxNorthing()); for(Cluster cluster : clusters) {
/** * Test {@link QuadTree#QuadTree(double, double, double, double)}. */ @Test public void testConstructor() { QuadTree<String> qt = new QuadTree<>(-50.0, -40.0, +30.0, +20.0); assertEquals(-50.0, qt.getMinEasting(), 0.0); assertEquals(-40.0, qt.getMinNorthing(), 0.0); assertEquals(+30.0, qt.getMaxEasting(), 0.0); assertEquals(+20.0, qt.getMaxNorthing(), 0.0); }