summaryrefslogtreecommitdiffstats
path: root/voronoi/sweepLineVD.java
blob: 214b7c38c7bccb5aaf76d70413b04f2de844e25c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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 {
 * 
 * }
 */