org.moyoman.module.territory
Interface Territory

All Superinterfaces:
Cloneable, ModuleInterface, Serializable

public interface Territory
extends ModuleInterface

Modules that implement this interface will perform the task of finding the location and size of territories during the course of a game. This includes tasks such as determining which points are in which territories, the likely size of a territory, moves which would enlarge or reduce territories, and the error in the estimation.


Field Summary
static SingleTerritory NO_TERRITORY
          A marker which indicates that there is no territory.
 
Method Summary
 float getFriendlyCount()
          Get the total amount of territory for the side to play.
 float getOpponentCount()
          Get the total amount of territory for the opponent of the side to play.
 SingleTerritory[] getSingleTerritories()
          Get all of the SingleTerritory objects.
 SingleTerritory[] getSingleTerritories(Stone stone)
          Get the SingleTerritory objects for this stone.
 SingleTerritory getSingleTerritory(Point point)
          Get the SingleTerritory object for which this empty point is part.
 
Methods inherited from interface org.moyoman.module.ModuleInterface
clone, getMoves, getScheduler
 

Field Detail

NO_TERRITORY

public static final SingleTerritory NO_TERRITORY
A marker which indicates that there is no territory.

Method Detail

getSingleTerritories

public SingleTerritory[] getSingleTerritories(Stone stone)
Get the SingleTerritory objects for this stone. If this stone is part of a set of stones which are surrounding one or more territories, then one SingleTerritory object is returned per territory which will have information on that territory. Otherwise, an array of length 0 is returned.

Parameters:
stone - The stone which is surrounding territory.
Returns:
An array of SingleTerritory objects representing the territories.

getSingleTerritory

public SingleTerritory getSingleTerritory(Point point)
Get the SingleTerritory object for which this empty point is part. If the empty point is considered to be territory, then the SingleTerritory object which contains it is returned. Otherwise, the NO_TERRITORY object is returned.

Parameters:
point - The point which is part of a territory.
Returns:
A SingleTerritory object representing the territory.

getSingleTerritories

public SingleTerritory[] getSingleTerritories()
Get all of the SingleTerritory objects. Any point on the board which is considered to be territory is contained in one and only one SingleTerritory object.

Returns:
An array of SingleTerritory objects.

getFriendlyCount

public float getFriendlyCount()
Get the total amount of territory for the side to play. Unless the game is in the late endgame, each point only has a probability of becoming territory which is why the count is a float instead of an int.

Returns:
A float which is the total amount of territory.

getOpponentCount

public float getOpponentCount()
Get the total amount of territory for the opponent of the side to play. Unless the game is in the late endgame, each point only has a probability of becoming territory which is why the count is a float instead of an int.

Returns:
A float which is the total amount of territory.