Package com.chkris.ant.model

Examples of com.chkris.ant.model.City


        return Math.sqrt(Math.pow(p1x - p2x, 2.0) + Math.pow(p1y - p2y, 2.0));
    }

    protected List singleCity(Object cityObjOne, Object cityObjTwo, List cities, AntAlgorithmSettings antAlgorithmSettings) {

        City city1 = (City)cityObjOne;
        City city2 = (City)cityObjTwo;

        List<Integer> line = new ArrayList();
        line.add(cities.indexOf(cityObjOne) + 1);
        line.add(cities.indexOf(cityObjTwo) + 1);
        line.add(this.length(city1.getPositionX(), city1.getPositionY(), city2.getPositionX(), city2.getPositionY()).intValue());
        line.add(antAlgorithmSettings.getInitialPheromoneAmount());

        return line;
    }
View Full Code Here

TOP

Related Classes of com.chkris.ant.model.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.