Documentation
¶
Index ¶
Constants ¶
View Source
const BOARD_SIZE int = 8
BOARD_SIZE size of the board to attempt to solve
Variables ¶
View Source
var SENTINEL = struct{}{}
Functions ¶
Types ¶
type Board ¶
type Board [BOARD_SIZE][BOARD_SIZE]*cell
Board a fully inflated board to be worked on
func (*Board) GetCoverageLevel ¶
GetCoverageLevel reports how many of the cells on the board are covered
func (*Board) ProposeBoards ¶
func (b *Board) ProposeBoards(heuristic func(board *Board) (float32, error)) (MinimalBoardSet, error)
ProposeBoards is used to calculate all the potential boards that could be reached from a given board. It is where the algorithm spends most of its time, and any additional early pruning techniques would benefit it greatly
type MinimalBoard ¶
type MinimalBoard struct {
Heuristic float32
IsSolved bool
Score int
Coverage int
// contains filtered or unexported fields
}
MinimalBoard the representation used to store boards that are not actively being worked on
func (MinimalBoard) RebuildBoard ¶
func (m MinimalBoard) RebuildBoard() (*Board, error)
RebuildBoard re-inflates a MinimalBoard, and rebuilds the support graph
func (MinimalBoard) String ¶
func (m MinimalBoard) String() string
type MinimalBoardSet ¶
type MinimalBoardSet map[MinimalBoard]struct{}
MinimalBoardSet a map wrapper for tracking sets of boards
func (MinimalBoardSet) Contains ¶
func (m MinimalBoardSet) Contains(board MinimalBoard) bool
func (MinimalBoardSet) Put ¶
func (m MinimalBoardSet) Put(board MinimalBoard)
Click to show internal directories.
Click to hide internal directories.