<div dir="ltr">Hi Folks,<div><br></div><div>I am new to OptaPlanner, so please forgive me if this is a stupid question. </div><div><br></div><div>I developed a project to solve a worker assignment problem based on OptaPlanner. I have a java class &quot;Demand&quot; which has the information of capacity needed for each shift. </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: </div><div><div>rule &quot; test rule&quot;</div>
<div><span class="" style="white-space:pre">        </span>when</div><div><span class="" style="white-space:pre">                </span>$s : Shift($i : index) </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(&quot;Test rule fired.&quot;);</div><div>end</div><div><br></div><div>From console log I observed that at local search phase this rule was never fired. </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>