summaryrefslogtreecommitdiffstats
path: root/voronoi/sweepLineVD.java
diff options
context:
space:
mode:
Diffstat (limited to 'voronoi/sweepLineVD.java')
-rw-r--r--voronoi/sweepLineVD.java73
1 files changed, 73 insertions, 0 deletions
diff --git a/voronoi/sweepLineVD.java b/voronoi/sweepLineVD.java
new file mode 100644
index 0000000..214b7c3
--- /dev/null
+++ b/voronoi/sweepLineVD.java
@@ -0,0 +1,73 @@
+package voronoi;
+
+import helper.ListBTS;
+
+import java.awt.geom.Point2D;
+import java.util.ArrayList;
+import java.util.List;
+
+import DataStructure.GSMMap;
+import DataStructure.SingleBTS;
+
+public class sweepLineVD {
+ private GSMMap map;
+
+ // private ArrayList<point> pointmap = new ArrayList<point>();
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public sweepLineVD(GSMMap map) {
+ this.map = map;
+ }
+
+ public void interpolate() {
+ SingleBTS[] btscontent = map.content();
+ for (SingleBTS extrapolateThis : btscontent) {
+ doVoronoi(extrapolateThis);
+ }
+ }
+
+ private void doVoronoi(SingleBTS extrapolateThis) {
+ // extract only x/y points out of gsmmap with this arfcn
+ List<Point2D> pointmap = getPointMap(extrapolateThis);
+ // start voronoi sweep now and build voronoi diagram
+ voronoisweep(pointmap);
+
+ }
+
+ @SuppressWarnings("unused")
+ private void voronoisweep(List<Point2D> pointmap) {
+ // sweepline from y=0 to max(y)
+ double sweepline = 0;
+
+ }
+
+ private List<Point2D> getPointMap(SingleBTS extrapolateThis) {
+ // have mappoint sorted for x-coordinates
+ ArrayList<Point2D> pointmap = new ArrayList<Point2D>();
+ for (int x = 0; x < map.Xcoords.length; x++) {
+ for (int y = 0; y < map.Ycoords.length; y++) {
+ if (ListBTS.contains(map.map[x][y], extrapolateThis)) {
+ pointmap.add(new Point2D.Double(x, y));
+ }
+ }
+
+ }
+ return pointmap;
+
+ }
+}
+
+/*
+ * class Point { public double x; public double y;
+ *
+ * public Point(double x, double y) { this.x = x; this.y = y; } } class Line {
+ *
+ * }
+ */ \ No newline at end of file