Documentation
¶
Overview ¶
Package alphabeta implements an endgame solver using depth-limited minimax with alpha-beta pruning.
Index ¶
- Constants
- type GameNode
- type Solver
- func (s *Solver) Init(movegen movegen.MoveGenerator, game *mechanics.XWordGame)
- func (s *Solver) RootNode() *GameNode
- func (s *Solver) SetIterativeDeepening(i bool)
- func (s *Solver) SetPruningDisabled(i bool)
- func (s *Solver) SetSimpleEvaluator(i bool)
- func (s *Solver) Solve(plies int) (float32, []*move.Move)
Constants ¶
View Source
const ( // Infinity is 10 million. Infinity = 10000000 // TwoPlyOppSearchLimit is how many plays to consider for opponent // for the evaluation function. TwoPlyOppSearchLimit = 30 // FutureAdjustment potentially weighs the value of future points // less than present points, to allow for the possibility of being // blocked. We just make it 1 because our 2-ply evaluation function // is reasonably accurate. FutureAdjustment = float32(1) )
View Source
const PerTurnPenalty = float32(0.001)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GameNode ¶ added in v0.3.0
type GameNode struct {
// contains filtered or unexported fields
}
a game node has to have enough information to allow the game and turns to be reconstructed.
func (*GameNode) GeneratedPlays ¶ added in v0.3.0
type Solver ¶
type Solver struct {
// contains filtered or unexported fields
}
Solver implements the minimax + alphabeta algorithm.
func (*Solver) Init ¶
func (s *Solver) Init(movegen movegen.MoveGenerator, game *mechanics.XWordGame)
Init initializes the solver
func (*Solver) SetIterativeDeepening ¶
func (*Solver) SetPruningDisabled ¶ added in v0.3.0
func (*Solver) SetSimpleEvaluator ¶
Click to show internal directories.
Click to hide internal directories.