Examples of Score


Examples of org.drools.planner.core.score.Score

    public Score getBestScore() {
        return solverScope.getBestScore();
    }

    public void assertUndoMoveIsUncorrupted(Move move, Move undoMove) {
        Score undoScore = calculateScore();
        Score lastCompletedStepScore = getLastCompletedStepScope().getScore();
        if (!undoScore.equals(lastCompletedStepScore)) {
            // First assert that are probably no corrupted score rules.
            getScoreDirector().assertWorkingScore(undoScore);
            throw new IllegalStateException(
                    "The moveClass (" + move.getClass() + ")'s move (" + move
View Full Code Here

Examples of org.drools.planner.core.score.Score

        workingMemory.retract(factHandle);
    }

    public Score calculateScore() {
        workingMemory.fireAllRules();
        Score score = workingScoreHolder.extractScore();
        setCalculatedScore(score);
        return score;
    }
View Full Code Here

Examples of org.drools.planner.core.score.Score

        Iterator<CustomSolverPhaseCommand> commandIterator = customSolverPhaseCommandList.iterator();
        while (!termination.isPhaseTerminated(customSolverPhaseScope) && commandIterator.hasNext()) {
            CustomSolverPhaseCommand customSolverPhaseCommand = commandIterator.next();
            stepStarted(stepScope);
            customSolverPhaseCommand.changeWorkingSolution(solverScope.getScoreDirector());
            Score score = customSolverPhaseScope.calculateScore();
            stepScope.setScore(score);
            stepEnded(stepScope);
            stepScope = createNextStepScope(customSolverPhaseScope, stepScope);
        }
        phaseEnded(customSolverPhaseScope);
View Full Code Here

Examples of org.drools.planner.core.score.Score

        if (assertionScoreDirectorFactory == null) {
            assertionScoreDirectorFactory = scoreDirectorFactory;
        }
        ScoreDirector uncorruptedScoreDirector = assertionScoreDirectorFactory.buildScoreDirector();
        uncorruptedScoreDirector.setWorkingSolution(workingSolution);
        Score uncorruptedScore = uncorruptedScoreDirector.calculateScore();
        if (!workingScore.equals(uncorruptedScore)) {
            String scoreCorruptionAnalysis = buildScoreCorruptionAnalysis(uncorruptedScoreDirector);
            uncorruptedScoreDirector.dispose();
            throw new IllegalStateException(
                    "Score corruption: the workingScore (" + workingScore + ") is not the uncorruptedScore ("
View Full Code Here

Examples of org.drools.planner.core.score.Score

        super.afterProblemFactRemoved(problemFact);
        incrementalScoreCalculator.resetWorkingSolution(workingSolution); // TODO do not nuke it
    }

    public Score calculateScore() {
        Score score = incrementalScoreCalculator.calculateScore();
        setCalculatedScore(score);
        return score;
    }
View Full Code Here

Examples of org.drools.planner.core.score.Score

    // ************************************************************************
    // Complex methods
    // ************************************************************************

    public Score calculateScore() {
        Score score = simpleScoreCalculator.calculateScore(workingSolution);
        setCalculatedScore(score);
        return score;
    }
View Full Code Here

Examples of org.drools.planner.core.score.Score

        this.assertUndoMoveIsUncorrupted = assertUndoMoveIsUncorrupted;
    }

    public void doPlacement(ConstructionHeuristicStepScope stepScope) {
        // TODO extract to PlacerForager
        Score maxScore = stepScope.getPhaseScope().getScoreDefinition().getPerfectMinimumScore();
        ConstructionHeuristicMoveScope maxMoveScope = null;

        Object entity = stepScope.getEntity();
        int moveIndex = 0;
        for (Object value : valueSelector) {
View Full Code Here

Examples of org.drools.planner.core.score.Score

        logger.trace("        Move index ({}), score ({}) for move ({}).",
                new Object[]{moveScope.getMoveIndex(), moveScope.getScore(), moveScope.getMove()});
    }

    private void processMove(ConstructionHeuristicMoveScope moveScope) {
        Score score = moveScope.getStepScope().getPhaseScope().calculateScore();
        if (assertMoveScoreIsUncorrupted) {
            moveScope.getStepScope().getPhaseScope().assertWorkingScore(score);
        }
        moveScope.setScore(score);
        // TODO work with forager
View Full Code Here

Examples of org.drools.planner.core.score.Score

        BruteForceStepScope stepScope = createNextStepScope(bruteForceSolverPhaseScope, null);
        while (!termination.isPhaseTerminated(bruteForceSolverPhaseScope) && bruteForceEntityWalker.hasWalk()) {
            stepStarted(stepScope);
            bruteForceEntityWalker.walk();
            Score score = bruteForceSolverPhaseScope.calculateScore();
            stepScope.setScore(score);
            stepEnded(stepScope);
            stepScope = createNextStepScope(bruteForceSolverPhaseScope, stepScope);
        }
        phaseEnded(bruteForceSolverPhaseScope);
View Full Code Here

Examples of org.drools.planner.core.score.Score

                new Object[]{moveScope.getMoveIndex(), moveScope.getScore(), moveScope.getAccepted(),
                        moveScope.getMove()});
    }

    private void processMove(LocalSearchMoveScope moveScope) {
        Score score = moveScope.getStepScope().getPhaseScope().calculateScore();
        if (assertMoveScoreIsUncorrupted) {
            moveScope.getStepScope().getPhaseScope().assertWorkingScore(score);
        }
        moveScope.setScore(score);
        boolean accepted = acceptor.isAccepted(moveScope);
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.