[rules-users] proble with localSearch

Michiel Vermandel mvermand at yahoo.com
Tue Jan 8 09:24:07 EST 2013


Hi,

I'm trying to implement a basic local search (really new to it).

When I run my project I now get:

Exception in thread "main" java.lang.IllegalStateException: Phase localSearch started with an uninitialized Solution. First initialize the Solution. For example, run a phase constructionHeuristic first.
    at org.drools.planner.core.localsearch.DefaultLocalSearchSolverPhase.phaseStarted(DefaultLocalSearchSolverPhase.java:120)

This is my config:

<?xml version="1.0" encoding="UTF-8"?>
<solver>
    <environmentMode>DEBUG</environmentMode>

    <!-- Domain model configuration -->
    <solutionClass>be.axi.planner.app.InspectionSchedule</solutionClass>
    <planningEntityClass>be.axi.planner.domain.Task</planningEntityClass>

    <!-- Score configuration -->
    <scoreDirectorFactory>
        <scoreDefinitionType>HARD_AND_SOFT</scoreDefinitionType>
        <scoreDrl>/inspectionRules.drl</scoreDrl>
    </scoreDirectorFactory>

    <constructionHeuristic>
        <constructionHeuristicType>BEST_FIT_DECREASING</constructionHeuristicType>
        <!-- constructionHeuristicPickEarlyType>FIRST_LAST_STEP_SCORE_EQUAL_OR_IMPROVING</constructionHeuristicPickEarlyType-->
    </constructionHeuristic>

    <localSearch>
        <termination>
            <terminationCompositionStyle>OR</terminationCompositionStyle>
            <maximumSecondsSpend>3600</maximumSecondsSpend>
            <scoreAttained>0hard/0soft</scoreAttained>
        </termination>
        <unionMoveSelector>
            <changeMoveSelector>
                <valueSelector>
                    <planningVariableName>period</planningVariableName>
                </valueSelector>
            </changeMoveSelector>
            <changeMoveSelector>
                <valueSelector>
                    <planningVariableName>spector</planningVariableName>
                </valueSelector>
            </changeMoveSelector>
            <changeMoveSelector>
                <valueSelector>
                    <planningVariableName>type</planningVariableName>
                </valueSelector>
            </changeMoveSelector>
            <swapMoveSelector>
            </swapMoveSelector>
        </unionMoveSelector>

        <acceptor>
            <planningEntityTabuSize>7</planningEntityTabuSize>
        </acceptor>
        <forager>
            <minimalAcceptedSelection>1000</minimalAcceptedSelection>
        </forager>
    </localSearch>

</solver>


 Any thoughts on what I'm doing wrong?

Thanks

Michiel

-----------------
http://www.codessentials.com - Your essential software, for free!
Follow us at http://twitter.com/#!/Codessentials
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20130108/17611db1/attachment-0001.html 


More information about the rules-users mailing list