mcts

package
v0.0.0-...-2c859fb Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: GPL-3.0 Imports: 8 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Evaluator

type Evaluator interface {
	Evaluate(rng *rand.Rand, node cfr.GameTreeNode, opponent Policy) (policy []float32, value float32)
}

type OneSidedISMCTS

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

Implements one-sided IS-MCTS. The opponent will always use the provided policy to select actions.

func NewOneSidedISMCTS

func NewOneSidedISMCTS(player int, evaluator Evaluator, c, temperature float32) *OneSidedISMCTS

func (*OneSidedISMCTS) GetPolicy

func (s *OneSidedISMCTS) GetPolicy(node cfr.GameTreeNode) []float32

func (*OneSidedISMCTS) Run

func (s *OneSidedISMCTS) Run(rng *rand.Rand, node cfr.GameTreeNode, opponent Policy) float32

type Policy

type Policy interface {
	GetPolicy(node cfr.GameTreeNode) []float32
}

type RandomRollout

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

func NewRandomRollout

func NewRandomRollout(nRollouts int) *RandomRollout

func (*RandomRollout) Evaluate

func (rr *RandomRollout) Evaluate(rng *rand.Rand, node cfr.GameTreeNode, opponent Policy) (policy []float32, value float32)

type SmoothUCT

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

Implements Smooth UCT.

func NewSmoothUCT

func NewSmoothUCT(c, gamma, eta, d, temperature float32) *SmoothUCT

func (*SmoothUCT) GetPolicy

func (s *SmoothUCT) GetPolicy(node cfr.GameTreeNode) []float32

func (*SmoothUCT) GetVisitCount

func (s *SmoothUCT) GetVisitCount(node cfr.GameTreeNode) int

func (*SmoothUCT) GobDecode

func (s *SmoothUCT) GobDecode(buf []byte) error

func (*SmoothUCT) GobEncode

func (s *SmoothUCT) GobEncode() ([]byte, error)

func (*SmoothUCT) Run

func (s *SmoothUCT) Run(rng *rand.Rand, node cfr.GameTreeNode) float32

Jump to

Keyboard shortcuts

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