org.vizzini.game.boardgame
Class GridBoardEvaluatorTerminal

java.lang.Object
  extended by org.vizzini.util.tree.AbstractTreeNode
      extended by org.vizzini.ai.geneticprogramming.AbstractNode
          extended by org.vizzini.ai.geneticprogramming.terminal.AbstractTerminal
              extended by org.vizzini.game.boardgame.GridBoardEvaluatorTerminal
All Implemented Interfaces:
Cloneable, INode, ITerminal, ITreeNode, IVisitable

public class GridBoardEvaluatorTerminal
extends AbstractTerminal

Provides a genetic programming terminal to assist in evaluating a grid board.

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

Field Summary
static String AGENT_PROPERTY
          Agent property name.
static String GRID_BOARD_PROPERTY
          Grid board property name.
 
Constructor Summary
GridBoardEvaluatorTerminal()
          Construct this object with the given parameter.
GridBoardEvaluatorTerminal(IntegerPosition position)
          Construct this object with the given parameter.
 
Method Summary
 Object evaluate(IContext context)
          Evaluate this function.
 IntegerPosition getPosition()
           
 Class getReturnType()
          Return the type of the return value.
 int getX()
           
 int getY()
           
 int getZ()
           
protected  int multiplier(IToken token, IAgent agent)
          Return the multiplier for a token from the given agent's perspective.
 void setPosition(IntegerPosition position)
           
 void setX(int x)
           
 void setY(int y)
           
 void setZ(int z)
           
 
Methods inherited from class org.vizzini.ai.geneticprogramming.terminal.AbstractTerminal
toString
 
Methods inherited from class org.vizzini.ai.geneticprogramming.AbstractNode
createNewInstance, dotLabel, dotLinkDesc, equals, getName, hashCode, setName
 
Methods inherited from class org.vizzini.util.tree.AbstractTreeNode
acceptBreadthFirst, acceptDepthFirst, add, breadthFirstIterator, children, clone, createTreeNodeCollection, depthFirstIterator, dotDesc, fillCollectionBreadthFirst, fillCollectionChildren, fillCollectionDepthFirst, getBreadthFirstList, getChildAt, getChildCount, getChildren, getDepth, getDepthFirstList, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLevel, getNextSibling, getNodeCount, getParent, getPath, getRoot, getTreeNodeCollectionClass, getUserObject, insert, isChildAllowed, isLeaf, isRoot, remove, remove, removeAllChildren, removeFromParent, setChildAllowed, setChildren, setParent, setTreeNodeCollectionClass, setUserObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.vizzini.ai.geneticprogramming.INode
createNewInstance, getName, setName
 
Methods inherited from interface org.vizzini.util.tree.ITreeNode
add, breadthFirstIterator, children, clone, depthFirstIterator, getBreadthFirstList, getChildAt, getChildCount, getDepth, getDepthFirstList, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLevel, getNextSibling, getNodeCount, getParent, getPath, getRoot, getUserObject, insert, isChildAllowed, isLeaf, isRoot, remove, remove, removeAllChildren, removeFromParent, setChildAllowed, setParent, setUserObject
 
Methods inherited from interface org.vizzini.util.tree.IVisitable
acceptBreadthFirst, acceptDepthFirst
 

Field Detail

GRID_BOARD_PROPERTY

public static final String GRID_BOARD_PROPERTY
Grid board property name.

See Also:
Constant Field Values

AGENT_PROPERTY

public static final String AGENT_PROPERTY
Agent property name.

See Also:
Constant Field Values
Constructor Detail

GridBoardEvaluatorTerminal

public GridBoardEvaluatorTerminal()
Construct this object with the given parameter.

Since:
v0.3

GridBoardEvaluatorTerminal

public GridBoardEvaluatorTerminal(IntegerPosition position)
Construct this object with the given parameter.

Parameters:
position - Integer position.
Since:
v0.3
Method Detail

evaluate

public Object evaluate(IContext context)
Evaluate this function.

Parameters:
context - Context in which to evaluate.
Since:
v0.3

getPosition

public IntegerPosition getPosition()
Returns:
Return position.
Since:
v0.3

getReturnType

public Class getReturnType()
Return the type of the return value.

Since:
v0.3

getX

public int getX()
Returns:
Return x.
Since:
v0.3

getY

public int getY()
Returns:
Return y.
Since:
v0.3

getZ

public int getZ()
Returns:
Return z.
Since:
v0.3

setPosition

public void setPosition(IntegerPosition position)
Parameters:
position - the position to set
Since:
v0.3

setX

public void setX(int x)
Parameters:
x - the x to set
Since:
v0.3

setY

public void setY(int y)
Parameters:
y - the y to set
Since:
v0.3

setZ

public void setZ(int z)
Parameters:
z - the z to set
Since:
v0.3

multiplier

protected int multiplier(IToken token,
                         IAgent agent)
Return the multiplier for a token from the given agent's perspective.

Parameters:
token - The token.
agent - The agent.
Since:
v0.3


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02