src/demo/TSP.java
public static void main(String[] args) {
        TSP tsp;
        String stringFormat = "%.5f";
        try {
            tsp = new TSP(numberOfCities);
            tsp.initWindow();
            for (int tour = 0; tour < 1000000; tour++) {
                tsp.route(tour % 10 == 0);
                System.out.println("Tour #" + (tour + 1) + " Total: " + String.format(stringFormat, tsp.getTotalDistance()) + " (" + String.format(stringFormat, tsp.getTotalNormalizedDistance()) +")" + " Min: " + String.format(stringFormat, tsp.getMinDistance()) + " (" + String.format(stringFormat, tsp.getMinNormalizedDistance()) + ")" + " Max: " + String.format(stringFormat, tsp.getMaxDistance()) + " (" + String.format(stringFormat, tsp.getMaxNormalizedDistance()) + ")");
            }
            tsp.stop();
        } catch (Exception exception) {
            exception.printStackTrace();
            System.exit(-1);
        }
    }
/**
     * Main function for travelling sales man.
     *
     * @param args not used.
     */
Main function for travelling sales man.
@param args not used.
Main function for travelling sales man . @param args not used .
public static void main(String[] args) {
        TSP tsp;
        String stringFormat = "%.5f";
        try {
            tsp = new TSP(numberOfCities);
            tsp.initWindow();
            for (int tour = 0; tour < 1000000; tour++) {
                tsp.route(tour % 10 == 0);
                System.out.println("Tour #" + (tour + 1) + " Total: " + String.format(stringFormat, tsp.getTotalDistance()) + " (" + String.format(stringFormat, tsp.getTotalNormalizedDistance()) +")" + " Min: " + String.format(stringFormat, tsp.getMinDistance()) + " (" + String.format(stringFormat, tsp.getMinNormalizedDistance()) + ")" + " Max: " + String.format(stringFormat, tsp.getMaxDistance()) + " (" + String.format(stringFormat, tsp.getMaxNormalizedDistance()) + ")");
            }
            tsp.stop();
        } catch (Exception exception) {
            exception.printStackTrace();
            System.exit(-1);
        }
    }
public static void main ( String [ ] args ) { TSP tsp ; String stringFormat = "%.5f" ; try { tsp = new TSP ( numberOfCities ) ; tsp . initWindow ( ) ; for ( int tour = 0 ; tour < 1000000 ; tour ++ ) { tsp . route ( tour % 10 == 0 ) ; System . out . println ( "Tour #" + ( tour + 1 ) + " Total: " + String . format ( stringFormat , tsp . getTotalDistance ( ) ) + " (" + String . format ( stringFormat , tsp . getTotalNormalizedDistance ( ) ) + ")" + " Min: " + String . format ( stringFormat , tsp . getMinDistance ( ) ) + " (" + String . format ( stringFormat , tsp . getMinNormalizedDistance ( ) ) + ")" + " Max: " + String . format ( stringFormat , tsp . getMaxDistance ( ) ) + " (" + String . format ( stringFormat , tsp . getMaxNormalizedDistance ( ) ) + ")" ) ; } tsp . stop ( ) ; } catch ( Exception exception ) { exception . printStackTrace ( ) ; System . exit ( - 1 ) ; } }
Main function for travelling sales man.
Main function for travelling sales man .