ai

package
v0.0.0-...-13f8a94 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CFR *cfr.MCCFR
View Source
var OPPONENT_STRATEGY = [3][2][4]float32{
	{
		{0.4, 0.4, 0.1, 0.1},
		{0.3, 0.6, 0.09, 0.01},
	},
	{
		{0.05, 0.5, 0.4, 0.05},
		{0.15, 0.375, 0.375, 0.1},
	},
	{
		{0.01, 0.3, 0.6, 0.09},
		{0.1, 0.3, 0.3, 0.3},
	},
}

Pre-determined opponent strategies First index: Opponent type (Pessimistic, Neutral, Confident) Second index: Condition (Pre-flop, post-flop, after all-in) Third index: Strategies (Fold, Call, Raise, All-in)

View Source
var RAISE_NUMS = [2][]int{
	{4, 3, 2, 1, 0},
	{3, 2, 1, 0},
}

Functions

func GetDecision

func GetDecision(Informations Def.RobotInherit, Standard, Total, RaiseDiff, AllInBound float64, myHistory string) (Def.PlayerAction, float64, string)

func GetExpectation

func GetExpectation(history string, smallBlind float64) float64

func Init

func Init(opponent OpponentType, policyFileName string)

Implementation of AI Interface

func LoadPolicy

func LoadPolicy(fileName string, replace bool)

func PrintPolicy

func PrintPolicy(maxLines int)

func PrintTree

func PrintTree(maxLines int)

func Run

func Run(nIter int) float64

func SavePolicy

func SavePolicy(fileName string)

Types

type OpponentType

type OpponentType int
const (
	PESSIMISTIC OpponentType = iota
	NEUTRAL
	CONFIDENT
)

Jump to

Keyboard shortcuts

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