Documentation ¶
Index ¶
- Constants
- Variables
- func AllInWinner(lastStrength string, remainingOpponent int) (winner byte)
- func ArrangeCards(mycard Def.Cards) Def.Cards
- func ArrangeSlice(cardSlice []Def.Poker, size int)
- func Checker(mycard Def.Cards) string
- func GenerateAllOpponentCard(myCard Def.Cards, remainingEnemy int, enemySlices []Def.Cards)
- func GenerateOpponentCard(myCard Def.Cards) (opponentCard Def.Cards)
- func GetCurrentRound(myCard Def.Cards) byte
- func GetDecision(Informations Def.RobotInherit, Standard, Total, RaiseDiff, AllInBound float64, ...) (Def.PlayerAction, float64, string)
- func GetOpponentInfo(char byte) (int, int)
- func GetRaiseAmount(ConfidenceAmount, Standard, RaiseDiff, AllInBound float64, ...) float64
- func GetStrategy(history string) []float64
- func HistoryAdd(mycard Def.Cards) string
- func OpponentRaiseDecoding(ltr string) (intAmount int64)
- func OpponentRaiseEncoding(rp, raiseNum int) (res string)
- func PseudoGeneratorForMyRaise(ConfidenceAmount float64, ...) int64
- func PseudoGeneratorForOpponentAllIn(totalMoney int64) int64
- func PseudoGeneratorForOpponentRaise(ConfidenceAmount float64, RaiseDiff, Standard, AllInBound int64) (returnVar int64)
- func RewardCounter(history string, raiseHistory []float64, raiseSize int64) (Total, BetPos int64)
- type PokerNode
- func (k *PokerNode) Close()
- func (k *PokerNode) GetChild(i int) cfr.GameTreeNode
- func (k *PokerNode) GetChildProbability(i int) float64
- func (k *PokerNode) GetNode(history string) cfr.GameTreeNode
- func (k PokerNode) GetProb() []float64
- func (k *PokerNode) InfoSet(player int) cfr.InfoSet
- func (k *PokerNode) InfoSetKey(player int) []byte
- func (k *PokerNode) IsTerminal() bool
- func (k *PokerNode) NumChildren() int
- func (k *PokerNode) Parent() cfr.GameTreeNode
- func (k *PokerNode) Player() int
- func (k *PokerNode) SampleChild() (cfr.GameTreeNode, float64)
- func (k PokerNode) String() string
- func (k *PokerNode) Type() cfr.NodeType
- func (k *PokerNode) Utility(player int) float64
Constants ¶
View Source
const ( NODE_CHANCE = -1 NODE_AI = 0 NODE_OPPONENT = 1 )
View Source
const ( ACTION_FOLD byte = 'f' ACTION_CALL byte = 'c' ACTION_RAISE byte = 'r' ACTION_ALL_IN byte = 'a' )
View Source
const ( ROYAL_PROB = 0.000032 STRFLUSH_PROB = 0.000279 FOURKIND_PROB = 0.00168 FULLH_PROB = 0.026 FLUSH_PROB = 0.0303 STRAIGHT_PROB = 0.0462 THREEKIND_PROB = 0.0483 TWOPAIR_PROB = 0.235 ONEPAIR_PROB = 0.438 HCARD_PROB = 0.174 )
View Source
const ( SMALLBLIND_TRAIN int64 = 1 CALL_TRAIN int64 = 2 ALLIN_TRAIN int64 = 200 )
for training purposes
View Source
const ( //This is for vs NEUTRAL AI fine tune FINETUNE_ON bool = true BLUFF bool = false ALLIN_REDUCE float64 = 0.8 RAISE_REDUCE float64 = 0.9 RAISE_LIMIT_MULTIPLIER float64 = 80 MONEY_TOO_BIG_PASS float64 = 0.3 FOLD_REDUCE float64 = 0.9 REPEATING_REDUCE float64 = 0.5 PREFLOP_HIGHPASS_CHECK float64 = 0.5 PREFLOP_HIGHPASS_RAISE float64 = 0.9 PREFLOP_HIGHPASS_ALLIN float64 = 0.9 REPEATING_RESET_DISABLE bool = true )
fine tune
View Source
const RAISE_SMALLEST_AMOUNT = 500
Variables ¶
View Source
var Action Def.PlayerAction // 被通知的玩家能夠行動的方式(複合的Flag) / the move availble for current player?
View Source
var AllinBound float64 // 如果要Allin,則跟到標準後,只能再加這個數值
View Source
var ENC_OPPONENT = [2][]byte{
{'I', 'J', 'K', 'L', '!'},
{'k', 'l', 'm', '^'},
}
Encoding for remaining num of opponents + num of raises (H to u, some skipped)
View Source
var HAND_POTENTIAL = [10]byte{
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
}
View Source
var HAND_STRENGTH = [7]byte{
'A',
'B',
'C',
'D',
'E',
'F',
'G',
}
View Source
var LOWER_BOUND = [2]int{4, 1}
View Source
var PROB_FLOP_DETAIL = [10][7]float64{
{0.001258, 0.023501, 0.120919, 0.043026, 0.219528, 0.419889, 0.171879},
{0.001560, 0.033909, 0.127559, 0.056606, 0.238955, 0.401088, 0.140323},
{0.000109, 0.120814, 0.029908, 0.099367, 0.446634, 0.303168, 0.000000},
{0.000162, 0.120814, 0.034382, 0.099087, 0.445545, 0.300010, 0.000000},
{0.000355, 0.033909, 0.091614, 0.057559, 0.242643, 0.420957, 0.152963},
{0.000674, 0.033909, 0.103119, 0.057318, 0.241712, 0.414887, 0.148381},
{0.000128, 0.033909, 0.073241, 0.058264, 0.246075, 0.430919, 0.157463},
{0.000165, 0.033909, 0.087417, 0.057996, 0.245031, 0.423656, 0.151825},
{0.000132, 0.033909, 0.048020, 0.058972, 0.248822, 0.444644, 0.165501},
{0.000161, 0.033909, 0.060566, 0.058725, 0.247864, 0.438231, 0.160544}}
new feature
View Source
var PROB_POSTFLOP = [4][7]float64{
{0.0008, 0.0017, 0.0059, 0.0211, 0.0475, 0.4226, 0.5012},
{0.000091, 0.00887, 0.0279, 0.036, 0.1244, 0.478, 0.325},
{0.0003, 0.0277, 0.0765, 0.0483, 0.2350, 0.4380, 0.1740},
}
View Source
var PROB_PREFLOP = [10]float64{0.006, 0.012, 0.024, 0.054, 0.127, 0.109, 0.024, 0.048, 0.308, 0.288}
View Source
var PROB_RIVER_DETAIL = [7][7]float64{
{1, 0, 0, 0, 0, 0, 0},
{0, 1, 0, 0, 0, 0, 0},
{0.003311, 0.000000, 0.996689, 0.000000, 0.000000, 0.000000, 0.000000},
{0.000064, 0.217391, 0.014516, 0.768029, 0.000000, 0.000000, 0.000000},
{0.000083, 0.088274, 0.016999, 0.000000, 0.894644, 0.000000, 0.000000},
{0.000120, 0.000000, 0.040593, 0.043307, 0.258815, 0.657164, 0.000000},
{0.000134, 0.000000, 0.073151, 0.013767, 0.082277, 0.385464, 0.541251}}
View Source
var PROB_TURN_DETAIL = [7][7]float64{
{1, 0, 0, 0, 0, 0, 0},
{0, 1, 0, 0, 0, 0, 0},
{0.006720, 0.000000, 0.993280, 0.000000, 0.000000, 0.000000, 0.000000},
{0.000055, 0.333950, 0.012354, 0.653642, 0.000000, 0.000000, 0.000000},
{0.000073, 0.167438, 0.014919, 0.000000, 0.817570, 0.000000, 0.000000},
{0.000199, 0.025902, 0.045818, 0.065364, 0.366782, 0.495935, 0.000000},
{0.000280, 0.000000, 0.092060, 0.013767, 0.082277, 0.459604, 0.352012}}
View Source
var RaiseDiff float64 // 如果要加注,則跟到標準後,要大餘等於這個加注差值
View Source
var SeatIdx Def.SeatIndex // Seat index
View Source
var Standard float64 // 現在壓注的標準
View Source
var Total float64 // 現在壓注的總額
View Source
var UPPER_BOUND = [2]int{8, 3}
Functions ¶
func AllInWinner ¶
only for training purposes 0 is lose, 1 is draw, 2 is win
func ArrangeSlice ¶
func GenerateAllOpponentCard ¶
func GetCurrentRound ¶
func GetDecision ¶
func GetDecision(Informations Def.RobotInherit, Standard, Total, RaiseDiff, AllInBound float64, myHistory string) (Def.PlayerAction, float64, string)
func GetOpponentInfo ¶
func GetRaiseAmount ¶
func GetRaiseAmount(ConfidenceAmount, Standard, RaiseDiff, AllInBound float64, Informations Def.RobotInherit) float64
func GetStrategy ¶
func HistoryAdd ¶
func OpponentRaiseDecoding ¶
func OpponentRaiseEncoding ¶
func PseudoGeneratorForOpponentRaise ¶
func PseudoGeneratorForOpponentRaise(ConfidenceAmount float64, RaiseDiff, Standard, AllInBound int64) (returnVar int64)
for training purposes
Types ¶
type PokerNode ¶
type PokerNode struct {
// contains filtered or unexported fields
}
PokerNode implements cfr.GameTreeNode for Kuhn Poker.
func (*PokerNode) GetChildProbability ¶
GetChildProbability implements cfr.GameTreeNode.
func (*PokerNode) InfoSetKey ¶
func (*PokerNode) IsTerminal ¶
func (*PokerNode) NumChildren ¶
NumChildren implements cfr.GameTreeNode.
func (*PokerNode) Parent ¶
func (k *PokerNode) Parent() cfr.GameTreeNode
Parent implements cfr.GameTreeNode.
func (*PokerNode) SampleChild ¶
SampleChild implements cfr.GameTreeNode.
Click to show internal directories.
Click to hide internal directories.