org.moyoman.module.lifeanddeath
Interface LifeAndDeath

All Superinterfaces:
Cloneable, ModuleInterface, Serializable

public interface LifeAndDeath
extends ModuleInterface

Any class which implements this interface will be performing a life and death analysis for each loose group on the board. Unlike life and death problems in books, a life and death module for a Go playing program must deal with a much broader class of problems. Some of the issues which must be addressed are:

This is a low level module. In determining the status of a group, the consequences of this play on other groups is not considered. So, factors such as splitting attacks or weakening nearby groups are not considered. This type of analysis is left to higher level modules.


Field Summary
static short LARGE_NUMBER
          This value is returned by methods such as numberOfMoveToKill() if the group can't be killed.
 
Method Summary
 Stone[] findKoThreatsToBreakContainment(SingleLooseGroup slg)
          Find all moves that threaten to break out of containment.
 Stone[] findKoThreatsToContain(SingleLooseGroup slg)
          Find all moves that threaten to contain the group on the next move.
 Stone[] findKoThreatsToKill(SingleLooseGroup slg)
          Find all moves that threaten to kill the group on the next move.
 Stone[] findKoThreatsToLive(SingleLooseGroup slg)
          Find all moves that threaten to make the group live on the next move.
 MoveDescriptorForest getSequences(SingleLooseGroup slg)
          Get possible sequences of play For attack, the sequence could threaten to contain or kill, while for defense, the sequence could threaten to break out or make life.
 LDStatus getStatusIfContained(SingleLooseGroup slg)
          Determine the status of the group if additional enemy stones were present to contain it.
 short numberOfMovesToContain(SingleLooseGroup slg)
          Get the number of moves to contain the group.
 short numberOfMovesToKill(SingleLooseGroup slg)
          Get the number of moves to kill the group.
 short numberOfMovesToLive(SingleLooseGroup slg)
          Get the number of moves to live.
 float safety(SingleLooseGroup slg)
          Rate the safety of the group.
 LDStatus status(SingleLooseGroup slg)
          Return an LDStatus object which describes the life and death status of the group in question.
 
Methods inherited from interface org.moyoman.module.ModuleInterface
clone, getMoves, getScheduler
 

Field Detail

LARGE_NUMBER

public static final short LARGE_NUMBER
This value is returned by methods such as numberOfMoveToKill() if the group can't be killed.

See Also:
Constant Field Values
Method Detail

status

public LDStatus status(SingleLooseGroup slg)
Return an LDStatus object which describes the life and death status of the group in question.

Returns:
An LDStatus object.

getSequences

public MoveDescriptorForest getSequences(SingleLooseGroup slg)
Get possible sequences of play For attack, the sequence could threaten to contain or kill, while for defense, the sequence could threaten to break out or make life.

Parameters:
slg - The loose group in question.
Returns:
A MoveDescriptorForest object describing sequences of play.

numberOfMovesToKill

public short numberOfMovesToKill(SingleLooseGroup slg)
Get the number of moves to kill the group.

Parameters:
slg - The loose group in question.
Returns:
A short which is the number of moves to kill, or LARGE_NUMBER if the group can't be killed.

numberOfMovesToLive

public short numberOfMovesToLive(SingleLooseGroup slg)
Get the number of moves to live.

Parameters:
slg - The loose group in question.
Returns:
A short which is the number of moves to live, or LARGE_NUMBER if the group cannot be made to live.

numberOfMovesToContain

public short numberOfMovesToContain(SingleLooseGroup slg)
Get the number of moves to contain the group.

Returns:
A short which is the number of moves to contain the group.

findKoThreatsToKill

public Stone[] findKoThreatsToKill(SingleLooseGroup slg)
Find all moves that threaten to kill the group on the next move.

Parameters:
slg - The loose group in question.
Returns:
An array of Stone objects.

findKoThreatsToLive

public Stone[] findKoThreatsToLive(SingleLooseGroup slg)
Find all moves that threaten to make the group live on the next move.

Parameters:
slg - The loose group in question.
Returns:
An array of Stone objects.

findKoThreatsToContain

public Stone[] findKoThreatsToContain(SingleLooseGroup slg)
Find all moves that threaten to contain the group on the next move. It is not implied that containing the group automatically kills it.

Parameters:
slg - The loose group in question.
Returns:
An array of Stone objects.

findKoThreatsToBreakContainment

public Stone[] findKoThreatsToBreakContainment(SingleLooseGroup slg)
Find all moves that threaten to break out of containment.

Parameters:
slg - The loose group in question.
Returns:
An array of Stone objects.

getStatusIfContained

public LDStatus getStatusIfContained(SingleLooseGroup slg)
Determine the status of the group if additional enemy stones were present to contain it. If the group is already contained, then this method returns the same value as status().

Parameters:
slg - The loose group in question.
Returns:
An LDStatus object for the contained group.

safety

public float safety(SingleLooseGroup slg)
Rate the safety of the group. This method is most important for uncontained or undetermined groups. It does not take higher level considerations into account to determine who will win a ko.

Parameters:
slg - The loose group in question.
Returns:
A float in the range of 0.0 to 1.0.