strategy

package
v0.4.4-alpha Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LeaveFilename = "leaves.idx.gz"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ExhaustiveLeaveStrategy

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

ExhaustiveLeaveStrategy should apply an equity calculation for all leaves exhaustively.

func NewExhaustiveLeaveStrategy added in v0.2.11

func NewExhaustiveLeaveStrategy(lexiconName string,
	alph *alphabet.Alphabet, strategyDir, leavefile string) (*ExhaustiveLeaveStrategy, error)

func (ExhaustiveLeaveStrategy) Equity added in v0.2.11

func (els ExhaustiveLeaveStrategy) Equity(play *move.Move, board *board.GameBoard,
	bag *alphabet.Bag, oppRack *alphabet.Rack) float64

func (*ExhaustiveLeaveStrategy) Init added in v0.2.11

func (els *ExhaustiveLeaveStrategy) Init(lexiconName string, alph *alphabet.Alphabet,
	strategyDir, leavefile string) error

func (ExhaustiveLeaveStrategy) LeaveValue added in v0.4.0

func (els ExhaustiveLeaveStrategy) LeaveValue(leave alphabet.MachineWord) float64

type NoLeaveStrategy

type NoLeaveStrategy struct{}

NoLeaveStrategy does not take leave into account at all.

func NewNoLeaveStrategy added in v0.4.2

func NewNoLeaveStrategy() *NoLeaveStrategy

func (*NoLeaveStrategy) Equity

func (nls *NoLeaveStrategy) Equity(play *move.Move, board *board.GameBoard,
	bag *alphabet.Bag, oppRack *alphabet.Rack) float64

func (*NoLeaveStrategy) LeaveValue added in v0.4.0

func (nls *NoLeaveStrategy) LeaveValue(leave alphabet.MachineWord) float64

type Strategizer

type Strategizer interface {
	// Equity is a catch-all term for most post-score adjustments that
	// need to be made. It includes first-turn placement heuristic,
	// leave calculations, any pre-endgame timing heuristics, and more.
	Equity(play *move.Move, board *board.GameBoard, bag *alphabet.Bag,
		oppRack *alphabet.Rack) float64

	LeaveValue(leave alphabet.MachineWord) float64
}

Strategizer is in charge of picking plays using strategy.

Jump to

Keyboard shortcuts

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