org.moyoman.module.bigpoint.simplebigpoint
Class SimpleBigPoint

java.lang.Object
  |
  +--org.moyoman.module.Module
        |
        +--org.moyoman.module.bigpoint.simplebigpoint.SimpleBigPoint
All Implemented Interfaces:
BigPoint, Cloneable, Component, ModuleInterface, Serializable

public class SimpleBigPoint
extends Module
implements BigPoint

This module generates bigpoints. These are points of high value in gote. For now this module only returns the hoshi points in the getBigpoints() method. The getMoves() returns an additional set of possible moves with a rating. These moves are near the hoshi an can be as valueable as the hoshi themselves or slightly less.

Author:
wimjan - wimjan@users.sourceforge.net
See Also:
Serialized Form

Field Summary
private static int boardSize
           
private  Set bp
          The bigpoint moves that were found by this module.
private static DebugType[] dt
          The debug types that this module supports.
private static Point[] hoshi
           
private  boolean isGenerated
           
private  ModuleType[] mt
          The modules that this module requires.
private  RatedMove[] rm
          The moves that were rated by this module.
 
Fields inherited from class org.moyoman.module.Module
 
Fields inherited from interface org.moyoman.module.bigpoint.BigPoint
CONFIDENCE
 
Constructor Summary
SimpleBigPoint(GameId id, ModuleName name)
           
 
Method Summary
private  ArrayList addRatedMovesForHoshi(Board b, Point point)
          Add moves near the hoshi point to the RatedMoves array.
private  RatedMove createRatedMove(Point pt, Board board, float rating)
          Create a RatedMove object from a point.
private  void fillHoshiPointArray()
          Get the hoshi points by their coordinates and put them into the hoshi 'member-array'
 void generateMove(Module[] modules)
          Generate the move for this module.
 Set getBigPoints()
          Get all of the big points on the board.
 Debug[] getDebugInformation(DebugType[] types)
          Return the debug information for this module.
 DebugType[] getDebugTypes()
          Return the types of debug information that this module supports.
 RatedMove[] getMoves()
          Get the, by getMoves(), generated list of RatedMoves
 ModuleType[] getRequiredModuleList()
          Return the modules that this module requires to perform its task.
private  void investigateHoshiPoints(Board b)
          Check all hoshi points to see if they are free still and if so add them to the set of BigPoints (bp), at the same time put the subHoshi that belongs to it in the set as well.
 boolean isBigPoint(Stone st)
          Determine if the stone would occupy a big point.
private  boolean isEmpty(Board board, int distance, Point pt)
          Determine if the specified area is empty.
 void makeMove(Move move, Module[] modules)
          Update the internal data structures of this module with the new move.
private  RatedMove[] toRatedMoveArray(ArrayList rated)
          creates a RatedMove array from an ArrayList of ratedMoves.
 
Methods inherited from class org.moyoman.module.Module
checkTime, clone, create, createHelper, debug, error, error, fatal, fatal, getAllHelpers, getHelper, getId, getKomi, getModule, getModuleName, getScheduler, information, setTime, warning, warning
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.moyoman.module.ModuleInterface
clone, getScheduler
 

Field Detail

dt

private static DebugType[] dt
The debug types that this module supports.


hoshi

private static Point[] hoshi

boardSize

private static int boardSize

mt

private ModuleType[] mt
The modules that this module requires.


rm

private RatedMove[] rm
The moves that were rated by this module.


bp

private Set bp
The bigpoint moves that were found by this module.


isGenerated

private boolean isGenerated
Constructor Detail

SimpleBigPoint

public SimpleBigPoint(GameId id,
                      ModuleName name)
               throws InternalErrorException
Parameters:
id -
name -
Throws:
InternalErrorException
Method Detail

fillHoshiPointArray

private void fillHoshiPointArray()
Get the hoshi points by their coordinates and put them into the hoshi 'member-array'


generateMove

public void generateMove(Module[] modules)
                  throws InternalErrorException
Generate the move for this module. The side effect of calling this method is that an array of RatedMove objects is stored which is returned by the getMoves() method.

Specified by:
generateMove in class Module
Parameters:
modules - An array of modules which this module needs in order to perform its work. Those modules reflect the current state of the board but are copies of the actual modules, so this method is free to manipulate them.
InternalErrorException

investigateHoshiPoints

private void investigateHoshiPoints(Board b)
Check all hoshi points to see if they are free still and if so add them to the set of BigPoints (bp), at the same time put the subHoshi that belongs to it in the set as well.

Parameters:
b - The actual board to check for empty points

toRatedMoveArray

private RatedMove[] toRatedMoveArray(ArrayList rated)
creates a RatedMove array from an ArrayList of ratedMoves.

Parameters:
rated -
Returns:

addRatedMovesForHoshi

private ArrayList addRatedMovesForHoshi(Board b,
                                        Point point)
Add moves near the hoshi point to the RatedMoves array. All corner points are created equally and have the same value as the hoshi. Points near the hoshi's on the side have a slightly higher value when on the 3rd line then on the 4th. The point right below the hoshi has the same value as the hoshi. Points near the centre hoshi are not rated. (dan-rated stuff)

Parameters:
point - the hoshi to consider

createRatedMove

private RatedMove createRatedMove(Point pt,
                                  Board board,
                                  float rating)
Create a RatedMove object from a point.

Parameters:
pt - The point to be made into a rated move.
board - The Board module.
rating - rating for this move.
Returns:
A RatedMove object for the given point.

getDebugInformation

public Debug[] getDebugInformation(DebugType[] types)
Return the debug information for this module.

Specified by:
getDebugInformation in class Module
Parameters:
types - Only return a subset of the debug types in this array.
Returns:
The debug information that this module supports.

getDebugTypes

public DebugType[] getDebugTypes()
Return the types of debug information that this module supports.

Specified by:
getDebugTypes in class Module
Returns:
The types of debug information that this module supports.

getMoves

public RatedMove[] getMoves()
Get the, by getMoves(), generated list of RatedMoves

Specified by:
getMoves in interface ModuleInterface
Specified by:
getMoves in class Module
Returns:
An array of RatedMove objects.

getRequiredModuleList

public ModuleType[] getRequiredModuleList()
Return the modules that this module requires to perform its task.

Specified by:
getRequiredModuleList in class Module
Returns:
An array of module types that the module requires.

makeMove

public void makeMove(Move move,
                     Module[] modules)
Update the internal data structures of this module with the new move. This module is stateless, so minimal work is done here.

Specified by:
makeMove in class Module
Parameters:
move - The move that was just made.
modules - The modules that this method needs to perform its job.

getBigPoints

public Set getBigPoints()
Description copied from interface: BigPoint
Get all of the big points on the board.

Specified by:
getBigPoints in interface BigPoint
Returns:
An array of Stone objects.

isEmpty

private boolean isEmpty(Board board,
                        int distance,
                        Point pt)
Determine if the specified area is empty.

Parameters:
board - The Board module.
distance - The number of rows and columns to check out from the point.
pt - The centre of the area to check.
Returns:
true if the area is empty or false.

isBigPoint

public boolean isBigPoint(Stone st)
Description copied from interface: BigPoint
Determine if the stone would occupy a big point.

Specified by:
isBigPoint in interface BigPoint
Parameters:
st - A Stone object.
Returns:
true if the stone would take a big point, or false.