Examples of TravelingTournament


Examples of org.drools.planner.examples.travelingtournament.domain.TravelingTournament

    }

    public abstract class TravelingTournamentInputBuilder extends TxtInputBuilder {

        public Solution readSolution() throws IOException {
            TravelingTournament travelingTournament = new TravelingTournament();
            travelingTournament.setId(0L);
            int n = readN();
            readTeamList(travelingTournament, n);
            createDayList(travelingTournament, n);
            List<List<Integer>> outerDistanceList = readOuterDistanceList(travelingTournament);
            // TODO setting the distances should be a separate method
View Full Code Here

Examples of org.drools.planner.examples.travelingtournament.domain.TravelingTournament

        return (TravelingTournament) solutionBusiness.getSolution();
    }

    public void resetPanel(Solution solution) {
        removeAll();
        TravelingTournament travelingTournament = (TravelingTournament) solution;
        Map<Day, DayPanel> dayPanelMap = new HashMap<Day, DayPanel>();
        for (Day day : travelingTournament.getDayList()) {
            TravelingTournamentPanel.DayPanel dayPanel = new DayPanel();
            add(dayPanel);
            dayPanelMap.put(day, dayPanel);
        }
        for (Match match : travelingTournament.getMatchList()) {
            TravelingTournamentPanel.DayPanel dayPanel = dayPanelMap.get(match.getDay());
            dayPanel.addMatch(match);
        }
    }
View Full Code Here

Examples of org.optaplanner.examples.travelingtournament.domain.TravelingTournament

        return (TravelingTournament) solutionBusiness.getSolution();
    }

    public void resetPanel(Solution solution) {
        teamsPanel.reset();
        TravelingTournament travelingTournament = (TravelingTournament) solution;
        tangoColorFactory = new TangoColorFactory();
        defineGrid(travelingTournament);
        fillCells(travelingTournament);
        repaint(); // Hack to force a repaint of TimeTableLayout during "refresh screen while solving"
    }
View Full Code Here

Examples of org.optaplanner.examples.travelingtournament.domain.TravelingTournament

    }

    public static class TravelingTournamentInputBuilder extends TxtInputBuilder {

        public Solution readSolution() throws IOException {
            TravelingTournament travelingTournament = new TravelingTournament();
            travelingTournament.setId(0L);
            int n = readN();
            readTeamList(travelingTournament, n);
            createDayList(travelingTournament, n);
            List<List<Integer>> outerDistanceList = readOuterDistanceList(travelingTournament);
            // TODO setting the distances should be a separate method
            createMatchListAndSetDistancesInTeamList(travelingTournament, outerDistanceList);
            initializeMatchDays(travelingTournament);
            BigInteger possibleSolutionSize = factorial(2 * (n - 1)).pow(n / 2);
            logger.info("TravelingTournament {} has {} days, {} teams and {} matches with a search space of {}.",
                    getInputId(),
                    travelingTournament.getDayList().size(),
                    travelingTournament.getTeamList().size(),
                    travelingTournament.getMatchList().size(),
                    getFlooredPossibleSolutionSize(possibleSolutionSize));
            return travelingTournament;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.