Examples of cloneSolution()


Examples of org.drools.planner.core.solution.Solution.cloneSolution()

        // At the end of the phase, the best solution should be in the working memory for the next phase
        // TODO WORKAROUND because the best solution might not be initialized yet (and than it's currently null)
        Solution bestSolution = solverScope.getBestSolution();
        if (bestSolution != null) {
            // Clone of bestSolution because next phase will change the working solution but might not improve best
            solverScope.getSolutionDirector().setWorkingSolution(bestSolution.cloneSolution());
        }
        termination.phaseEnded(solverPhaseScope);
        solverPhaseLifecycleSupport.firePhaseEnded(solverPhaseScope);
    }
View Full Code Here

Examples of org.optaplanner.core.api.domain.solution.cloner.SolutionCloner.cloneSolution()

    }

    public void setWorkingSolutionFromBestSolution() {
        // The workingSolution must never be the same instance as the bestSolution.
        SolutionCloner cloner = scoreDirector.getSolutionDescriptor().getSolutionCloner();
        scoreDirector.setWorkingSolution(cloner.cloneSolution(getBestSolution()));
    }

    public String getBestScoreWithUninitializedPrefix() {
        return isBestSolutionInitialized() ? bestScore.toString() : "uninitialized/" + bestScore;
    }
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.