package uk.ac.leeds.ccg.cluster; import java.awt.*; import java.awt.event.*; import java.util.*; //import com.sun.java.util.collections.*; //change for 1.2! import uk.ac.leeds.ccg.geotools.*; import uk.ac.leeds.ccg.raster.*; /** Random search method */ public class Random extends SimpleMethod implements Method, Runnable { // Members Database database; Results results; Shader shader; // Geotools shader GeoRectangle geoRectangle = null; // Geotools geoRectangle RandomParameters parameters = new RandomParameters(); RandomParametersViewer randomParametersViewer = new RandomParametersViewer(parameters); // Methods public String toString(){return "Random";} public Parameters getParameters(){return parameters;} public ParametersViewer getParametersViewer(){return randomParametersViewer;} public void setShader(Shader s){shader=s;} public void setData(Database d){database=d;} public SignificanceTest getSignificanceTest(){return significanceTest;} public void setSearch(GeoRectangle g){geoRectangle=g;} public Results getResults(){return results;} public void run(){ results = new Results(); if(geoRectangle==null){ geoRectangle=database.getBounds(); } if (significanceTest == null){ System.out.println("Random with null sig test - using Possion"); significanceTest = new PoissonTest(); significanceTest.setParameters(parameters); } System.out.println(""+significanceTest); int id=0; double width= geoRectangle.width; double height= geoRectangle.height; double originx= geoRectangle.x; double originy= geoRectangle.y; double radmin=parameters.getRadMin(); double radmax=parameters.getRadMax(); double x,y,r; GeoCircle cc; for(int i=0;i