Package org.drools.planner.core.score

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


                    cloudAssignmentHandle = workingMemory.insert(cloudAssignment);
                } else {
                    workingMemory.update(cloudAssignmentHandle, cloudAssignment);
                }
                Score score = abstractSolverScope.calculateScoreFromWorkingMemory();
                if (score.compareTo(bestScore) > 0) {
                    bestScore = score;
                    bestCloudComputer = cloudComputer;
                }
            }
            if (bestCloudComputer == null) {
View Full Code Here


                    assignmentHandle = workingMemory.insert(assignment);
                } else {
                    workingMemory.update(assignmentHandle, assignment);
                }
                Score score = abstractSolverScope.calculateScoreFromWorkingMemory();
                if (score.compareTo(bestScore) > 0) {
                    bestScore = score;
                    bestEmployee = employee;
                }
            }
            if (bestEmployee == null) {
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) {
                examToHandle.getExam().setPeriod(periodScoring.getPeriod());
View Full Code Here

            }
            for (Room room : roomList) {
                leader.setRoom(room);
                workingMemory.update(leaderHandle, leader);
                Score score = abstractSolverScope.calculateScoreFromWorkingMemory();
                if (score.compareTo(unscheduledScore) < 0) {
                    if (score.compareTo(bestScore) > 0) {
                        bestScore = score;
                        bestPeriod = periodScoring.getPeriod();
                        bestRoom = room;
                    }
View Full Code Here

            for (Room room : roomList) {
                leader.setRoom(room);
                workingMemory.update(leaderHandle, leader);
                Score score = abstractSolverScope.calculateScoreFromWorkingMemory();
                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

        Room bestRoom = null;
        for (Room room : roomList) {
            exam.setRoom(room);
            workingMemory.update(examHandle, exam);
            Score score = abstractSolverScope.calculateScoreFromWorkingMemory();
            if (score.compareTo(unscheduledScore) < 0) {
                if (score.compareTo(bestScore) > 0) {
                    bestScore = score;
                    bestRoom = room;
                }
            } else if (score.equals(unscheduledScore)) {
View Full Code Here

        for (Room room : roomList) {
            exam.setRoom(room);
            workingMemory.update(examHandle, exam);
            Score score = abstractSolverScope.calculateScoreFromWorkingMemory();
            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

                        seatDesignationHandle = workingMemory.insert(seatDesignation);
                    } else {
                        workingMemory.update(seatDesignationHandle, seatDesignation);
                    }
                    Score score = abstractSolverScope.calculateScoreFromWorkingMemory();
                    if (score.compareTo(bestScore) > 0) {
                        bestScore = score;
                        bestSeat = seat;
                    }
                }
            }
View Full Code Here

            planningVariableWalker.walk();
            Score score = greedyFitSolverPhaseScope.calculateScoreFromWorkingMemory();
            if (assertMoveScoreIsUncorrupted) {
                greedyFitSolverPhaseScope.assertWorkingScore(score);
            }
            if (score.compareTo(maxScore) > 0) {
                greedyFitStepScope.setVariableToValueMap(planningVariableWalker.getVariableToValueMap());
                maxScore = score;
            }
            if (constructionHeuristicPickEarlyType
                    == ConstructionHeuristicPickEarlyType.FIRST_LAST_STEP_SCORE_EQUAL_OR_IMPROVING
View Full Code Here

                maxScore = score;
            }
            if (constructionHeuristicPickEarlyType
                    == ConstructionHeuristicPickEarlyType.FIRST_LAST_STEP_SCORE_EQUAL_OR_IMPROVING
                    && lastStepScore != null
                    && score.compareTo(lastStepScore) >= 0) {
                break;
            }
        }
        greedyFitStepScope.setScore(maxScore);
    }
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.