Package org.optaplanner.core.impl.localsearch.decider

Examples of org.optaplanner.core.impl.localsearch.decider.LocalSearchDecider


        }
        return phase;
    }

    private LocalSearchDecider buildDecider(HeuristicConfigPolicy configPolicy, Termination termination) {
        LocalSearchDecider decider = new LocalSearchDecider();
        decider.setTermination(termination);
        MoveSelector moveSelector = buildMoveSelector(configPolicy);
        decider.setMoveSelector(moveSelector);
        AcceptorConfig acceptorConfig_ = acceptorConfig == null ? new AcceptorConfig()
                : acceptorConfig;
        decider.setAcceptor(acceptorConfig_.buildAcceptor(configPolicy));
        LocalSearchForagerConfig foragerConfig_ = foragerConfig == null ? new LocalSearchForagerConfig()
                : foragerConfig;
        Forager forager = foragerConfig_.buildForager(configPolicy);
        decider.setForager(forager);
        if (moveSelector.isNeverEnding() && !forager.supportsNeverEndingMoveSelector()) {
            throw new IllegalStateException("The moveSelector (" + moveSelector
                    + ") has neverEnding (" + moveSelector.isNeverEnding()
                    + "), but the forager (" + forager
                    + ") does not support it."
                    + " Configure the <forager> with <acceptedCountLimit>.");
        }
        EnvironmentMode environmentMode = configPolicy.getEnvironmentMode();
        if (environmentMode.isNonIntrusiveFullAsserted()) {
            decider.setAssertMoveScoreFromScratch(true);
        }
        if (environmentMode.isIntrusiveFastAsserted()) {
            decider.setAssertExpectedUndoMoveScore(true);
        }
        return decider;
    }
View Full Code Here

TOP

Related Classes of org.optaplanner.core.impl.localsearch.decider.LocalSearchDecider

Copyright © 2018 www.massapicom. 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.