Package jadex.bdi.puzzle
Class MoveComparator
java.lang.Object
jadex.bdi.puzzle.MoveComparator
- All Implemented Interfaces:
Comparator<Move>
Sort moves according to a strategy.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IBoardThe board (required for checking which piece is in a given position).protected StringThe strategy.static final StringThe strategy preferring jump moves of different colors.static final StringThe strategy preferring jump moves, but ignoring colors.static final StringNo strategy: try moves in order of appearance.static final StringThe strategy preferring jump moves of same color. -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
STRATEGY_NONE
No strategy: try moves in order of appearance.- See Also:
-
STRATEGY_LONG
The strategy preferring jump moves, but ignoring colors.- See Also:
-
STRATEGY_SAME_LONG
The strategy preferring jump moves of same color.- See Also:
-
STRATEGY_ALTER_LONG
The strategy preferring jump moves of different colors.- See Also:
-
board
The board (required for checking which piece is in a given position). -
strategy
The strategy.
-
-
Constructor Details
-
MoveComparator
Create a move comparator.
-
-
Method Details
-
compare
Compare two moves.- Specified by:
comparein interfaceComparator<Move>- Returns:
- A negative number when the first move should come before the second.
-