Package org.drools.planner.examples.tsp.domain

Examples of org.drools.planner.examples.tsp.domain.TravelingSalesmanTour


        newCity.setLongitude(longitude);
        newCity.setLatitude(latitude);
        logger.info("Scheduling insertion of newCity ({}).", newCity);
        solutionBusiness.doProblemFactChange(new ProblemFactChange() {
            public void doChange(ScoreDirector scoreDirector) {
                TravelingSalesmanTour solution = (TravelingSalesmanTour) scoreDirector.getWorkingSolution();
                scoreDirector.beforeProblemFactAdded(newCity);
                solution.getCityList().add(newCity);
                scoreDirector.afterProblemFactAdded(newCity);
                Visit newVisit = new Visit();
                newVisit.setId(newCity.getId());
                newVisit.setCity(newCity);
                scoreDirector.beforeEntityAdded(newVisit);
                solution.getVisitList().add(newVisit);
                scoreDirector.afterEntityAdded(newVisit);
            }
        });
        updatePanel(solutionBusiness.getSolution());
    }
View Full Code Here


            super(visit.getCity().getSafeName());
            this.visit = visit;
        }

        public void actionPerformed(ActionEvent e) {
            TravelingSalesmanTour travelingSalesmanTour = tspPanel.getTravelingSalesmanTour();
            JComboBox previousAppearanceListField = new JComboBox();
            for (Appearance previousAppearance : travelingSalesmanTour.getVisitList()) {
                previousAppearanceListField.addItem(previousAppearance);
            }
            for (Appearance previousAppearance : travelingSalesmanTour.getDomicileList()) {
                previousAppearanceListField.addItem(previousAppearance);
            }
            previousAppearanceListField.setSelectedItem(visit.getPreviousAppearance());
            int result = JOptionPane.showConfirmDialog(TspListPanel.this.getRootPane(), previousAppearanceListField,
                    "Visit " + visit.getCity().getSafeName() + " after", JOptionPane.OK_CANCEL_OPTION);
View Full Code Here

        this.tspPanel = tspPanel;
        addComponentListener(new ComponentAdapter() {
            @Override
            public void componentResized(ComponentEvent e) {
                // TODO Not thread-safe during solving
                TravelingSalesmanTour travelingSalesmanTour = TspWorldPanel.this.tspPanel.getTravelingSalesmanTour();
                if (travelingSalesmanTour != null) {
                    resetPanel(travelingSalesmanTour);
                }
            }
        });
View Full Code Here

        private TravelingSalesmanTour travelingSalesmanTour;

        private int cityListSize;

        public Solution readSolution() throws IOException {
            travelingSalesmanTour = new TravelingSalesmanTour();
            travelingSalesmanTour.setId(0L);
            readHeaders();
            readCityList();
            readConstantLine("EOF");
            createVisitList();
View Full Code Here

TOP

Related Classes of org.drools.planner.examples.tsp.domain.TravelingSalesmanTour

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.