generic_solver

package
v0.0.0-...-a9017b9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EndingCache

type EndingCache struct {
	// contains filtered or unexported fields
}

func NewEndingCache

func NewEndingCache(boardW int, boardH int) *EndingCache

func (*EndingCache) ClearCache

func (s *EndingCache) ClearCache(depth uint)

func (*EndingCache) DepthCaches

func (s *EndingCache) DepthCaches() []map[uint64]common.Player

func (*EndingCache) DepthSize

func (s *EndingCache) DepthSize(depth uint) int

func (*EndingCache) Get

func (s *EndingCache) Get(board *common.Board, depth uint) (ending common.Player, ok bool)

func (*EndingCache) MaxCachedDepth

func (s *EndingCache) MaxCachedDepth() uint

func (*EndingCache) Put

func (s *EndingCache) Put(board *common.Board, depth uint, ending common.Player) common.Player

func (*EndingCache) SetEntry

func (s *EndingCache) SetEntry(depth int, key uint64, value common.Player)

func (*EndingCache) Size

func (s *EndingCache) Size() uint64

type MoveSolver

type MoveSolver struct {
	W int
	H int
	// contains filtered or unexported fields
}

func NewMoveSolver

func NewMoveSolver(board *common.Board) *MoveSolver

func (*MoveSolver) Cache

func (s *MoveSolver) Cache() common.ICache

func (*MoveSolver) HasPlayerWon

func (s *MoveSolver) HasPlayerWon(board *common.Board, move int, y int, player common.Player) bool

func (*MoveSolver) Interrupt

func (s *MoveSolver) Interrupt()

func (*MoveSolver) MovesEndings

func (s *MoveSolver) MovesEndings(board *common.Board) (endings []common.Player)

func (*MoveSolver) ReportStatus

func (s *MoveSolver) ReportStatus(
	board *common.Board,
	progress float64,
)

func (*MoveSolver) Retrain

func (s *MoveSolver) Retrain(board *common.Board, maxDepth uint)

func (*MoveSolver) SummaryVars

func (s *MoveSolver) SummaryVars() log.Ctx

type Referee

type Referee struct {
	// contains filtered or unexported fields
}

func NewReferee

func NewReferee(board *common.Board) *Referee

func (*Referee) HasPlayerWon

func (s *Referee) HasPlayerWon(board *common.Board, move int, y int, player common.Player) bool

func (*Referee) HasPlayerWonDiagonal

func (s *Referee) HasPlayerWonDiagonal(board *common.Board, x int, y int, player common.Player) bool

func (*Referee) HasPlayerWonHorizontal

func (s *Referee) HasPlayerWonHorizontal(board *common.Board, y int, player common.Player) bool

func (*Referee) HasPlayerWonVertical

func (s *Referee) HasPlayerWonVertical(board *common.Board, move int, player common.Player) bool

func (*Referee) HasWinner

func (s *Referee) HasWinner(board *common.Board) common.Player

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL