Examples of BruteForceStepScope


Examples of org.drools.planner.core.bruteforce.scope.BruteForceStepScope

    public void solve(DefaultSolverScope solverScope) {
        BruteForceSolverPhaseScope bruteForceSolverPhaseScope = new BruteForceSolverPhaseScope(solverScope);
        phaseStarted(bruteForceSolverPhaseScope);

        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.bruteforce.scope.BruteForceStepScope

    }

    private BruteForceStepScope createNextStepScope(BruteForceSolverPhaseScope phaseScope,
            BruteForceStepScope completedStepScope) {
        if (completedStepScope == null) {
            completedStepScope = new BruteForceStepScope(phaseScope);
            completedStepScope.setScore(phaseScope.getStartingScore());
            completedStepScope.setStepIndex(-1);
        }
        phaseScope.setLastCompletedStepScope(completedStepScope);
        BruteForceStepScope stepScope = new BruteForceStepScope(phaseScope);
        stepScope.setStepIndex(completedStepScope.getStepIndex() + 1);
        stepScope.setSolutionInitialized(true);
        return stepScope;
    }
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.