edu.columbia.cs.coms4701.agent.environments.pente
Class PenteAgent

java.lang.Object
  extended by edu.columbia.cs.coms4701.agent.environments.simple.SimpleEnvironmentObject
      extended by edu.columbia.cs.coms4701.agent.environments.simple.SimpleAgent<PenteAction,PentePercept>
          extended by edu.columbia.cs.coms4701.agent.environments.pente.PenteAgent
All Implemented Interfaces:
Agent<PenteAction,PentePercept>, EnvironmentObject

public class PenteAgent
extends SimpleAgent<PenteAction,PentePercept>
implements Agent<PenteAction,PentePercept>

A Pente game-playing agent. Each agent is assigned a turn number (0,1,2,3), indicating its position in the turn-taking. Player zero plays first and uses black stones; player one plays second and uses white stones, etc.

Version:
0.1

User: aaron Date: Sep 24, 2006 Time: 5:07:16 PM

Author:
aaron@cs

Field Summary
static Stone.StoneColor[] COLORS
          Player colors, in order by turn number.
 
Fields inherited from class edu.columbia.cs.coms4701.agent.environments.simple.SimpleEnvironmentObject
changeSupport
 
Constructor Summary
PenteAgent()
           
 
Method Summary
 Stone.StoneColor getColor()
          Returns the color for this player, which is determined by the turn number.
 int getMaximumSearchDepth()
          Returns the maximum search depth for this player.
 int getNumberOfCaptures()
          Indicates how many captures this agent has achieved.
 int getNumberOfTimeLimitViolations()
          Returns how many times this player has violated the soft time limit
 java.lang.String getRuleViolation()
           
 int getTurnNumber()
          Gets the turn number assigned to this agent.
 boolean getViolatedARule()
           
 void incrementNumberOfCaptures()
          Increment the capture counter
 void incrementNumberOfTimeLimitViolations()
           
 boolean isGotStonesInARow()
          Returns whether this player has gotten enough stones in a row to win.
 void setGotStonesInARow(boolean gotStonesInARow)
          Setter for recording the fact that an agent has won by putting stones in a row.
 void setMaxSearchDepth(int maxSearchDepth)
          Setter for max search depth.
 void setNumberOfTimeLimitViolations(int newNumber)
           
 void setRuleViolation(java.lang.String ruleViolation)
           
 void setTurnNumber(int theTurnNumber)
          Setter for turn number.
 void setViolatedARule(boolean violatedARule, java.lang.String ruleName)
           
 
Methods inherited from class edu.columbia.cs.coms4701.agent.environments.simple.SimpleAgent
getAgentProgram, getAuthor, getDescription, getPerformanceMeasure, nextAction, setAgentProgram, setPerformanceMeasure, toString
 
Methods inherited from class edu.columbia.cs.coms4701.agent.environments.simple.SimpleEnvironmentObject
addPropertyChangeListener, isAlive, removePropertyChangeListener, setAlive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.columbia.cs.coms4701.agent.Agent
getAgentProgram, getAuthor, getDescription, getPerformanceMeasure, nextAction, setAgentProgram, setPerformanceMeasure
 
Methods inherited from interface edu.columbia.cs.coms4701.agent.EnvironmentObject
addPropertyChangeListener, isAlive, removePropertyChangeListener, setAlive
 

Field Detail

COLORS

public static final Stone.StoneColor[] COLORS
Player colors, in order by turn number.

Constructor Detail

PenteAgent

public PenteAgent()
Method Detail

getNumberOfCaptures

public int getNumberOfCaptures()
Indicates how many captures this agent has achieved.

Returns:
the number of captured pairs

incrementNumberOfCaptures

public void incrementNumberOfCaptures()
Increment the capture counter


getTurnNumber

public int getTurnNumber()
Gets the turn number assigned to this agent.

Returns:
integer between 0 and (number of players - 1)

setTurnNumber

public void setTurnNumber(int theTurnNumber)
Setter for turn number.


getMaximumSearchDepth

public int getMaximumSearchDepth()
Returns the maximum search depth for this player.

Returns:
the cutoff depth

setMaxSearchDepth

public void setMaxSearchDepth(int maxSearchDepth)
Setter for max search depth.

Parameters:
maxSearchDepth -

getColor

public Stone.StoneColor getColor()
Returns the color for this player, which is determined by the turn number.

Returns:
the stone color used by this player.

isGotStonesInARow

public boolean isGotStonesInARow()
Returns whether this player has gotten enough stones in a row to win.

Returns:
false, until the very end of the game!

setGotStonesInARow

public void setGotStonesInARow(boolean gotStonesInARow)
Setter for recording the fact that an agent has won by putting stones in a row.

Parameters:
gotStonesInARow -

getNumberOfTimeLimitViolations

public int getNumberOfTimeLimitViolations()
Returns how many times this player has violated the soft time limit

Returns:

incrementNumberOfTimeLimitViolations

public void incrementNumberOfTimeLimitViolations()

setNumberOfTimeLimitViolations

public void setNumberOfTimeLimitViolations(int newNumber)

getViolatedARule

public boolean getViolatedARule()

setViolatedARule

public void setViolatedARule(boolean violatedARule,
                             java.lang.String ruleName)

getRuleViolation

public java.lang.String getRuleViolation()

setRuleViolation

public void setRuleViolation(java.lang.String ruleViolation)