knockabout.search
Class SimpleHeuristic

java.lang.Object
  extended byknockabout.search.SimpleHeuristic
All Implemented Interfaces:
Heuristic

public class SimpleHeuristic
extends java.lang.Object
implements Heuristic

This is the basic heuristic used for my first tests.


Constructor Summary
SimpleHeuristic()
           
 
Method Summary
 float computeHeuristic(GameState state)
          Returns a float that is proportional to the difference of the sum of the values of all the dies that are not in the gutter for each team.
static int sumValues(java.util.List diesNotInGutter)
          Utility function sum the curVals on the dies in the set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleHeuristic

public SimpleHeuristic()
Method Detail

computeHeuristic

public float computeHeuristic(GameState state)
Returns a float that is proportional to the difference of the sum of the values of all the dies that are not in the gutter for each team.

Specified by:
computeHeuristic in interface Heuristic
Parameters:
state - A knockabout state
Returns:
Returns a float between 1 and -1. Higher value should correspond to states favor the max player.

sumValues

public static int sumValues(java.util.List diesNotInGutter)
Utility function sum the curVals on the dies in the set