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 IBoard
The board (required for checking which piece is in a given position).protected String
The strategy.static final String
The strategy preferring jump moves of different colors.static final String
The strategy preferring jump moves, but ignoring colors.static final String
No strategy: try moves in order of appearance.static final String
The 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, wait
Methods 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:
compare
in interfaceComparator<Move>
- Returns:
- A negative number when the first move should come before the second.
-