//BT IRELAND MTM,Destination CID Name,VIA,Calls,MINS,ALOC,% User,ASR,NER 02 boolean DEBUG=true; import java.io.ObjectOutputStream; import java.io.FileOutputStream; import java.io.IOException; class country { String name; float calls,mins; RShape outline; country() { super(); } country(String n,float c,float m,RShape shp){ name=n; calls=c; mins=m; outline=shp; } void addnetwork(float c,float m) { calls+=c; mins+=m; } void printOut() { println(name+" "+calls+" "+mins); } RPoint getpoint(int tries){ RPoint tl=outline.getTopLeft(); RPoint br=outline.getBottomRight(); RPoint np= new RPoint(0,0); int searching =1; while (searching>0&&searching0)); if (searching==10||searching==100||searching==1000||searching==10000||searching==100000) { println(name+"; try "+searching+": MISS at "+np.x+","+np.y+" bounds: "+tl.x+","+tl.y+" - "+br.x+","+br.y); } } if (searching==0) return np; else return new RPoint(0,0); } RPoint getcentre() { RPoint tl=outline.getTopLeft(); RPoint br=outline.getBottomRight(); return new RPoint((tl.x+br.x)/2,(tl.y+br.y)/2); } } class weightedpixel { float bright; RPoint pt; float index; //index weighted from 0-1 weightedpixel(RPoint _p,float _b) { pt=_p; bright=_b; } } class bitmapcountry extends country { //examines a bitmap //builds a table of population desnsity //look at it from the POV of how its gonna be used //getpoints(int num) should be able to return an array of points to draw from //should be dithered //has to distribute the points around the brightest points first //distribute in proportion to their brightness - weighted //table of pixels: if within shape: //sample brightness, keep running total and store normalised weighted index for quick searching float xo,xs,yo,ys; Vector points = new Vector(); bitmapcountry(String n,float c,float m,RShape shp) { super(n,c,m,shp); } void analyse(float _xo,float _xs,float _yo,float _ys) { int step=1; //speedup xo=_xo; xs=_xs; yo=_yo; ys=_ys; //scan country outline by pixel RPoint tl=outline.getTopLeft(); RPoint br=outline.getBottomRight(); RPoint tlp=normpix(tl); RPoint brp=normpix(br); float pixstep=xs/lightmap.width; float totalbright=0; float bmin=255; float bmax=0; println("searching "+tl.x+","+tl.y+" -> "+(tl.x+(pixstep*(brp.x-tlp.x)))+","+(tl.y+(pixstep*(brp.y-tlp.y)))); for (int i=0;ibmax) bmax=bn; if (bn0) { float index=random(0.999); int i=0; while (points.get(i).index countries = new Vector(); HashMap outlines = new HashMap(); calldata(String[][] data,RShape shp) { for (int i=0;i