Documentation ¶
Index ¶
- Constants
- func CountDistinctShuffles(deck cards.Set) int
- func EnumerateDealsWithP0Hand(deck, p0Deal cards.Set, cb func(d Deal))
- func EnumerateDealsWithP1Hand(deck, p1Hand cards.Set, cb func(d Deal))
- func EnumerateInitialDeals(deck cards.Set, cardsPerPlayer int, cb func(d Deal))
- func EnumerateShuffles(deck cards.Set, cb func(shuffle cards.Stack))
- type AbstractedInfoSet
- type BeliefState
- type Deal
- type GameNode
- func (gn *GameNode) Clone() *GameNode
- func (gn *GameNode) CloneWithState(state gamestate.GameState) *GameNode
- func (gn *GameNode) Close()
- func (gn *GameNode) Depth() int
- func (gn *GameNode) GetChild(i int) cfr.GameTreeNode
- func (gn *GameNode) GetChildProbability(i int) float64
- func (gn *GameNode) GetDrawPile() cards.Stack
- func (gn *GameNode) GetHistory() gamestate.History
- func (gn *GameNode) GetInfoSet(player gamestate.Player) gamestate.InfoSet
- func (gn *GameNode) GetState() gamestate.GameState
- func (gn *GameNode) InfoSet(player int) cfr.InfoSet
- func (gn *GameNode) InfoSetKey(player int) []byte
- func (gn *GameNode) LastAction() gamestate.Action
- func (gn *GameNode) NumChildren() int
- func (gn *GameNode) Parent() cfr.GameTreeNode
- func (gn *GameNode) Player() int
- func (gn *GameNode) SampleChild() (cfr.GameTreeNode, float64)
- func (gn *GameNode) String() string
- func (gn *GameNode) Type() cfr.NodeType
- func (gn *GameNode) Utility(player int) float64
- type InfoSetWithAvailableActions
Constants ¶
const ( PlayTurn turnType GiveCard ShuffleDrawPile MustDefuse InsertKittenRandom GameOver )
Variables ¶
This section is empty.
Functions ¶
func CountDistinctShuffles ¶
func EnumerateInitialDeals ¶
Types ¶
type AbstractedInfoSet ¶
type AbstractedInfoSet struct { Player gamestate.Player PublicHistory gamestate.History Hand cards.Set P0PlayedCards cards.Set P1PlayedCards cards.Set DrawPile cards.Stack AvailableActions []gamestate.Action }
AbstractedInfoSet abstracts away private history. The main difference in this abstraction is that the exact ordering in which private cards were received in the history is neglected. A second difference is that cards known to be in the draw pile (but not known where) are forgotten. This can happen if a SeeTheFuture card is played followed by a shuffle.
func (*AbstractedInfoSet) Key ¶
func (is *AbstractedInfoSet) Key() []byte
Key implements cfr.InfoSet.
func (*AbstractedInfoSet) MarshalBinary ¶
func (is *AbstractedInfoSet) MarshalBinary() ([]byte, error)
func (AbstractedInfoSet) String ¶
func (a AbstractedInfoSet) String() string
func (*AbstractedInfoSet) UnmarshalBinary ¶
func (is *AbstractedInfoSet) UnmarshalBinary(buf []byte) error
type BeliefState ¶
type BeliefState struct {
// contains filtered or unexported fields
}
BeliefState holds the distribution of probabilities over underlying game states as perceived from the point of view of one player.
func NewBeliefState ¶
func NewBeliefState(opponentPolicy func(cfr.GameTreeNode) []float32, infoSet gamestate.InfoSet) *BeliefState
Return all game states consistent with the given initial hand. Note that the passed hand should include the Defuse card.
func (*BeliefState) Clone ¶
func (bs *BeliefState) Clone() *BeliefState
func (*BeliefState) Len ¶
func (bs *BeliefState) Len() int
func (*BeliefState) Less ¶
func (bs *BeliefState) Less(i, j int) bool
func (*BeliefState) SampleDeterminization ¶
func (bs *BeliefState) SampleDeterminization() *GameNode
func (*BeliefState) Swap ¶
func (bs *BeliefState) Swap(i, j int)
func (*BeliefState) Update ¶
func (bs *BeliefState) Update(infoSet gamestate.InfoSet)
Update belief state by propagating all current states forward, expanding determinizations as necessary and filtering to those that match the given new info set.
type GameNode ¶
type GameNode struct {
// contains filtered or unexported fields
}
GameNode implements cfr.GameTreeNode for Exploding Kittens. GameNode represents a state of play in the extensive-form game tree.
func NewGame ¶
NewGame creates a root node for a new game with the given draw pile and hands dealt to each player.
func (*GameNode) CloneWithState ¶
func (*GameNode) GetChildProbability ¶
GetChildProbability implements cfr.GameTreeNode.
func (*GameNode) GetDrawPile ¶
func (*GameNode) GetHistory ¶
func (*GameNode) GetInfoSet ¶
func (*GameNode) InfoSetKey ¶
func (*GameNode) LastAction ¶
func (*GameNode) NumChildren ¶
func (*GameNode) SampleChild ¶
SampleChild implements cfr.GameTreeNode.
type InfoSetWithAvailableActions ¶
func (*InfoSetWithAvailableActions) MarshalBinary ¶
func (is *InfoSetWithAvailableActions) MarshalBinary() ([]byte, error)
func (*InfoSetWithAvailableActions) UnmarshalBinary ¶
func (is *InfoSetWithAvailableActions) UnmarshalBinary(buf []byte) error
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
alphacats
This version of alphacats uses one-sided IS-MCTS with a NN to guide search, in a PSRO framework.
|
This version of alphacats uses one-sided IS-MCTS with a NN to guide search, in a PSRO framework. |
alphacats_bootstrap
Generate training samples for PSRO network bootstrap by playing games with Smooth UCT search.
|
Generate training samples for PSRO network bootstrap by playing games with Smooth UCT search. |
alphacats_mcts
This version of alphacats uses Smooth UCT MCTS only.
|
This version of alphacats uses Smooth UCT MCTS only. |
count_game_nodes
Script to estimate the number of nodes touched in an external sampling run.
|
Script to estimate the number of nodes touched in an external sampling run. |
Package model implements an LSTM-based network model for use in MCTS.
|
Package model implements an LSTM-based network model for use in MCTS. |
internal/npyio
Package npyio is a fork of github.com/sbinet/npyio that is hard-coded for []float32s to avoid reflection.
|
Package npyio is a fork of github.com/sbinet/npyio that is hard-coded for []float32s to avoid reflection. |
internal/tffloats
Package tffloats constructs *tf.Tensors from []float32 slices, avoiding reflection.
|
Package tffloats constructs *tf.Tensors from []float32 slices, avoiding reflection. |