<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Check your Solution.getProblemFacts() method.<br>
    Make sure you used addAll() instead of add() in there.<br>
    <br>
    <div class="moz-cite-prefix">On 01-11-13 16:46, Xi Gong wrote:<br>
    </div>
    <blockquote
cite="mid:CAECanwA5-cR5U+mb0rXT1M6sApDjhw5z=ta9EroyhkLe7dn9gw@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi Folks,
        <div><br>
        </div>
        <div>I am new to OptaPlanner, so please forgive me if this is a
          stupid question.&nbsp;</div>
        <div><br>
        </div>
        <div>I developed a project to solve a worker assignment problem
          based on OptaPlanner. I have a java class "Demand" which has
          the information of capacity needed for each shift.&nbsp;</div>
        <div>I added it to the solution class as a problem fact, since
          it should never be changed. Then I wrote rules saying that
          when the supply on that shift can not satisfy the demand there
          will be a point loss.</div>
        <div><br>
        </div>
        <div>The problem I met is that when stepping into local search
          phase, the solver can not access to this class.</div>
        <div><br>
        </div>
        <div>For instance, I have the following rule:&nbsp;</div>
        <div>
          <div>rule " test rule"</div>
          <div><span class="" style="white-space:pre"> </span>when</div>
          <div><span class="" style="white-space:pre"> </span>$s :
            Shift($i : index)&nbsp;</div>
          <div><span class="" style="white-space:pre"> </span>$d :
            Demand(shift.getIndex() == $i)</div>
          <div><span class="" style="white-space:pre"> </span>then</div>
          <div><span class="" style="white-space:pre"> </span>System.out.println("Test
            rule fired.");</div>
          <div>end</div>
          <div><br>
          </div>
          <div>From console log I observed that at local search phase
            this rule was never fired.&nbsp;</div>
          <div>Does anyone have any thoughts on why this happened and
            how I should solve this problem? I will appreciate your
            help.</div>
          <div><br>
          </div>
          <div>Thanks,</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>