Documentation ¶
Index ¶
- Constants
- Variables
- type DebugTableEntry
- type DebugTranspositionTable
- type FakeLock
- type PVLine
- type Solver
- func (s *Solver) Game() *game.Game
- func (s *Solver) Init(m movegen.MoveGenerator, game *game.Game) error
- func (s *Solver) IsSolving() bool
- func (s *Solver) Movegen() movegen.MoveGenerator
- func (s *Solver) QuickAndDirtySolve(ctx context.Context, plies, thread int) (int16, []*move.Move, error)
- func (s *Solver) SetFirstWinOptim(w bool)
- func (s *Solver) SetIterativeDeepening(id bool)
- func (s *Solver) SetLogStream(l io.Writer)
- func (s *Solver) SetNegascoutOptim(n bool)
- func (s *Solver) SetPreventSlowroll(p bool)
- func (s *Solver) SetSolveMultipleVariations(i int)
- func (s *Solver) SetThreads(threads int)
- func (s *Solver) SetTranspositionTableOptim(tt bool)
- func (s *Solver) ShortDetails() string
- func (s *Solver) Solve(ctx context.Context, plies int) (int16, []*move.Move, error)
- func (s *Solver) Variations() []PVLine
- type TableEntry
- type TableLock
- type TranspositionTable
- func (t *TranspositionTable) Reset(fractionOfMemory float64, boardDim int)
- func (t *TranspositionTable) SetMultiThreadedMode()
- func (t *TranspositionTable) SetSingleThreadedMode()
- func (t *TranspositionTable) SetZobrist(z *zobrist.Zobrist)
- func (t *TranspositionTable) Stats() string
- func (t *TranspositionTable) Zobrist() *zobrist.Zobrist
Constants ¶
View Source
const ( EarlyPassBF = 1 << 13 HashMoveBF = 1 << 12 GoingOutBF = 1 << 11 // Moves that score more than 256 pts in the endgame may have some // sorting issues. Can probably fix this later. TilesPlayedBFOffset = 8 )
Bitflags for move estimates.
View Source
const ( TTExact = 0x01 TTLower = 0x02 TTUpper = 0x03 )
View Source
const HugeNumber = int16(32000)
View Source
const MaxLazySMPThreads = 10
View Source
const MaxVariantLength = 25
Variables ¶
View Source
var (
ErrNoEndgameSolution = errors.New("no endgame solution found")
)
View Source
var GlobalTranspositionTable = &TranspositionTable{}
GlobalTranspositionTable is a singleton instance. Since transposition tables take up a large enough amount of memory, and they're meant to be shared, we only really want to keep one in memory to avoid re-allocation costs.
Functions ¶
This section is empty.
Types ¶
type DebugTableEntry ¶
type DebugTableEntry struct {
// contains filtered or unexported fields
}
type DebugTranspositionTable ¶
type DebugTranspositionTable struct {
// contains filtered or unexported fields
}
type PVLine ¶
type PVLine struct { Moves [MaxVariantLength]*move.Move // contains filtered or unexported fields }
Credit: MIT-licensed https://github.com/algerbrex/blunder/blob/main/engine/search.go
type Solver ¶
type Solver struct {
// contains filtered or unexported fields
}
func (*Solver) Movegen ¶ added in v0.8.7
func (s *Solver) Movegen() movegen.MoveGenerator
func (*Solver) QuickAndDirtySolve ¶
func (s *Solver) QuickAndDirtySolve(ctx context.Context, plies, thread int) (int16, []*move.Move, error)
QuickAndDirtySolve is meant for a pre-endgame engine to call this function without having to initialize everything. The caller is responsible for initializations of data structures. It is single-threaded as well.
func (*Solver) SetFirstWinOptim ¶
func (*Solver) SetIterativeDeepening ¶
func (*Solver) SetLogStream ¶ added in v0.9.0
SetLogStream only prints coherent logs for single-threaded endgames for now.
func (*Solver) SetNegascoutOptim ¶ added in v0.9.0
func (*Solver) SetPreventSlowroll ¶ added in v0.9.4
func (*Solver) SetSolveMultipleVariations ¶ added in v0.9.4
func (*Solver) SetThreads ¶
func (*Solver) SetTranspositionTableOptim ¶
func (*Solver) ShortDetails ¶ added in v0.9.3
func (*Solver) Variations ¶ added in v0.9.4
type TableEntry ¶
type TableEntry struct {
// contains filtered or unexported fields
}
16 bytes (entrySize)
type TranspositionTable ¶
type TranspositionTable struct {
// contains filtered or unexported fields
}
func (*TranspositionTable) Reset ¶
func (t *TranspositionTable) Reset(fractionOfMemory float64, boardDim int)
func (*TranspositionTable) SetMultiThreadedMode ¶
func (t *TranspositionTable) SetMultiThreadedMode()
func (*TranspositionTable) SetSingleThreadedMode ¶
func (t *TranspositionTable) SetSingleThreadedMode()
func (*TranspositionTable) SetZobrist ¶ added in v0.8.3
func (t *TranspositionTable) SetZobrist(z *zobrist.Zobrist)
func (*TranspositionTable) Stats ¶ added in v0.9.0
func (t *TranspositionTable) Stats() string
func (*TranspositionTable) Zobrist ¶ added in v0.8.3
func (t *TranspositionTable) Zobrist() *zobrist.Zobrist
Click to show internal directories.
Click to hide internal directories.