org.vizzini.game.boardgame
Class WeightedEvaluator

java.lang.Object
  extended by org.vizzini.game.AbstractEvaluator
      extended by org.vizzini.game.DefaultEvaluator
          extended by org.vizzini.game.boardgame.WeightedEvaluator
All Implemented Interfaces:
Serializable, IEvaluator

public class WeightedEvaluator
extends DefaultEvaluator

Provides an evaluator which uses position-based weights and token values to arrive at a grid board evaluation.

Since:
v0.1
Version:
v0.3
Author:
Jeffrey M. Thompson
See Also:
Serialized Form

Constructor Summary
WeightedEvaluator()
           
 
Method Summary
 void configure(Properties properties, int index)
          Configure this evaluator.
protected  int evaluateTokens(IEnvironment environment, IAgent agent)
          Evaluate the tokens in the given environment from the perspective of the given agent.
protected  int getWeight(IntegerPosition position, int fileCount, int rankCount)
          Return the weight for the given grid position.
 int[] getWeights()
          Return the weights.
 void setWeights(int[] weights)
          Set the weights.
 String toString()
          Return a string representation of this object.
 
Methods inherited from class org.vizzini.game.AbstractEvaluator
evaluate, multiplier
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WeightedEvaluator

public WeightedEvaluator()
Method Detail

configure

public void configure(Properties properties,
                      int index)
Configure this evaluator.

Specified by:
configure in interface IEvaluator
Overrides:
configure in class DefaultEvaluator
Parameters:
properties - Properties.
index - Agent index.
Since:
v0.1

getWeights

public int[] getWeights()
Return the weights.

Since:
v0.2

setWeights

public void setWeights(int[] weights)
Set the weights.

Since:
v0.2

toString

public String toString()
Return a string representation of this object.

Overrides:
toString in class Object
Since:
v0.2

evaluateTokens

protected int evaluateTokens(IEnvironment environment,
                             IAgent agent)
Evaluate the tokens in the given environment from the perspective of the given agent.

Overrides:
evaluateTokens in class DefaultEvaluator
Parameters:
environment - The environment to evaluate.
agent - The agent of interest.
Since:
v0.1

getWeight

protected int getWeight(IntegerPosition position,
                        int fileCount,
                        int rankCount)
Return the weight for the given grid position.

Parameters:
position - Position.
fileCount - File count.
rankCount - Rank count.
Since:
v0.1


Copyright © 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02