Class GoMokuPatterns
- java.lang.Object
-
- com.barrybecker4.game.twoplayer.gomoku.pattern.Patterns
-
- com.barrybecker4.game.twoplayer.gomoku.pattern.GoMokuPatterns
-
- Direct Known Subclasses:
GoMokuPatternsFile
public class GoMokuPatterns extends Patterns
Encapsulates the domain knowledge for GoMoku. Its primary client is the GoMokuController class. These are key patterns that can occur in the game and are weighted by importance to let the computer play better.
-
-
Field Summary
Fields Modifier and Type Field Description static intWIN_RUN_LENGTH-
Fields inherited from class com.barrybecker4.game.twoplayer.gomoku.pattern.Patterns
UNOCCUPIED
-
-
Constructor Summary
Constructors Constructor Description GoMokuPatterns()Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetMinInterestingLength()protected intgetNumPatterns()protected java.lang.StringgetPatternString(int i)protected intgetWeightIndex(int i)intgetWinRunLength()This is how many in a row are needed to win if M is five then the game is gomokustatic voidmain(java.lang.String[] args)-
Methods inherited from class com.barrybecker4.game.twoplayer.gomoku.pattern.Patterns
getWeightIndexForPattern, getWeightIndexForPattern, initializePatterns, setPatternWeightInTable
-
-
-
-
Field Detail
-
WIN_RUN_LENGTH
public static final int WIN_RUN_LENGTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
getWinRunLength
public int getWinRunLength()
This is how many in a row are needed to win if M is five then the game is gomoku- Specified by:
getWinRunLengthin classPatterns- Returns:
- how many in a row are needed to win. If M is five then the game is gomoku
-
getMinInterestingLength
public int getMinInterestingLength()
- Specified by:
getMinInterestingLengthin classPatterns- Returns:
- patterns shorter than this are not interesting and have weight 0
-
getNumPatterns
protected int getNumPatterns()
- Specified by:
getNumPatternsin classPatterns- Returns:
- total number of patterns represented
-
getPatternString
protected java.lang.String getPatternString(int i)
- Specified by:
getPatternStringin classPatterns
-
getWeightIndex
protected int getWeightIndex(int i)
- Specified by:
getWeightIndexin classPatterns
-
main
public static void main(java.lang.String[] args)
-
-