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 KLV
- type Leaves
- type NoLeaveCalculator
- type OldLeaves
- type OpeningAdjustmentCalculator
- type PreEndgameAdjustmentCalculator
Constants ¶
const ( PEGAdjustmentFilename = "preendgame.json" LeavesFilename = "leaves.klv2" )
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 tilemapping.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) Equity ¶
func (csc CombinedStaticCalculator) Equity(play *move.Move, board *board.GameBoard, bag *tilemapping.Bag, oppRack *tilemapping.Rack) float64
func (CombinedStaticCalculator) LeaveValue ¶
func (csc CombinedStaticCalculator) LeaveValue(leave tilemapping.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!
func (EndgameAdjustmentCalculator) Equity ¶
func (eac EndgameAdjustmentCalculator) Equity(play *move.Move, board *board.GameBoard, bag *tilemapping.Bag, oppRack *tilemapping.Rack) float64
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 *tilemapping.Bag, oppRack *tilemapping.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) Equity ¶
func (els ExhaustiveLeaveCalculator) Equity(play *move.Move, board *board.GameBoard, bag *tilemapping.Bag, oppRack *tilemapping.Rack) float64
func (ExhaustiveLeaveCalculator) LeaveValue ¶
func (els ExhaustiveLeaveCalculator) LeaveValue(leave tilemapping.MachineWord) float64
type KLV ¶ added in v0.6.0
type KLV struct {
// contains filtered or unexported fields
}
KLV is a Kurnia Leave Value file. It contains a KWG and a list of float32 leave values. We convert to float64 for our internal structures.
func (*KLV) LeaveValue ¶ added in v0.6.0
func (k *KLV) LeaveValue(leave tilemapping.MachineWord) float64
type Leaves ¶
type Leaves interface {
LeaveValue(leave tilemapping.MachineWord) float64
}
type NoLeaveCalculator ¶
type NoLeaveCalculator struct{}
NoLeaveCalculator does not take leave into account at all.
func NewNoLeaveCalculator ¶
func NewNoLeaveCalculator() *NoLeaveCalculator
func (*NoLeaveCalculator) Equity ¶
func (nls *NoLeaveCalculator) Equity(play *move.Move, board *board.GameBoard, bag *tilemapping.Bag, oppRack *tilemapping.Rack) float64
func (*NoLeaveCalculator) LeaveValue ¶
func (nls *NoLeaveCalculator) LeaveValue(leave tilemapping.MachineWord) float64
type OldLeaves ¶
type OldLeaves struct {
// contains filtered or unexported fields
}
func (*OldLeaves) LeaveValue ¶
func (olv *OldLeaves) LeaveValue(leave tilemapping.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.
func (OpeningAdjustmentCalculator) Equity ¶
func (oac OpeningAdjustmentCalculator) Equity(play *move.Move, board *board.GameBoard, bag *tilemapping.Bag, oppRack *tilemapping.Rack) float64
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!
func (PreEndgameAdjustmentCalculator) Equity ¶
func (pac PreEndgameAdjustmentCalculator) Equity(play *move.Move, board *board.GameBoard, bag *tilemapping.Bag, oppRack *tilemapping.Rack) float64