Documentation ¶
Index ¶
- Constants
- func LeaveCacheLoadFunc(cfg *config.Config, key string) (interface{}, error)
- func PEGCacheLoadFunc(cfg *config.Config, key string) (interface{}, error)
- func WinPCTLoadFunc(cfg *config.Config, key string) (interface{}, error)
- type BlankLeaves
- type CombinedStaticCalculator
- type EndgameAdjustmentCalculator
- type EquityCalculator
- type ExhaustiveLeaveCalculator
- type Leaves
- type NoLeaveCalculator
- type OldLeaves
- type OpeningAdjustmentCalculator
- type PreEndgameAdjustmentCalculator
Constants ¶
const ( LeaveFilename = "leaves.olv" PEGAdjustmentFilename = "preendgame.json" )
const MaxRepresentedWinSpread = 300
Variables ¶
This section is empty.
Functions ¶
func LeaveCacheLoadFunc ¶
Types ¶
type BlankLeaves ¶
type BlankLeaves struct{}
func (*BlankLeaves) LeaveValue ¶
func (b *BlankLeaves) LeaveValue(leave alphabet.MachineWord) float64
type CombinedStaticCalculator ¶
type CombinedStaticCalculator struct {
// contains filtered or unexported fields
}
CombinedStaticCalculator is a redundant struct that combines the function of several calculators. It is only here for speed purposes.
func (CombinedStaticCalculator) LeaveValue ¶
func (csc CombinedStaticCalculator) LeaveValue(leave alphabet.MachineWord) float64
type EndgameAdjustmentCalculator ¶
type EndgameAdjustmentCalculator struct{}
EndgameAdjustmentCalculator returns an equity adjustment for endgame plays. It should only be used if the bag is empty. Note that it doesn't solve the endgame; this should only be used for simulation estimates!
type EquityCalculator ¶
type EquityCalculator 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 }
EquityCalculator is a calculator of equity.
type ExhaustiveLeaveCalculator ¶
type ExhaustiveLeaveCalculator struct {
// contains filtered or unexported fields
}
ExhaustiveLeaveCalculator should apply an equity calculation for all leaves exhaustively.
func (ExhaustiveLeaveCalculator) LeaveValue ¶
func (els ExhaustiveLeaveCalculator) LeaveValue(leave alphabet.MachineWord) float64
type Leaves ¶
type Leaves interface {
LeaveValue(leave alphabet.MachineWord) float64
}
type NoLeaveCalculator ¶
type NoLeaveCalculator struct{}
NoLeaveCalculator does not take leave into account at all.
func NewNoLeaveCalculator ¶
func NewNoLeaveCalculator() *NoLeaveCalculator
func (*NoLeaveCalculator) LeaveValue ¶
func (nls *NoLeaveCalculator) LeaveValue(leave alphabet.MachineWord) float64
type OldLeaves ¶
type OldLeaves struct {
// contains filtered or unexported fields
}
func (*OldLeaves) LeaveValue ¶
func (olv *OldLeaves) LeaveValue(leave alphabet.MachineWord) float64
type OpeningAdjustmentCalculator ¶
type OpeningAdjustmentCalculator struct{}
OpeningAdjustmentCalculator returns an equity adjustment for an opening play. It should only be used if the board is empty.
type PreEndgameAdjustmentCalculator ¶
type PreEndgameAdjustmentCalculator struct {
// contains filtered or unexported fields
}
PreEndgameAdjustmentCalculator returns an equity adjustment for preendgame plays. It should only be used if the bag is nearly empty. Note that it doesn't solve pre-endgames; this should only be used for simulation estimates!