|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Move
A Move represents a change of 1 or more planning variables of 1 or more planning entities in the solution.
Usually the move holds a direct reference to each planning entity of the solution that it will change whendoMove(WorkingMemory)
is called.
On that change it should also notify the WorkingMemory
accordingly.
A Move should implement Object.equals(Object)
and Object.hashCode()
.
Method Summary | |
---|---|
Move |
createUndoMove(org.drools.WorkingMemory workingMemory)
Called before the move is done, so the move can be evaluated and then be undone without resulting into a permanent change in the solution. |
void |
doMove(org.drools.WorkingMemory workingMemory)
Does the Move and updates the Solution and its WorkingMemory accordingly. |
boolean |
isMoveDoable(org.drools.WorkingMemory workingMemory)
Called before a move is evaluated to decide whether the move can be done and evaluated. |
Method Detail |
---|
boolean isMoveDoable(org.drools.WorkingMemory workingMemory)
MoveFactory
,
this is not needed as the Solver
will do it for you.
workingMemory
- the WorkingMemory
not yet modified by the move.
Move createUndoMove(org.drools.WorkingMemory workingMemory)
workingMemory
- the WorkingMemory
not yet modified by the move.
void doMove(org.drools.WorkingMemory workingMemory)
Solution
and its WorkingMemory
accordingly.
When the solution is modified, the WorkingMemory
's FactHandle
s should be correctly notified,
otherwise the score(s) calculated will be corrupted.
workingMemory
- never null, the WorkingMemory
that needs to get notified of the changes.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |