Saturday, 15 May 2010

Optaplanner SwapMove filter in Cheap Time -


I am working on a new plan problem and using cheap time for testing. I want to add a filter to handle a hard-score barrier. In some cases, a machine can not be assigned - at all.

I have added this filter to swapmov filters:

  Public class function impaired filter selection filter,  SwapMove & gt; {Accept public bullion (Score director, score director, swap move move) {Task alarmation Task 1 = (task assignment). Gate LTT (); Task Assetection Task 2 = (Task Alness) move.getRightEntity (); If (task1.getMachine (). GetIndex () == 0 | Task 2. Metamine (). GetIndex () == 0) Return false; Back true; }  

}

and added to the configuration

  & lt; SwapMoveSelector & gt; & Lt; FilterClass & gt; ... .askAssignmentFilter & lt; / FilterClass & gt; & Lt; / SwapMoveSelector & gt;  

However, the machine index 0 is still assigned.

Am I doing wrong?

And is it possible to handle this also in the score calculator?


No comments:

Post a Comment