<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">Op 08-01-13 15:24, Michiel Vermandel
schreef:<br>
</div>
<blockquote
cite="mid:1357655047.91611.YahooMailNeo@web161305.mail.bf1.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff; font-family:tahoma,
new york, times, serif;font-size:10pt">Hi,<br>
<br>
I'm trying to implement a basic local search (really new to it).<br>
<br>
When I run my project I now get:<br>
<br>
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.<br>
at
org.drools.planner.core.localsearch.DefaultLocalSearchSolverPhase.phaseStarted(DefaultLocalSearchSolverPhase.java:120)<br>
</div>
</blockquote>
You have a construction heuristic configured, so all
@PlanningVariable's should be different from null after that phase
is ended.<br>
So when the local search phase starts, that check should be ok and
not throw that exception.<br>
<br>
Comment out local search, write the solution to disk an verify that
all planning variables are now not null.<br>
Or debug where that exception is throw and inspect
phaseScope.getSolverScope().getScoreDirector().getWorkingSolution().<br>
<blockquote
cite="mid:1357655047.91611.YahooMailNeo@web161305.mail.bf1.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff; font-family:tahoma,
new york, times, serif;font-size:10pt"><br>
This is my config:<br>
<br>
<?xml version="1.0" encoding="UTF-8"?><br>
<solver><br>
<environmentMode>DEBUG</environmentMode><br>
<br>
<!-- Domain model configuration --><br>
<solutionClass>be.axi.planner.app.InspectionSchedule</solutionClass><br>
<planningEntityClass>be.axi.planner.domain.Task</planningEntityClass><br>
<br>
<!-- Score configuration --><br>
<scoreDirectorFactory><br>
<scoreDefinitionType>HARD_AND_SOFT</scoreDefinitionType><br>
<scoreDrl>/inspectionRules.drl</scoreDrl><br>
</scoreDirectorFactory><br>
<br>
<constructionHeuristic><br>
<constructionHeuristicType>BEST_FIT_DECREASING</constructionHeuristicType><br>
<!--
constructionHeuristicPickEarlyType>FIRST_LAST_STEP_SCORE_EQUAL_OR_IMPROVING</constructionHeuristicPickEarlyType--><br>
</constructionHeuristic><br>
<br>
<localSearch><br>
<termination><br>
<terminationCompositionStyle>OR</terminationCompositionStyle><br>
<maximumSecondsSpend>3600</maximumSecondsSpend><br>
<scoreAttained>0hard/0soft</scoreAttained><br>
</termination><br>
<unionMoveSelector><br>
<changeMoveSelector><br>
<valueSelector><br>
<planningVariableName>period</planningVariableName><br>
</valueSelector><br>
</changeMoveSelector><br>
<changeMoveSelector><br>
<valueSelector><br>
<planningVariableName>spector</planningVariableName><br>
</valueSelector><br>
</changeMoveSelector><br>
<changeMoveSelector><br>
<valueSelector><br>
<planningVariableName>type</planningVariableName><br>
</valueSelector><br>
</changeMoveSelector><br>
<swapMoveSelector><br>
</swapMoveSelector><br>
</unionMoveSelector><br>
<br>
<acceptor><br>
<planningEntityTabuSize>7</planningEntityTabuSize><br>
</acceptor><br>
<forager><br>
<minimalAcceptedSelection>1000</minimalAcceptedSelection><br>
</forager><br>
</localSearch><br>
<br>
</solver><br>
<div><span></span></div>
<div> Any thoughts on what I'm doing wrong?<br>
<br>
Thanks<br>
<br>
Michiel<br>
</div>
<div>-----------------<br>
<a class="moz-txt-link-freetext" href="http://www.codessentials.com">http://www.codessentials.com</a> - Your essential software, for
free!<br>
Follow us at <a class="moz-txt-link-freetext" href="http://twitter.com/#!/Codessentials">http://twitter.com/#!/Codessentials</a></div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
</body>
</html>