<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 09-01-13 08:21, Michiel Vermandel
      schreef:<br>
    </div>
    <blockquote
      cite="mid:1357716079.98440.YahooMailNeo@web161301.mail.bf1.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff; font-family:tahoma,
        new york, times, serif;font-size:10pt"><span>Hi Geoffrey,</span>
        <div style="font-family: tahoma, new york, times, serif;
          font-size: 10pt;">
          <div style="font-family: times new roman, new york, times,
            serif; font-size: 12pt;">
            <div id="yiv1074014940">
              <div>
                <div
                  style="color:#000;background-color:#fff;font-family:tahoma,
                  new york, times, serif;font-size:10pt;">
                  <div style="color:rgb(0, 0,
                    0);font-size:13.3333px;font-family:tahoma, new york,
                    times,
                    serif;background-color:transparent;font-style:normal;"><br>
                    <span></span></div>
                  <div style="color:rgb(0, 0,
                    0);font-size:13.3333px;font-family:tahoma, new york,
                    times,
                    serif;background-color:transparent;font-style:normal;"><span>Thanks
                      for your advice.</span></div>
                  <div style="color:rgb(0, 0,
                    0);font-size:13.3333px;font-family:tahoma, new york,
                    times,
                    serif;background-color:transparent;font-style:normal;"><span>Indeed
                      one of the planning variables is consistently null
                      over all planning entities.</span></div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    And there was a construction heuristic that should have already
    filled in that planning entity?<br>
    Enable DEBUG logging, so you can see in the construction heuristic
    log if it does steps which change that variable from null to a
    non-null value.<br>
    <br>
    If you have 2 &lt;constructionHeuristics&gt; configurations before
    the &lt;localSearch&gt; configuration (which I don't see how you
    could with the 5.5 CH behavior):<br>
    I just fixed a bug/feature for 6.0 earlier this week to support
    that.<br>
    <br>
    <blockquote
      cite="mid:1357716079.98440.YahooMailNeo@web161301.mail.bf1.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff; font-family:tahoma,
        new york, times, serif;font-size:10pt">
        <div style="font-family: tahoma, new york, times, serif;
          font-size: 10pt;">
          <div style="font-family: times new roman, new york, times,
            serif; font-size: 12pt;">
            <div id="yiv1074014940">
              <div>
                <div
                  style="color:#000;background-color:#fff;font-family:tahoma,
                  new york, times, serif;font-size:10pt;">
                  <div style="color:rgb(0, 0,
                    0);font-size:13.3333px;font-family:tahoma, new york,
                    times,
                    serif;background-color:transparent;font-style:normal;"><span>Should
                      drools planner take care of this or should I
                      impose an extra rule to exclude these selections?</span></div>
                  <div style="color:rgb(0, 0,
                    0);font-size:13.3333px;font-family:tahoma, new york,
                    times,
                    serif;background-color:transparent;font-style:normal;"><span>Once
                      again I seem to struggle with nulls being passed
                      in as planning variable...</span></div>
                  <div style="color:rgb(0, 0,
                    0);font-size:13.3333px;font-family:tahoma, new york,
                    times,
                    serif;background-color:transparent;font-style:normal;"><br>
                    <span></span></div>
                  <div style="color:rgb(0, 0,
                    0);font-size:13.3333px;font-family:tahoma, new york,
                    times,
                    serif;background-color:transparent;font-style:normal;"><span>Thanks,</span></div>
                  <div style="color:rgb(0, 0,
                    0);font-size:13.3333px;font-family:tahoma, new york,
                    times,
                    serif;background-color:transparent;font-style:normal;"><br>
                    <span></span></div>
                  <div style="color:rgb(0, 0,
                    0);font-size:13.3333px;font-family:tahoma, new york,
                    times,
                    serif;background-color:transparent;font-style:normal;"><span>Michiel<br>
                    </span></div>
                  <div>&nbsp;</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><br>
                  </div>
                  <div style="font-family:tahoma, new york, times,
                    serif;font-size:10pt;">
                    <div style="font-family:times new roman, new york,
                      times, serif;font-size:12pt;">
                      <div dir="ltr"> <font face="Arial" size="2">
                          <hr size="1"> <b><span
                              style="font-weight:bold;">From:</span></b>
                          Geoffrey De Smet
                          <a class="moz-txt-link-rfc2396E" href="mailto:ge0ffrey.spam@gmail.com">&lt;ge0ffrey.spam@gmail.com&gt;</a><br>
                          <b><span style="font-weight:bold;">To:</span></b>
                          Michiel Vermandel <a class="moz-txt-link-rfc2396E" href="mailto:mvermand@yahoo.com">&lt;mvermand@yahoo.com&gt;</a>;
                          Rules Users List
                          <a class="moz-txt-link-rfc2396E" href="mailto:rules-users@lists.jboss.org">&lt;rules-users@lists.jboss.org&gt;</a> <br>
                          <b><span style="font-weight:bold;">Sent:</span></b>
                          Tuesday, January 8, 2013 4:27 PM<br>
                          <b><span style="font-weight:bold;">Subject:</span></b>
                          Re: proble with localSearch<br>
                        </font> </div>
                      <br>
                      <div id="yiv1074014940">
                        <div> <br>
                          <div class="yiv1074014940moz-cite-prefix">Op
                            08-01-13 15:24, Michiel Vermandel schreef:<br>
                          </div>
                          <blockquote 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>
                              &nbsp;&nbsp;&nbsp; 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 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>
                              &lt;?xml version="1.0"
                              encoding="UTF-8"?&gt;<br>
                              &lt;solver&gt;<br>
                              &nbsp;&nbsp;&nbsp;
                              &lt;environmentMode&gt;DEBUG&lt;/environmentMode&gt;<br>
                              <br>
                              &nbsp;&nbsp;&nbsp; &lt;!-- Domain model configuration
                              --&gt;<br>
                              &nbsp;&nbsp;&nbsp;
