From 08d5f7b0a0b24c042aa5976f66bf3a1b5b754478 Mon Sep 17 00:00:00 2001 From: Richard Zahoransky Date: Mon, 7 Nov 2011 16:29:56 +0100 Subject: Localization Code. How-To will follow... --- voronoi/sweepLineVD.java | 73 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 voronoi/sweepLineVD.java (limited to 'voronoi/sweepLineVD.java') 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 pointmap = new ArrayList(); + + /** + * @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 pointmap = getPointMap(extrapolateThis); + // start voronoi sweep now and build voronoi diagram + voronoisweep(pointmap); + + } + + @SuppressWarnings("unused") + private void voronoisweep(List pointmap) { + // sweepline from y=0 to max(y) + double sweepline = 0; + + } + + private List getPointMap(SingleBTS extrapolateThis) { + // have mappoint sorted for x-coordinates + ArrayList pointmap = new ArrayList(); + 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 -- cgit v1.2.3-55-g7522