Class GoMokuPatternsFile
- java.lang.Object
-
- com.barrybecker4.game.twoplayer.gomoku.pattern.Patterns
-
- com.barrybecker4.game.twoplayer.gomoku.pattern.GoMokuPatterns
-
- com.barrybecker4.game.twoplayer.gomoku.data.GoMokuPatternsFile
-
public class GoMokuPatternsFile extends GoMokuPatterns
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 inherited from class com.barrybecker4.game.twoplayer.gomoku.pattern.GoMokuPatterns
WIN_RUN_LENGTH
-
Fields inherited from class com.barrybecker4.game.twoplayer.gomoku.pattern.Patterns
UNOCCUPIED
-
-
Constructor Summary
Constructors Constructor Description GoMokuPatternsFile()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringgetExportFile()protected intgetNumPatterns()protected java.lang.StringgetPatternFile()protected java.lang.StringgetPatternString(int i)protected voidreadPatternFile()the pattern file is fixed for gomoku this method fills in pattern_ and weightTable_protected voidwritePatternFile()allow exporting the patterns and weight indices in a different format.-
Methods inherited from class com.barrybecker4.game.twoplayer.gomoku.pattern.GoMokuPatterns
getMinInterestingLength, getWeightIndex, getWinRunLength, main
-
Methods inherited from class com.barrybecker4.game.twoplayer.gomoku.pattern.Patterns
getWeightIndexForPattern, getWeightIndexForPattern, initializePatterns, setPatternWeightInTable
-
-
-
-
Method Detail
-
getNumPatterns
protected int getNumPatterns()
- Overrides:
getNumPatternsin classGoMokuPatterns- Returns:
- total number of patterns represented
-
getPatternString
protected java.lang.String getPatternString(int i)
- Overrides:
getPatternStringin classGoMokuPatterns
-
getPatternFile
protected java.lang.String getPatternFile()
-
getExportFile
protected java.lang.String getExportFile()
-
readPatternFile
protected void readPatternFile()
the pattern file is fixed for gomoku this method fills in pattern_ and weightTable_
-
writePatternFile
protected void writePatternFile()
allow exporting the patterns and weight indices in a different format. ordinarily we do not export the patterns, but sometimes we might want to change the format.
-
-