org.drools.planner.core.move.generic
Class GenericSwapPillarMove

java.lang.Object
  extended by org.drools.planner.core.move.generic.GenericSwapPillarMove
All Implemented Interfaces:
TabuPropertyEnabled, Move

public class GenericSwapPillarMove
extends Object
implements Move, TabuPropertyEnabled

Non-cacheable


Constructor Summary
GenericSwapPillarMove(Collection<PlanningVariableDescriptor> planningVariableDescriptors, List<Object> leftPlanningEntityList, List<Object> rightPlanningEntityList)
           
 
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

GenericSwapPillarMove

public GenericSwapPillarMove(Collection<PlanningVariableDescriptor> planningVariableDescriptors,
                             List<Object> leftPlanningEntityList,
                             List<Object> rightPlanningEntityList)
Method Detail

isMoveDoable

public boolean isMoveDoable(org.drools.WorkingMemory workingMemory)
Description copied from interface: Move
Called before a move is evaluated to decide whether the move can be done and evaluated. A Move isn't doable if: Although you could filter out non-doable moves in for example the MoveFactory, this is not needed as the Solver will do it for you.

Specified by:
isMoveDoable in interface Move
Parameters:
workingMemory - the WorkingMemory not yet modified by the move.
Returns:
true if the move achieves a change in the solution and the move is possible to do on the solution.

createUndoMove

public Move createUndoMove(org.drools.WorkingMemory workingMemory)
Description copied from interface: Move
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.

Specified by:
createUndoMove in interface Move
Parameters:
workingMemory - the WorkingMemory not yet modified by the move.
Returns:
an undoMove which does the exact opposite of this move.

doMove

public void doMove(org.drools.WorkingMemory workingMemory)
Description copied from interface: Move
Does the Move and updates the Solution and its WorkingMemory accordingly. When the solution is modified, the WorkingMemory's FactHandles should be correctly notified, otherwise the score(s) calculated will be corrupted.

Specified by:
doMove in interface Move
Parameters:
workingMemory - never null, the WorkingMemory that needs to get notified of the changes.

getTabuProperties

public Collection<? extends Object> getTabuProperties()
Description copied from interface: TabuPropertyEnabled
The returned Collection should a stable order. For example: use List or LinkedHashSet, but not HashSet. Duplicates entries in the returned Collection are best avoided.

Specified by:
getTabuProperties in interface TabuPropertyEnabled
Returns:
never null

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2001-2011 JBoss by Red Hat. All Rights Reserved.