org.moyoman.module.connection
Interface Connection

All Superinterfaces:
Cloneable, ModuleInterface, Serializable

public interface Connection
extends ModuleInterface

The class that implements this interface is concerned with the connection and splitting of groups. This is a low level module, so it is just concerned with whether groups can be connected or split on a tactical level. It is not concerned with whether this weakens other groups, whether the connected group can live, or other higher level considerations.


Field Summary
static float CONFIDENCE
           
 
Method Summary
 boolean areGroupsConnected(SingleGroup sg1, SingleGroup sg2)
          Determine if the two groups are connected.
 boolean areGroupsConnected(SingleLooseGroup slg1, SingleLooseGroup slg2)
          Determine if the two loose groups are be connected.
 boolean canGroupsConnect(SingleGroup sg1, SingleGroup sg2)
          Determine if the two groups can be connected.
 boolean canGroupsConnect(SingleLooseGroup slg1, SingleLooseGroup slg2)
          Determine if the two loose groups can be connected.
 boolean canSplitGroups(SingleGroup sg1, SingleGroup sg2)
          Determine if the two groups can be split.
 boolean canSplitGroups(SingleLooseGroup slg1, SingleLooseGroup slg2)
          Determine if the two loose groups can be split.
 MoveDescriptorForest connectGroups(SingleGroup sg1, SingleGroup sg2)
          Determine the sequence of moves to connect the two groups.
 MoveDescriptorForest connectGroups(SingleLooseGroup slg1, SingleLooseGroup slg2)
          Determine the sequence of moves to connect the two groups.
 SingleGroup[] getConnectedGroups(SingleGroup sg)
          Get the groups which are connected to the group in question.
 SingleLooseGroup[] getConnectedGroups(SingleLooseGroup slg)
          Get the loose groups which are connected to the loose group in question.
 MoveDescriptorForest splitGroups(SingleGroup sg1, SingleGroup sg2)
          Determine the sequence of moves for splitting the two groups.
 MoveDescriptorForest splitGroups(SingleLooseGroup slg1, SingleLooseGroup slg2)
          Determine the sequence of moves for splitting the two loose groups.
 
Methods inherited from interface org.moyoman.module.ModuleInterface
clone, getMoves, getScheduler
 

Field Detail

CONFIDENCE

public static final float CONFIDENCE
See Also:
Constant Field Values
Method Detail

areGroupsConnected

public boolean areGroupsConnected(SingleGroup sg1,
                                  SingleGroup sg2)
                           throws IllegalArgumentException
Determine if the two groups are connected. This returns true if the opponent gets the first move, but the two groups can still connect.

Parameters:
sg1 - The first group.
sg2 - The second group.
Returns:
true if the two groups can be connected, or false.
Throws:
IllegalArgumentException - Thrown if the two groups are not the same color.

areGroupsConnected

public boolean areGroupsConnected(SingleLooseGroup slg1,
                                  SingleLooseGroup slg2)
                           throws IllegalArgumentException
Determine if the two loose groups are be connected. This returns true if the opponent gets the first move, but the two groups can still connect.

Parameters:
slg1 - The first loose group.
slg2 - The second loose group.
Returns:
true if the two loose groups can be connected, or false.
Throws:
IllegalArgumentException - Thrown if the two groups are not the same color.

canGroupsConnect

public boolean canGroupsConnect(SingleGroup sg1,
                                SingleGroup sg2)
                         throws IllegalArgumentException
Determine if the two groups can be connected. This returns true if the player with the two groups moves first, and can connect them.

Parameters:
sg1 - The first group.
sg2 - The second group.
Returns:
true if the two groups can be connected, or false.
Throws:
IllegalArgumentException - Thrown if the two groups are not the same color.

canGroupsConnect

public boolean canGroupsConnect(SingleLooseGroup slg1,
                                SingleLooseGroup slg2)
                         throws IllegalArgumentException
Determine if the two loose groups can be connected. This returns true if the player with the two groups moves first, and can connect them.

Parameters:
slg1 - The first loose group.
slg2 - The second loose group.
Returns:
true if the two loose groups can be connected, or false.
Throws:
IllegalArgumentException - Thrown if the two groups are not the same color.

connectGroups

public MoveDescriptorForest connectGroups(SingleGroup sg1,
                                          SingleGroup sg2)
                                   throws IllegalArgumentException
Determine the sequence of moves to connect the two groups.

Parameters:
sg1 - The first group.
sg2 - The second group.
Returns:
A MoveDescriptorForest object, which contains sequences for connecting the groups.
Throws:
IllegalArgumentException - Thrown if the two groups are not the same color, or it is not the case that canGroupsConnect(sg1, sg2) is true and areGroupsConnected(sg1, sg2) is false.

connectGroups

public MoveDescriptorForest connectGroups(SingleLooseGroup slg1,
                                          SingleLooseGroup slg2)
                                   throws IllegalArgumentException
Determine the sequence of moves to connect the two groups.

Parameters:
slg1 - The first loose group.
slg2 - The second loose group.
Returns:
A MoveDescriptorForest object, which contains sequences for connecting the groups.
Throws:
IllegalArgumentException - Thrown if the two groups are not the same color, or it is not the case that canGroupsConnect(slg1, slg2) is true and areGroupsConnected(slg1, slg2) is false.

getConnectedGroups

public SingleGroup[] getConnectedGroups(SingleGroup sg)
Get the groups which are connected to the group in question.

Parameters:
sg - The group in question.
Returns:
An array of SingleGroup objects which are connected to this group.

getConnectedGroups

public SingleLooseGroup[] getConnectedGroups(SingleLooseGroup slg)
Get the loose groups which are connected to the loose group in question.

Parameters:
slg - The loose group in question.
Returns:
An array of SingleLooseGroup objects which are connected to this loose group.

canSplitGroups

public boolean canSplitGroups(SingleGroup sg1,
                              SingleGroup sg2)
                       throws IllegalArgumentException
Determine if the two groups can be split. The opponent gets the first move in this sequence.

Parameters:
sg1 - The first group.
sg2 - The second group.
Returns:
true if the groups can be split, or false.
Throws:
IllegalArgumentException - Thrown if the two groups are not the same color.

canSplitGroups

public boolean canSplitGroups(SingleLooseGroup slg1,
                              SingleLooseGroup slg2)
                       throws IllegalArgumentException
Determine if the two loose groups can be split. The opponent gets the first move in this sequence.

Parameters:
slg1 - The first loose group.
slg2 - The second loose group.
Returns:
true if the loose groups can be split, or false.
Throws:
IllegalArgumentException - Thrown if the two groups are not the same color.

splitGroups

public MoveDescriptorForest splitGroups(SingleGroup sg1,
                                        SingleGroup sg2)
                                 throws IllegalArgumentException
Determine the sequence of moves for splitting the two groups. The opponent gets the first move in this sequence.

Parameters:
sg1 - The first group.
sg2 - The second group.
Returns:
true if the groups can be split, or false.
Throws:
IllegalArgumentException - Thrown if the two groups are not the same color, or if canSplitGroups(sg1, sg2) returns false.

splitGroups

public MoveDescriptorForest splitGroups(SingleLooseGroup slg1,
                                        SingleLooseGroup slg2)
                                 throws IllegalArgumentException
Determine the sequence of moves for splitting the two loose groups. The opponent gets the first move in this sequence.

Parameters:
slg1 - The first loose group.
slg2 - The second loose group.
Returns:
true if the loose groups can be split, or false.
Throws:
IllegalArgumentException - Thrown if the two loose groups are not the same color, or if canSplitGroups(slg1, slg2) returns false.