rangefinder

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2025 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// If the player found a play within this limit, then count the rack
	// for inferences. Multiply by 100 to visualize as percentage.
	InferenceWinProbLimit = 0.035
	// NextTurnScoreBoostLimit - if the player scores more than this many
	// points on average next turn, boost those inferred racks.
	// XXX: We may want this to be per-lexicon / per-variant / etc.
	NextTurnScoreBoostLimit = 45
)

Variables

View Source
var ErrBagEmpty = errors.New("bag is empty")
View Source
var ErrMoveTypeNotSupported = errors.New("opponent move type not suitable for inference")
View Source
var ErrNoEvents = errors.New("no events")
View Source
var ErrNoInformation = errors.New("not enough information to infer")

Functions

This section is empty.

Types

type Inference added in v0.10.2

type Inference struct {
	RackLength    int
	InferredRacks weightedRacks
}

func NewInference added in v0.10.2

func NewInference() *Inference

type LogIteration

type LogIteration struct {
	Iteration      int     `json:"iteration" yaml:"iteration"`
	Thread         int     `json:"thread" yaml:"thread"`
	Rack           string  `json:"rack" yaml:"rack"`
	TopMoveWinProb float64 `json:"topMoveWinProb" yaml:"topMoveWinProb"`
	TopMove        string  `json:"topMove" yaml:"topMove"`
	// InferredMoveWinProb is the win prob of the move we are inferring, given
	// that they drew "Rack"
	InferredMoveWinProb float64 `json:"inferredMoveWinProb" yaml:"inferredMoveWinProb"`
	PossibleRack        bool    `json:"possibleRack" yaml:"possibleRack"`
	NormalizedWinProb   float64 `json:"normalizedWinProb" yaml:"normalizedWinProb"`
	SimLogFile          string  `json:"simLogFile,omitempty" yaml:"simLogFile,omitempty"`
}

type RangeFinder

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

func (*RangeFinder) AnalyzeInferences

func (r *RangeFinder) AnalyzeInferences(detailed bool) string

func (*RangeFinder) Infer

func (r *RangeFinder) Infer(ctx context.Context) error

func (*RangeFinder) Inferences

func (r *RangeFinder) Inferences() *Inference

func (*RangeFinder) Init

func (r *RangeFinder) Init(game *game.Game, eqCalcs []equity.EquityCalculator,
	cfg *config.Config)

func (*RangeFinder) IsBusy added in v0.8.6

func (r *RangeFinder) IsBusy() bool

func (*RangeFinder) PrepareFinder

func (r *RangeFinder) PrepareFinder(myRack []tilemapping.MachineLetter) error

func (*RangeFinder) Reset

func (r *RangeFinder) Reset()

func (*RangeFinder) SetLogStream

func (r *RangeFinder) SetLogStream(l io.Writer)

func (*RangeFinder) SetThreads

func (r *RangeFinder) SetThreads(t int)

Jump to

Keyboard shortcuts

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