import java.applet.*; import java.util.*; import java.awt.*; import java.net.*; import java.io.*; public class TSP extends Applet implements Runnable { public int NCITY = 5; public int NGEONEURON; public static final double COUNTRY = 1.00; public static final double NEAR = 0.05; public static final Color bkC = new Color(0x000090); public static final Color bk2C = new Color(0x000050); public static final Color lnC = new Color(0xff0000); public static final Color ln2C = new Color(0xcccc00); public static final Color fgC = new Color(0xffffff); public Image homeI,offscreen; public int imagewidth ,imageheight; public Thread animator = null; public boolean please_stop = false; Font mF = new Font("Courier", Font.BOLD, 12); Font sF = new Font("Courier", Font.BOLD, 8); public int counter; public City city[]; public geoNeuron gn[]; public double r[][]; public double theta, phi, momentum; public Scrollbar cscroll; /////////////////////////////////////////////////////////////////// // // Init section // /////////////////////////////////////////////////////////////////// public void kohonenInit(){ theta = 0.5; phi = 0.5; momentum = 0.995; NCITY = cscroll.getValue()/10; NGEONEURON = NCITY*2; //URL url; //homeI = this.getImage(this.getDocumentBase(), "home.gif"); city = new City[NCITY]; for(int i = 0; i