package uk.ac.leeds.ccg.cluster; import java.awt.*; import java.awt.event.*; import java.util.*; import uk.ac.leeds.ccg.geotools.*; /** A class that implements Knox test */ public class Knox extends SimpleMethod implements Method, Runnable { // Members KnoxTimeParameters parameters; KnoxTimeParametersViewer parametersViewer; Database database; Results results; GeoRectangle geoRectangle = null; // Geotools geoRectangle // Methods public static void main(String args[]){ Knox knox = new Knox(); knox.run(); } public Knox(){ parameters = new KnoxTimeParameters(); parametersViewer = new KnoxTimeParametersViewer(parameters); } public String toString() {return "Knox";} public Parameters getParameters() {return parameters;} public ParametersViewer getParametersViewer() {return parametersViewer;} public void setData(Database d) {database=d;} public SignificanceTest getSignificanceTest(){return significanceTest;} public void setSearch(GeoRectangle r) {geoRectangle=r;} public Results getResults(){return results;} public void run(){ double to, from, x, y; double to1, from1, x1, y1; int X = 0, X2 = 0; int nge = 0; results = new Results(); int delta = parameters.getDelta(); int tau = parameters.getTau(); int numRuns = parameters.getNumRuns(); double thresh = parameters.getSignificanceThreshold(); double stat = (double) 0.0; System.out.println(""+this+" "+significanceTest); GeoData gcases = database.getCaseVals(); Vector points = database.getPoints(); int no_points = gcases.getSize(); // space & time made int, s & t removed - trying to save memory // double space[][] = new double[no_points][no_points]; // double time[][] = new double[no_points][no_points]; int space[][] = new int[no_points][no_points]; int time[][] = new int[no_points][no_points]; // int s[][] = new int[no_points][no_points]; // int t[][] = new int[no_points][no_points]; int t2[][] = new int[no_points][no_points]; int indic[] = new int[no_points]; int perm[] = new int[no_points]; int ntimes, mm; for (int i=0; i thresh) System.out.println("Prob. of such a result is greater than " + (double) (nge+1)/(numRuns+1)); else System.out.println("Prob. of such a result is less than, or equal to " + (double) (nge+1)/(numRuns+1)); } }