|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vizzini.game.AbstractEvaluator
org.vizzini.game.DefaultEvaluator
org.vizzini.game.boardgame.TokenLineEvaluator
public class TokenLineEvaluator
Provides an evaluator which uses line features, weights and token values to arrive at a grid board evaluation. The environment is evaluated for the number of tokens in all the lines: one in a row, two in a row, etc. These counts are then weighted and summed.
Constructor Summary | |
---|---|
TokenLineEvaluator()
|
Method Summary | |
---|---|
protected int |
addToEvaluation(int evaluation,
IGridBoard gridBoard,
IAgent agent,
IAgent opponent,
int startF,
int startR,
int startL,
int df,
int dr,
int dl)
Add to the given evaluation based on the other parameters. |
protected int |
addToEvaluation(int evaluation,
IGridBoard gridBoard,
IAgent agent,
int multiplier,
int startF,
int startR,
int startL,
int df,
int dr,
int dl)
Add to the given evaluation based on the other parameters. |
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. |
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 |
---|
public TokenLineEvaluator()
Method Detail |
---|
public void configure(Properties properties, int index)
configure
in interface IEvaluator
configure
in class DefaultEvaluator
properties
- Properties.index
- Agent index.public int[] getWeights()
public void setWeights(int[] weights)
public String toString()
toString
in class Object
protected int addToEvaluation(int evaluation, IGridBoard gridBoard, IAgent agent, IAgent opponent, int startF, int startR, int startL, int df, int dr, int dl)
evaluation
- Previous evaluation.gridBoard
- Grid board.agent
- Agent.opponent
- Opponent of agent.startF
- Start file.startR
- Start rank.startL
- Start level.df
- Delta file.dr
- Delta rank.dl
- Delta level.
protected int addToEvaluation(int evaluation, IGridBoard gridBoard, IAgent agent, int multiplier, int startF, int startR, int startL, int df, int dr, int dl)
evaluation
- gridBoard
- Grid board.agent
- Agent.multiplier
- Multiplier for the weight; +1 for agent, -1 for
opponent.startF
- Start file.startR
- Start rank.startL
- Start level.df
- Delta file.dr
- Delta rank.dl
- Delta level.
protected int evaluateTokens(IEnvironment environment, IAgent agent)
evaluateTokens
in class DefaultEvaluator
environment
- The environment to evaluate.agent
- The agent of interest.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |