org.vizzini.game.boardgame.chess
Class ChessAgentSupport

java.lang.Object
  extended by org.vizzini.game.boardgame.chess.ChessAgentSupport

public class ChessAgentSupport
extends Object

Provides support for chess computer agents.

Since:
v0.3
Version:
v0.3
Author:
Jeffrey M. Thompson

Method Summary
 IGridBoardAction createCastleAction(IChessAgent agent, IChessEnvironment environment, IntegerPosition kingFromPos, IntegerPosition kingToPos)
          Create a new castle action using the given parameters.
protected  IGridBoardAction createCastleAction(IChessAgent agent, IChessEnvironment environment, IntegerPosition kingFromPos, IntegerPosition rookFromPos, boolean isKingSide)
          Create a new castle agent action using the given parameters.
static ChessAgentSupport getInstance()
          Return the singleton instance.
 List getPossibleActions(IChessAgent agent, IChessEnvironment environment, IChessAdjudicator adjudicator)
          Return a list of possible agent actions.
 boolean isWhite(IChessAgent agent)
          Return true if this agent's team is white.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ChessAgentSupport getInstance()
Return the singleton instance.

Since:
v0.3

createCastleAction

public IGridBoardAction createCastleAction(IChessAgent agent,
                                           IChessEnvironment environment,
                                           IntegerPosition kingFromPos,
                                           IntegerPosition kingToPos)
Create a new castle action using the given parameters. The Rook's positions are inferred from the King's movement and information from the environment.

Parameters:
agent - The agent making the action.
environment - The current environment.
kingFromPos - The King's from position.
kingToPos - The King's to position.
Since:
v0.3

getPossibleActions

public List getPossibleActions(IChessAgent agent,
                               IChessEnvironment environment,
                               IChessAdjudicator adjudicator)
Return a list of possible agent actions.

Parameters:
environment - The current environment.
adjudicator - Adjudicator for determining legal actions.
Since:
v0.3

isWhite

public boolean isWhite(IChessAgent agent)
Return true if this agent's team is white.

Since:
v0.3

createCastleAction

protected IGridBoardAction createCastleAction(IChessAgent agent,
                                              IChessEnvironment environment,
                                              IntegerPosition kingFromPos,
                                              IntegerPosition rookFromPos,
                                              boolean isKingSide)
Create a new castle agent action using the given parameters. The King and Rook to positions are determined from information from the environment.

Parameters:
agent - The agent making the action.
environment - The current environment.
kingFromPos - The King's from position.
rookFromPos - The Rook's from position.
isKingSide - Flag indicating if this is a King's side move.
Since:
v0.3


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02