&lt;solutionClass&gt;be.axi.planner.app.InspectionSchedule&lt;/solutionClass&gt;<br>
                              &nbsp;&nbsp;&nbsp;
&lt;planningEntityClass&gt;be.axi.planner.domain.Task&lt;/planningEntityClass&gt;<br>
                              <br>
                              &nbsp;&nbsp;&nbsp; &lt;!-- Score configuration --&gt;<br>
                              &nbsp;&nbsp;&nbsp; &lt;scoreDirectorFactory&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
                              &lt;scoreDefinitionType&gt;HARD_AND_SOFT&lt;/scoreDefinitionType&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
                              &lt;scoreDrl&gt;/inspectionRules.drl&lt;/scoreDrl&gt;<br>
                              &nbsp;&nbsp;&nbsp; &lt;/scoreDirectorFactory&gt;<br>
                              <br>
                              &nbsp;&nbsp;&nbsp; &lt;constructionHeuristic&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;constructionHeuristicType&gt;BEST_FIT_DECREASING&lt;/constructionHeuristicType&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;!--
constructionHeuristicPickEarlyType&gt;FIRST_LAST_STEP_SCORE_EQUAL_OR_IMPROVING&lt;/constructionHeuristicPickEarlyType--&gt;<br>
                              &nbsp;&nbsp;&nbsp; &lt;/constructionHeuristic&gt;<br>
                              <br>
                              &nbsp;&nbsp;&nbsp; &lt;localSearch&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;termination&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;terminationCompositionStyle&gt;OR&lt;/terminationCompositionStyle&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
                              &lt;maximumSecondsSpend&gt;3600&lt;/maximumSecondsSpend&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
                              &lt;scoreAttained&gt;0hard/0soft&lt;/scoreAttained&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/termination&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;unionMoveSelector&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;changeMoveSelector&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;valueSelector&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
                              &lt;planningVariableName&gt;period&lt;/planningVariableName&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/valueSelector&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/changeMoveSelector&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;changeMoveSelector&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;valueSelector&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
                              &lt;planningVariableName&gt;spector&lt;/planningVariableName&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/valueSelector&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/changeMoveSelector&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;changeMoveSelector&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;valueSelector&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
                              &lt;planningVariableName&gt;type&lt;/planningVariableName&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/valueSelector&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/changeMoveSelector&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;swapMoveSelector&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/swapMoveSelector&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/unionMoveSelector&gt;<br>
                              <br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;acceptor&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
                              &lt;planningEntityTabuSize&gt;7&lt;/planningEntityTabuSize&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/acceptor&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;forager&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
                              &lt;minimalAcceptedSelection&gt;1000&lt;/minimalAcceptedSelection&gt;<br>
                              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/forager&gt;<br>
                              &nbsp;&nbsp;&nbsp; &lt;/localSearch&gt;<br>
                              <br>
                              &lt;/solver&gt;<br>
                              <div><span></span></div>
                              <div>&nbsp;Any thoughts on what I'm doing
                                wrong?<br>
                                <br>
                                Thanks<br>
                                <br>
                                Michiel<br>
                              </div>
                              <div>-----------------<br>
                                <a moz-do-not-send="true" rel="nofollow"
class="yiv1074014940moz-txt-link-freetext" target="_blank"
                                  href="http://www.codessentials.com/">http://www.codessentials.com</a>
                                - Your essential software, for free!<br>
                                Follow us at <a moz-do-not-send="true"
                                  rel="nofollow"
                                  class="yiv1074014940moz-txt-link-freetext"
                                  target="_blank"
                                  href="http://twitter.com/#%21/Codessentials">http://twitter.com/#!/Codessentials</a></div>
                            </div>
                            <br>
                            <fieldset
                              class="yiv1074014940mimeAttachmentHeader"></fieldset>
                            <br>
                            <pre>_______________________________________________
rules-users mailing list
<a moz-do-not-send="true" rel="nofollow" class="yiv1074014940moz-txt-link-abbreviated" ymailto="mailto:rules-users@lists.jboss.org" target="_blank" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a moz-do-not-send="true" rel="nofollow" class="yiv1074014940moz-txt-link-freetext" target="_blank" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
                          </blockquote>
                          <br>
                        </div>
                      </div>
                      <br>
                      <br>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <br>
            <br>
          </div>
        </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>