oots

package
v0.0.0-...-10630b1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructTree

func ConstructTree(fileName string)

func GetMaxNestedStructureCount

func GetMaxNestedStructureCount(tree *ModelTree)

func GetNodeWithMaxConfidence

func GetNodeWithMaxConfidence(gameChildNodes map[string]*GameStateNode, visitCount int) string

Returns the id of the child node which have the most confidence

func ReadFile

func ReadFile(fileName string) []generator.GameMovesWithResult

Types

type ConfidenceNode

type ConfidenceNode struct {
	Child      map[string]*ConfidenceNode `json:"c"`
	SuitableId string                     `json:"s,omitempty"`
}

func GetConfidenceNode

func GetConfidenceNode() *ConfidenceNode

type ConfidenceTree

type ConfidenceTree struct {
	Root *ConfidenceNode
}

func GetConfidenceTree

func GetConfidenceTree() *ConfidenceTree

func (*ConfidenceTree) ConstructConfidenceTree

func (confTree *ConfidenceTree) ConstructConfidenceTree(modelTree *ModelTree)

Constructs the Confidence Tree by traversing over the Model Tree

type GameStateNode

type GameStateNode struct {
	ChildNode     map[string]*GameStateNode `json:"ch"` // inside map the key is the identifier for each node
	PlayerColor   string                    `json:"clr"`
	SelectedCount int                       `json:"c"`
	WinCount      int                       `json:"w"`
	DrawCount     int                       `json:"d"`
	LoseCount     int                       `json:"l"`
}

func GetGameStateNode

func GetGameStateNode(playClr string) *GameStateNode

func (*GameStateNode) IncDrawCount

func (node *GameStateNode) IncDrawCount()

func (*GameStateNode) IncLoseCount

func (node *GameStateNode) IncLoseCount()

func (*GameStateNode) IncSelectedCount

func (node *GameStateNode) IncSelectedCount()

func (*GameStateNode) IncWinCount

func (node *GameStateNode) IncWinCount()

type ModelTree

type ModelTree struct {
	Root *GameStateNode `json:"root"`
}

func GetSingletonTreeInstance

func GetSingletonTreeInstance() *ModelTree

func GetTreeInstance

func GetTreeInstance() *ModelTree

func (*ModelTree) Insert

func (tree *ModelTree) Insert(items []string, score string)

Takes moves list and the score and construct tree accordingly

Jump to

Keyboard shortcuts

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