Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.drools.planner.core.move
Class CompositeMove

    java.lang.Object
      org.drools.planner.core.move.CompositeMove

All Implemented Interfaces:
  TabuPropertyEnabled, Move

    public class CompositeMove

extends Object
implements Move, TabuPropertyEnabled

A CompositeMove is composed out of multiple other moves.

Warning: one of the moveList moves should not rely on the effect on of a previous moveList move to create an uncorrupted undoMove. In other words,

See Also:
  `Move`

Field Summary
`protected List<Move>` | `moveList`

Constructor Summary
`CompositeMove(List<Move> moveList)`

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)`
`List<Move>` | `getMoveList()`
`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 wheter the move can be done and evaluated.
`String` | `toString()`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### moveList

    protected List<Move> moveList

Constructor Detail

### CompositeMove

    public CompositeMove(List<Move> moveList)

Parameters:
  `moveList` - cannot be null

Method Detail

### getMoveList

    public List<Move> getMoveList()

### isMoveDoable

    public boolean isMoveDoable(org.drools.WorkingMemory workingMemory)

  Description copied from interface: `Move`
  Called before a move is evaluated to decide wheter the move can be done and evaluated. A Move isn't doable if:
  - Either doing it would change nothing in the solution.
  - Either it's simply not possible to do.
  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 `FactHandle`s should be correctly notified, otherwise the score(s) calculated will be corrupted.

  Specified by:
    `doMove` in interface `Move`
  Parameters:
    `workingMemory` - 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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2011 JBoss Inc.. All Rights Reserved.