net.sf.colossus.ai
Class RationalAI.MoveFinder
java.lang.Object
net.sf.colossus.ai.RationalAI.MoveFinder
- Enclosing class:
- RationalAI
private class RationalAI.MoveFinder
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
bestMove
private java.util.List<RationalAI.LegionBoardMove> bestMove
bestScore
private double bestScore
mustMove
private boolean mustMove
nodesExplored
private long nodesExplored
INITIAL_SCORE
private static final double INITIAL_SCORE
- See Also:
- Constant Field Values
NO_MOVE_EXISTS
private static final double NO_MOVE_EXISTS
- See Also:
- Constant Field Values
RationalAI.MoveFinder
private RationalAI.MoveFinder()
findOptimalMove
public java.util.List<RationalAI.LegionBoardMove> findOptimalMove(java.util.List<java.util.List<RationalAI.LegionBoardMove>> all_legionMoves,
boolean mustMove)
moveValueBound
private double moveValueBound(java.util.List<java.util.List<RationalAI.LegionBoardMove>> availableMoves)
getValidMove
private java.util.List<RationalAI.LegionBoardMove> getValidMove(java.util.List<RationalAI.LegionBoardMove> performedMoves)
- checks if a move is valid, and if so returns the moves in
an executeable sequence. The legios not moving are not part
of bestMove. Returns null if the move is not valid.
- Parameters:
performedMoves
-
- Returns:
branchAndBound
private void branchAndBound(java.util.List<RationalAI.LegionBoardMove> performedMoves,
java.util.List<java.util.List<RationalAI.LegionBoardMove>> availableMoves,
double currentValue)
checkNewCycle
private boolean checkNewCycle(MasterHex target,
MasterHex from,
java.util.List<RationalAI.LegionBoardMove> moves)
- checkes if there is a path from 'from' to target, using
the moves in the list. This is used to see if there are cycles
in the moves, when you ad a move from 'target' to 'from'
- Parameters:
target
- from
- moves
-
- Returns:
removeHeadAndConflicts
private java.util.List<java.util.List<RationalAI.LegionBoardMove>> removeHeadAndConflicts(java.util.List<java.util.List<RationalAI.LegionBoardMove>> availableMoves,
RationalAI.LegionBoardMove lm)