Documentation ¶
Index ¶
- Constants
- Variables
- func InitGameMod(node *RTPNode, tags []string, funcTag []FuncOnResult, symbols []int, ...)
- func InitGameMod2(node *RTPNode, tags []string, funcTag []FuncOnResult, symbols []int, ...)
- func InitGameMod3(node *RTPNode, tags []string, funcTag []FuncOnResult, symbols []int, ...)
- func InitGameModTag(node *RTPNode, tag string, symbols []int, nums []int)
- func InitGameModTag2(node *RTPNode, tag string, symbols []int, nums []int, ...)
- func InitSymbol(node *RTPNode, tag string, symbol int, nums []int)
- func InitSymbol2(node *RTPNode, tag string, symbol int, nums []int, ...)
- func OnGameModResult(node *RTPNode, pr *sgc7game.PlayResult, gameData any) bool
- func OnRootResult(node *RTPNode, pr *sgc7game.PlayResult, gameData any) bool
- func OnSymbolNumsResult(node *RTPNode, pr *sgc7game.PlayResult, gameData any) bool
- func OnSymbolResult(node *RTPNode, pr *sgc7game.PlayResult, gameData any) bool
- func StartRTP(game sgc7game.IGame, rtp *RTP, worknums int, spinnums int64, ...) time.Duration
- func StartScaleRTPDown(game sgc7game.IGame, rtp *RTP, worknums int, spinnums int64, ...) time.Duration
- type FeatureNode
- type FuncFeatureOnResults
- type FuncHROnResult
- type FuncOnHitFrequencyBet
- type FuncOnHitFrequencyResult
- type FuncOnPlayer
- type FuncOnRTPResults
- type FuncOnRTPTimer
- type FuncOnResult
- type FuncRDLOnResults
- type HitFrequencyData
- type HitRateNode
- type PlayerPoolData
- type RTP
- func (rtp *RTP) Add(rtp1 *RTP)
- func (rtp *RTP) AddFeature(tag string, funcOnResults FuncFeatureOnResults)
- func (rtp *RTP) AddHitFrequencyData(tag string, onHitFrequencyBet FuncOnHitFrequencyBet, ...)
- func (rtp *RTP) AddHitRateNode(tag string, funcOnResult FuncHROnResult)
- func (rtp *RTP) AddPlayerPoolData(tag string, funcOnPlayer FuncOnPlayer)
- func (rtp *RTP) AddReturnNode(tag string, valRange []float64, funcOnResults FuncRDLOnResults)
- func (rtp *RTP) AddReturns(ret float64)
- func (rtp *RTP) Bet(bet int64)
- func (rtp *RTP) CalcRTP()
- func (rtp *RTP) Clone() *RTP
- func (rtp *RTP) NewStats(tagname string)
- func (rtp *RTP) OnPlayerPoolData(ps sgc7game.IPlayerState)
- func (rtp *RTP) OnResult(stake *sgc7game.Stake, pr *sgc7game.PlayResult, gameData any)
- func (rtp *RTP) OnResults(lst []*sgc7game.PlayResult, gameData any)
- func (rtp *RTP) OnStats(tagname string, val int64)
- func (rtp *RTP) Save2CSV(fn string) error
- func (rtp *RTP) SaveAllReturns(dir string, fnprefix string)
- func (rtp *RTP) SaveReturns2CSV(fn string) error
- type RTPNode
- func NewRTPGameMod(gamemod string) *RTPNode
- func NewRTPGameModEx(gamemod string, onGameMod FuncOnResult) *RTPNode
- func NewRTPGameModTag(gamemod string, tag string, funcTag FuncOnResult) *RTPNode
- func NewRTPRoot() *RTPNode
- func NewRTPSymbol(gamemod string, tag string, symbol int) *RTPNode
- func NewRTPSymbol2(gamemod string, tag string, symbol int, onSymbolResult FuncOnResult) *RTPNode
- func NewRTPSymbolNums(gamemod string, tag string, symbol int, nums int) *RTPNode
- func NewRTPSymbolNums2(gamemod string, tag string, symbol int, nums int, ...) *RTPNode
- func (node *RTPNode) Add(node1 *RTPNode)
- func (node *RTPNode) AddChild(name string, c *RTPNode)
- func (node *RTPNode) CalcRTP(totalbet int64)
- func (node *RTPNode) ChgSymbolNumsFunc(funcOnResult FuncOnResult)
- func (node *RTPNode) Clone() *RTPNode
- func (node *RTPNode) GenGameModString(gamemod string, sn []int, totalbet int64) string
- func (node *RTPNode) GenRootString(sn []int, totalbet int64) string
- func (node *RTPNode) GenSymbolString(gamemod string, tag string, symbol int, sn []int, totalbet int64) string
- func (node *RTPNode) GenTagString(gamemod string, tag string, sn []int, totalbet int64) string
- func (node *RTPNode) GetGameMods(arr []string) []string
- func (node *RTPNode) GetSymbolNums(arr []int) []int
- func (node *RTPNode) GetSymbolNumsWon(gamemod string, tag string, symbol int, sn int) int64
- func (node *RTPNode) GetSymbols(arr []int) []int
- func (node *RTPNode) GetTags(arr []string, gamemod string) []string
- func (node *RTPNode) OnResult(pr *sgc7game.PlayResult, gameData any)
- type RTPReturnData
- type RTPReturnDataList
- type RTPStats
Constants ¶
const ( // RTPNodeRoot - root RTPNodeRoot = 0 // RTPNodeGameMod - gamemod RTPNodeGameMod = 1 // RTPNodeTag - tag RTPNodeTag = 2 // RTPNodeSymbol - symbol RTPNodeSymbol = 3 // RTPNodeSymbolNums - symbol nums RTPNodeSymbolNums = 4 )
Variables ¶
var ( // ErrInvalidReturnLen - invalid return len ErrInvalidReturnLen = errors.New("invalid return len") )
Functions ¶
func InitGameMod ¶
func InitGameMod(node *RTPNode, tags []string, funcTag []FuncOnResult, symbols []int, nums []int)
InitGameMod - new RTPNode
func InitGameMod2 ¶
func InitGameMod2(node *RTPNode, tags []string, funcTag []FuncOnResult, symbols []int, nums []int, onSymbolResult FuncOnResult, onSymbolNumsResult FuncOnResult)
InitGameMod2 - new RTPNode
func InitGameMod3 ¶
func InitGameMod3(node *RTPNode, tags []string, funcTag []FuncOnResult, symbols []int, nums []int, onSymbolResult []FuncOnResult, onSymbolNumsResult []FuncOnResult)
InitGameMod3 - new RTPNode
func InitGameModTag ¶
InitGameModTag - new RTPNode
func InitGameModTag2 ¶
func InitGameModTag2(node *RTPNode, tag string, symbols []int, nums []int, onSymbolResult FuncOnResult, onSymbolNumsResult FuncOnResult)
InitGameModTag2 - new RTPNode
func InitSymbol ¶
InitSymbol - new RTPNode
func InitSymbol2 ¶
func InitSymbol2(node *RTPNode, tag string, symbol int, nums []int, onSymbolNumsResult FuncOnResult)
InitSymbol2 - new RTPNode
func OnGameModResult ¶
func OnGameModResult(node *RTPNode, pr *sgc7game.PlayResult, gameData any) bool
OnGameModResult - on gamemod
func OnRootResult ¶
func OnRootResult(node *RTPNode, pr *sgc7game.PlayResult, gameData any) bool
OnRootResult - on root
func OnSymbolNumsResult ¶
func OnSymbolNumsResult(node *RTPNode, pr *sgc7game.PlayResult, gameData any) bool
OnSymbolNumsResult - on symbol nums
func OnSymbolResult ¶
func OnSymbolResult(node *RTPNode, pr *sgc7game.PlayResult, gameData any) bool
OnSymbolResult - on symbol
Types ¶
type FeatureNode ¶
type FeatureNode struct { TagName string BetNums int64 TriggerNums int64 FuncOnResults FuncFeatureOnResults }
FeatureNode -
func NewFeatureNode ¶
func NewFeatureNode(tag string, funcOnResults FuncFeatureOnResults) *FeatureNode
NewFeatureNode - new FeatureNode
type FuncFeatureOnResults ¶
type FuncFeatureOnResults func(node *FeatureNode, lst []*sgc7game.PlayResult, gameData any) bool
FuncFeatureOnResults - onResult(*FeatureNode, []*sgc7game.PlayResult, any)
type FuncHROnResult ¶
type FuncHROnResult func(rtp *RTP, node *HitRateNode, pr *sgc7game.PlayResult) bool
FuncHROnResult - onResult(*RTP, *HitRateNode, *sgc7game.PlayResult)
type FuncOnHitFrequencyBet ¶
type FuncOnHitFrequencyBet func(hfd *HitFrequencyData, bet int64)
FuncOnHitFrequencyBet - onHitFrequencyBet(*HitFrequencyData, int64)
type FuncOnHitFrequencyResult ¶
type FuncOnHitFrequencyResult func(hfd *HitFrequencyData, pr *sgc7game.PlayResult)
FuncOnHitFrequencyResult - onHitFrequencyResult(*HitFrequencyData, *sgc7game.PlayResult)
type FuncOnPlayer ¶
type FuncOnPlayer func(pd *PlayerPoolData, ps sgc7game.IPlayerState)
FuncOnPlayer - onPlayer(*PlayerPoolData, sgc7game.IPlayerState)
type FuncOnRTPResults ¶
type FuncOnRTPResults func(lst []*sgc7game.PlayResult, gameData any)
type FuncOnRTPTimer ¶
FuncOnRTPTimer - on timer for rtp
type FuncOnResult ¶
type FuncOnResult func(node *RTPNode, pr *sgc7game.PlayResult, gameData any) bool
FuncOnResult - onResult(*RTPNode, *sgc7game.PlayResult, any)
type FuncRDLOnResults ¶
type FuncRDLOnResults func(rdlst *RTPReturnDataList, lst []*sgc7game.PlayResult) bool
FuncRDLOnResults - onResult(*RTPReturnDataList, []*sgc7game.PlayResult)
type HitFrequencyData ¶
type HitFrequencyData struct { TagName string Total int64 TriggerTimes int64 OnHitFrequencyBet FuncOnHitFrequencyBet OnHitFrequencyResult FuncOnHitFrequencyResult }
HitFrequencyData -
func NewHitFrequencyData ¶
func NewHitFrequencyData(tag string, onHitFrequencyBet FuncOnHitFrequencyBet, onHitFrequencyResult FuncOnHitFrequencyResult) *HitFrequencyData
NewHitFrequencyData - new HitFrequencyData
func (*HitFrequencyData) Clone ¶
func (hfd *HitFrequencyData) Clone() *HitFrequencyData
Clone - clone
func (*HitFrequencyData) GenString ¶
func (hfd *HitFrequencyData) GenString() string
type HitRateNode ¶
type HitRateNode struct { TagName string BetNums int64 TriggerNums int64 TotalNums int64 FuncOnResult FuncHROnResult }
HitRateNode -
func NewSpecialHitRate ¶
func NewSpecialHitRate(tag string, funcOnResult FuncHROnResult) *HitRateNode
NewSpecialHitRate - new HitRateNode
type PlayerPoolData ¶
type PlayerPoolData struct { TagName string Total int64 PlayerNums int64 OnPlayer FuncOnPlayer }
PlayerPoolData -
func NewPlayerPoolData ¶
func NewPlayerPoolData(tag string, onPlayer FuncOnPlayer) *PlayerPoolData
NewPlayerPoolData - new PlayerPoolData
func (*PlayerPoolData) GenString ¶
func (pd *PlayerPoolData) GenString() string
type RTP ¶
type RTP struct { WinNums int64 BetNums int64 TotalBet int64 TotalWins int64 Root *RTPNode MapHR map[string]*HitRateNode MapFeature map[string]*FeatureNode Variance float64 StdDev float64 Returns []float64 ReturnWeights []float64 MaxReturn int64 MaxReturnNums int64 MapPlayerPool map[string]*PlayerPoolData MapHitFrequencyData map[string]*HitFrequencyData MapReturn map[string]*RTPReturnDataList MapStats map[string]*RTPStats MaxCoincidingWin float64 Stats2 *sgc7stats.Feature FuncRTPResults FuncOnRTPResults }
RTP -
func (*RTP) AddFeature ¶
func (rtp *RTP) AddFeature(tag string, funcOnResults FuncFeatureOnResults)
AddFeature -
func (*RTP) AddHitFrequencyData ¶
func (rtp *RTP) AddHitFrequencyData(tag string, onHitFrequencyBet FuncOnHitFrequencyBet, onHitFrequencyResult FuncOnHitFrequencyResult)
AddHitFrequencyData -
func (*RTP) AddHitRateNode ¶
func (rtp *RTP) AddHitRateNode(tag string, funcOnResult FuncHROnResult)
AddHitRateNode -
func (*RTP) AddPlayerPoolData ¶
func (rtp *RTP) AddPlayerPoolData(tag string, funcOnPlayer FuncOnPlayer)
AddPlayerPoolData -
func (*RTP) AddReturnNode ¶
func (rtp *RTP) AddReturnNode(tag string, valRange []float64, funcOnResults FuncRDLOnResults)
AddReturnNode -
func (*RTP) OnPlayerPoolData ¶
func (rtp *RTP) OnPlayerPoolData(ps sgc7game.IPlayerState)
OnPlayerPoolData -
func (*RTP) OnResults ¶
func (rtp *RTP) OnResults(lst []*sgc7game.PlayResult, gameData any)
OnResults -
func (*RTP) SaveAllReturns ¶
SaveAllReturns -
type RTPNode ¶
type RTPNode struct { NodeType int TriggerNums int64 TotalWin int64 RTP float64 MapChildren map[string]*RTPNode GameMod string Symbol int SymbolNums int TagName string FuncOnResult FuncOnResult }
RTPNode -
func NewRTPGameModEx ¶
func NewRTPGameModEx(gamemod string, onGameMod FuncOnResult) *RTPNode
NewRTPGameModEx - new RTPNode
func NewRTPGameModTag ¶
func NewRTPGameModTag(gamemod string, tag string, funcTag FuncOnResult) *RTPNode
NewRTPGameModTag - new RTPNode
func NewRTPSymbol ¶
NewRTPSymbol - new RTPNode
func NewRTPSymbol2 ¶
func NewRTPSymbol2(gamemod string, tag string, symbol int, onSymbolResult FuncOnResult) *RTPNode
NewRTPSymbol2 - new RTPNode
func NewRTPSymbolNums ¶
NewRTPSymbolNums - new RTPNode
func NewRTPSymbolNums2 ¶
func NewRTPSymbolNums2(gamemod string, tag string, symbol int, nums int, onSymbolNumsResult FuncOnResult) *RTPNode
NewRTPSymbolNums2 - new RTPNode
func (*RTPNode) ChgSymbolNumsFunc ¶
func (node *RTPNode) ChgSymbolNumsFunc(funcOnResult FuncOnResult)
ChgSymbolNumsFunc -
func (*RTPNode) GenGameModString ¶
GenGameModString -
func (*RTPNode) GenRootString ¶
GenRootString -
func (*RTPNode) GenSymbolString ¶
func (node *RTPNode) GenSymbolString(gamemod string, tag string, symbol int, sn []int, totalbet int64) string
GenSymbolString -
func (*RTPNode) GenTagString ¶
GenTagString -
func (*RTPNode) GetSymbolNumsWon ¶
GetSymbolNumsWon -
type RTPReturnData ¶
type RTPReturnDataList ¶
type RTPReturnDataList struct { Tag string Returns []int64 ReturnWeights []int64 MaxReturn int64 MaxReturnNums int64 ValRange []float64 TotalReturns []float64 // contains filtered or unexported fields }
func NewRTPReturnDataList ¶
func NewRTPReturnDataList(tag string, valRange []float64, onResults FuncRDLOnResults) *RTPReturnDataList
func (*RTPReturnDataList) AddReturns ¶
func (rdlst *RTPReturnDataList) AddReturns(fret float64)
AddReturns -
func (*RTPReturnDataList) Clone ¶
func (rdlst *RTPReturnDataList) Clone() *RTPReturnDataList
Clone -
func (*RTPReturnDataList) Merge ¶
func (rdlst *RTPReturnDataList) Merge(lst *RTPReturnDataList)
Merge -
func (*RTPReturnDataList) SaveReturns2CSV ¶
func (rdlst *RTPReturnDataList) SaveReturns2CSV(fn string) error
SaveReturns2CSV -