kuhn

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: 5 Imported by: 0

Documentation

Overview

Package kuhn implements an extensive-form game tree for Kuhn Poker, adapted from: https://justinsermeno.com/posts/cfr/.

Index

Constants

View Source
const (
	Random = 'r'
	Check  = 'c'
	Bet    = 'b'
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action byte

type Card

type Card int
const (
	Jack Card = iota
	Queen
	King
)

func (Card) String

func (c Card) String() string

type PokerNode

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

PokerNode implements cfr.GameTreeNode for Kuhn Poker.

func NewGame

func NewGame() *PokerNode

func (*PokerNode) Close

func (k *PokerNode) Close()

Close implements cfr.GameTreeNode.

func (*PokerNode) GetChild

func (k *PokerNode) GetChild(i int) cfr.GameTreeNode

GetChild implements cfr.GameTreeNode.

func (*PokerNode) GetChildProbability

func (k *PokerNode) GetChildProbability(i int) float64

GetChildProbability implements cfr.GameTreeNode.

func (*PokerNode) InfoSet

func (k *PokerNode) InfoSet(player int) cfr.InfoSet

InfoSet implements cfr.GameTreeNode.

func (*PokerNode) InfoSetKey

func (k *PokerNode) InfoSetKey(player int) []byte

func (*PokerNode) IsTerminal

func (k *PokerNode) IsTerminal() bool

func (*PokerNode) NumChildren

func (k *PokerNode) NumChildren() int

NumChildren implements cfr.GameTreeNode.

func (*PokerNode) Parent

func (k *PokerNode) Parent() cfr.GameTreeNode

Parent implements cfr.GameTreeNode.

func (*PokerNode) Player

func (k *PokerNode) Player() int

Player implements cfr.GameTreeNode.

func (*PokerNode) SampleChild

func (k *PokerNode) SampleChild() (cfr.GameTreeNode, float64)

SampleChild implements cfr.GameTreeNode.

func (PokerNode) String

func (k PokerNode) String() string

String implements fmt.Stringer.

func (*PokerNode) Type

func (k *PokerNode) Type() cfr.NodeType

Type implements cfr.GameTreeNode.

func (*PokerNode) Utility

func (k *PokerNode) Utility(player int) float64

Utility implements cfr.GameTreeNode.

Jump to

Keyboard shortcuts

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