Package com.heatonresearch.aifh.examples.ga.tsp

Examples of com.heatonresearch.aifh.examples.ga.tsp.City


        cities = new City[CITIES];
        for (int i = 0; i < cities.length; i++) {
            int xPos = (int) (Math.random() * MAP_SIZE);
            int yPos = (int) (Math.random() * MAP_SIZE);

            cities[i] = new City(xPos, yPos);
        }
    }
View Full Code Here


        solve.solve();
    }

    @Override
    public double cost(final int sourceNode, final int targetNode) {
        City city1 = cities[sourceNode];
        City city2 = cities[targetNode];
        return city1.proximity(city2);
    }
View Full Code Here

TOP

Related Classes of com.heatonresearch.aifh.examples.ga.tsp.City

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.