|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.drools.planner.core.move.generic.GenericSwapMove
public class GenericSwapMove
Constructor Summary | |
---|---|
GenericSwapMove(Collection<PlanningVariableDescriptor> planningVariableDescriptors,
Object leftPlanningEntity,
org.drools.FactHandle leftPlanningEntityFactHandle,
Object rightPlanningEntity,
org.drools.FactHandle rightPlanningEntityFactHandle)
|
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 |
equals(Object o)
|
Collection<? extends Object> |
getTabuProperties()
The returned Collection should a stable order. |
int |
hashCode()
|
boolean |
isMoveDoable(org.drools.WorkingMemory workingMemory)
Called before a move is evaluated to decide whether the move can be done and evaluated. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GenericSwapMove(Collection<PlanningVariableDescriptor> planningVariableDescriptors, Object leftPlanningEntity, org.drools.FactHandle leftPlanningEntityFactHandle, Object rightPlanningEntity, org.drools.FactHandle rightPlanningEntityFactHandle)
Method Detail |
---|
public boolean isMoveDoable(org.drools.WorkingMemory workingMemory)
Move
MoveFactory
,
this is not needed as the Solver
will do it for you.
isMoveDoable
in interface Move
workingMemory
- the WorkingMemory
not yet modified by the move.
public Move createUndoMove(org.drools.WorkingMemory workingMemory)
Move
createUndoMove
in interface Move
workingMemory
- the WorkingMemory
not yet modified by the move.
public void doMove(org.drools.WorkingMemory workingMemory)
Move
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.
doMove
in interface Move
workingMemory
- never null, the WorkingMemory
that needs to get notified of the changes.public Collection<? extends Object> getTabuProperties()
TabuPropertyEnabled
List
or LinkedHashSet
, but not HashSet
.
Duplicates entries in the returned Collection are best avoided.
getTabuProperties
in interface TabuPropertyEnabled
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |