Documentation ¶
Overview ¶
Package montecarlo implements truncated monte-carlo search during the regular game. In other words, "simming".
Index ¶
- type LogIteration
- type LogPlay
- type SimmedPlay
- type Simmer
- func (s *Simmer) EquityStats() string
- func (s *Simmer) Init(game *game.Game, aiplayer player.AIPlayer)
- func (s *Simmer) IsSimming() bool
- func (s *Simmer) Iterations() int
- func (s *Simmer) PrepareSim(plies int, plays []*move.Move) error
- func (s *Simmer) Ready() bool
- func (s *Simmer) Reset()
- func (s *Simmer) ScoreDetails() string
- func (s *Simmer) SetLogStream(l io.Writer)
- func (s *Simmer) SetThreads(threads int)
- func (s *Simmer) Simulate(ctx context.Context) error
- func (s *Simmer) TrimBottom(totrim int) error
- type Statistic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogIteration ¶
type LogIteration struct { Iteration int `json:"iteration" yaml:"iteration"` Plays []LogPlay `json:"plays" yaml:"plays"` Thread int `json:"thread" yaml:"thread"` }
LogIteration is a struct meant for serializing to a log-file, for debug and other purposes.
type LogPlay ¶
type LogPlay struct { Play string `json:"play" yaml:"play"` Rack string `json:"rack" yaml:"rack"` Pts int `json:"pts" yaml:"pts"` // Leftover is the equity of the leftover tiles at the end of the sim. Leftover float64 `json:"left,omitempty" yaml:"left,omitempty"` // Although this is a recursive structure we don't really use it // recursively. Plies []LogPlay `json:"plies,omitempty" yaml:"plies,omitempty,flow"` }
LogPlay is a single play.
type SimmedPlay ¶
func (*SimmedPlay) String ¶
func (sp *SimmedPlay) String() string
type Simmer ¶
type Simmer struct {
// contains filtered or unexported fields
}
Simmer implements the actual look-ahead search
func (*Simmer) EquityStats ¶
func (*Simmer) Iterations ¶
func (*Simmer) PrepareSim ¶
PrepareSim resets all the stats before a simulation.
func (*Simmer) ScoreDetails ¶
func (*Simmer) SetLogStream ¶
func (*Simmer) SetThreads ¶
func (*Simmer) TrimBottom ¶
Click to show internal directories.
Click to hide internal directories.