Package org.drools.planner.core.score

Examples of org.drools.planner.core.score.Score.compareTo()


    public double calculateAcceptChance(MoveScope moveScope) {
        LocalSearchSolverPhaseScope localSearchSolverPhaseScope = moveScope.getLocalSearchStepScope().getLocalSearchSolverPhaseScope();
        Score lastStepScore = localSearchSolverPhaseScope.getLastCompletedLocalSearchStepScope().getScore();
        Score moveScore = moveScope.getScore();
        if (moveScore.compareTo(lastStepScore) > 0) {
            return 1.0;
        }
        Score scoreDifference = lastStepScore.subtract(moveScore);
        // TODO don't abuse translateScoreToGraphValue
        Double diff = localSearchSolverPhaseScope.getScoreDefinition().translateScoreToGraphValue(scoreDifference);
View Full Code Here


    public double calculateAcceptChance(MoveScope moveScope) {
        LocalSearchSolverPhaseScope localSearchSolverPhaseScope = moveScope.getLocalSearchStepScope().getLocalSearchSolverPhaseScope();
        Score lastStepScore = localSearchSolverPhaseScope.getLastCompletedLocalSearchStepScope().getScore();
        Score moveScore = moveScope.getScore();
        if (moveScore.compareTo(lastStepScore) >= 0) {
            return 1.0;
        }
        Score scoreDifference = lastStepScore.subtract(moveScore);
        double acceptChance = 1.0;
        double[] scoreDifferenceParts = scoreDifference.toDoubleArray();
View Full Code Here

        boolean perfectMatch = false;
        Score bestScore = DefaultHardAndSoftScore.valueOf(Integer.MIN_VALUE, Integer.MIN_VALUE);
        Period bestPeriod = null;
        Room bestRoom = null;
        for (PeriodScoring periodScoring : periodScoringList) {
            if (bestScore.compareTo(periodScoring.getScore()) >= 0) {
                // No need to check the rest
                break;
            }
            for (ExamToHandle examToHandle : examToHandleList) {
                Exam exam = examToHandle.getExam();
View Full Code Here

            for (Room room : roomList) {
                scoreDirector.beforeVariableChanged(leader, "room");
                leader.setRoom(room);
                scoreDirector.afterVariableChanged(leader, "room");
                Score score = scoreDirector.calculateScore();
                if (score.compareTo(unscheduledScore) < 0) {
                    if (score.compareTo(bestScore) > 0) {
                        bestScore = score;
                        bestPeriod = periodScoring.getPeriod();
                        bestRoom = room;
                    }
View Full Code Here

                scoreDirector.beforeVariableChanged(leader, "room");
                leader.setRoom(room);
                scoreDirector.afterVariableChanged(leader, "room");
                Score score = scoreDirector.calculateScore();
                if (score.compareTo(unscheduledScore) < 0) {
                    if (score.compareTo(bestScore) > 0) {
                        bestScore = score;
                        bestPeriod = periodScoring.getPeriod();
                        bestRoom = room;
                    }
                } else if (score.equals(unscheduledScore)) {
View Full Code Here

        for (Room room : roomList) {
            scoreDirector.beforeVariableChanged(exam, "room");
            exam.setRoom(room);
            scoreDirector.afterVariableChanged(exam, "room");
            Score score = scoreDirector.calculateScore();
            if (score.compareTo(unscheduledScore) < 0) {
                if (score.compareTo(bestScore) > 0) {
                    bestScore = score;
                    bestRoom = room;
                }
            } else if (score.equals(unscheduledScore)) {
View Full Code Here

            scoreDirector.beforeVariableChanged(exam, "room");
            exam.setRoom(room);
            scoreDirector.afterVariableChanged(exam, "room");
            Score score = scoreDirector.calculateScore();
            if (score.compareTo(unscheduledScore) < 0) {
                if (score.compareTo(bestScore) > 0) {
                    bestScore = score;
                    bestRoom = room;
                }
            } else if (score.equals(unscheduledScore)) {
                perfectMatch = true;
View Full Code Here

                    scoreDirector.beforeVariableChanged(bedDesignation, "bed");
                    bedDesignation.setBed(bed);
                    scoreDirector.afterVariableChanged(bedDesignation, "bed");
                }
                Score score = scoreDirector.calculateScore();
                if (score.compareTo(unscheduledScore) < 0) {
                    if (score.compareTo(bestScore) > 0) {
                        bestScore = score;
                        bestBed = bed;
                    }
                } else if (score.equals(unscheduledScore)) {
View Full Code Here

                    bedDesignation.setBed(bed);
                    scoreDirector.afterVariableChanged(bedDesignation, "bed");
                }
                Score score = scoreDirector.calculateScore();
                if (score.compareTo(unscheduledScore) < 0) {
                    if (score.compareTo(bestScore) > 0) {
                        bestScore = score;
                        bestBed = bed;
                    }
                } else if (score.equals(unscheduledScore)) {
                    perfectMatch = true;
View Full Code Here

                        scoreDirector.beforeVariableChanged(seatDesignation, "seat");
                        seatDesignation.setSeat(seat);
                        scoreDirector.afterVariableChanged(seatDesignation, "seat");
                    }
                    Score score = scoreDirector.calculateScore();
                    if (score.compareTo(bestScore) > 0) {
                        bestScore = score;
                        bestSeat = seat;
                    }
                }
            }
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.