Package org.optaplanner.examples.tsp.domain.location

Examples of org.optaplanner.examples.tsp.domain.location.AirLocation


    public void insertLocationAndVisit(double longitude, double latitude) {
        final Location newLocation;
        switch (getTravelingSalesmanTour().getDistanceType()) {
            case AIR_DISTANCE:
                newLocation = new AirLocation();
                break;
            case ROAD_DISTANCE:
                logger.warn("Adding locations for a road distance dataset is not supported.");
                return;
            default:
View Full Code Here


                String line = bufferedReader.readLine();
                String[] lineTokens = splitBySpace(line, 3, 4);
                Location location;
                switch (distanceType) {
                    case AIR_DISTANCE:
                        location = new AirLocation();
                        break;
                    case ROAD_DISTANCE:
                        location = new RoadLocation();
                        break;
                    default:
View Full Code Here

            List<Location> locationList = new ArrayList<Location>(locationListSize);
            long id = 0;
            for (int i = 0; i < locationListSize; i++) {
                String line = bufferedReader.readLine();
                String[] lineTokens = splitBySpace(line, 2);
                Location location = new AirLocation();
                location.setId(id);
                id++;
                location.setLatitude(Double.parseDouble(lineTokens[0]));
                location.setLongitude(Double.parseDouble(lineTokens[1]));
                locationList.add(location);
            }
            travelingSalesmanTour.setLocationList(locationList);
            createVisitList();
        }
View Full Code Here

TOP

Related Classes of org.optaplanner.examples.tsp.domain.location.AirLocation

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.