Optaplanner SwapMove filter in Cheap Time -


i working on new planning problem , using cheap time testing. want add filter handle hard score constraint. in cases, machine cannot assigned - @ all.

i added filter swapmove filter:

public class taskassignmentfilter implements selectionfilter<swapmove> {  public boolean accept(scoredirector scoredirector, swapmove move) { taskassignment task1 = (taskassignment)move.getleftentity();     taskassignment task2 = (taskassignment)move.getrightentity();      if (task1.getmachine().getindex() == 0 || task2.getmachine().getindex() == 0)         return false;      return true; } 

}

and added config

<swapmoveselector>     <filterclass>….taskassignmentfilter</filterclass> </swapmoveselector> 

however, machine index 0 still assigned.

any hint doing wrong?

and possible handle constraint in score calculator also?


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -