sgc7rtp

package
v0.13.181 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RTPNodeRoot - root
	RTPNodeRoot = 0
	// RTPNodeGameMod - gamemod
	RTPNodeGameMod = 1
	// RTPNodeTag - tag
	RTPNodeTag = 2
	// RTPNodeSymbol - symbol
	RTPNodeSymbol = 3
	// RTPNodeSymbolNums - symbol nums
	RTPNodeSymbolNums = 4
)

Variables

View Source
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

func InitGameModTag(node *RTPNode, tag string, symbols []int, nums []int)

InitGameModTag - new RTPNode

func InitGameModTag2

func InitGameModTag2(node *RTPNode, tag string, symbols []int, nums []int, onSymbolResult FuncOnResult, onSymbolNumsResult FuncOnResult)

InitGameModTag2 - new RTPNode

func InitSymbol

func InitSymbol(node *RTPNode, tag string, symbol int, nums []int)

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

func StartRTP

func StartRTP(game sgc7game.IGame, rtp *RTP, worknums int, spinnums int64, stake *sgc7game.Stake, numsTimer int,
	ontimer FuncOnRTPTimer, needVariance bool, limitPayout int64) time.Duration

StartRTP - start RTP

func StartRTP2 added in v0.12.274

func StartRTP2(game sgc7game.IGame, rtp *RTP, worknums int, spinnums int64, stake *sgc7game.Stake, numsTimer int,
	ontimer FuncOnRTPTimer, needVariance bool, limitPayout int64) time.Duration

StartRTP2 - start RTP

func StartScaleRTPDown

func StartScaleRTPDown(game sgc7game.IGame, rtp *RTP, worknums int, spinnums int64, stake *sgc7game.Stake, numsTimer int,
	ontimer FuncOnRTPTimer, hitFrequency float64, originalRTP float64, targetRTP float64, needVariance bool) time.Duration

StartRTP - start RTP

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

func (*FeatureNode) Add

func (node *FeatureNode) Add(node1 *FeatureNode)

Add - add

func (*FeatureNode) Clone

func (node *FeatureNode) Clone() *FeatureNode

Clone - clone

func (*FeatureNode) GenString

func (node *FeatureNode) GenString() string

GenString -

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, i int, prs []*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

type FuncOnRTPTimer func(totalnums int64, curnums int64, curtime time.Duration)

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) Add

func (hfd *HitFrequencyData) Add(hfd1 *HitFrequencyData)

Add - add

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

func (*HitRateNode) Add

func (node *HitRateNode) Add(node1 *HitRateNode)

Add - add

func (*HitRateNode) Clone

func (node *HitRateNode) Clone() *HitRateNode

Clone - clone

func (*HitRateNode) GenString

func (node *HitRateNode) GenString() string

GenString -

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) Add

func (pd *PlayerPoolData) Add(pd1 *PlayerPoolData)

Add - add

func (*PlayerPoolData) Clone

func (pd *PlayerPoolData) Clone() *PlayerPoolData

Clone - clone

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 NewRTP

func NewRTP() *RTP

NewRTP - new RTP

func (*RTP) Add

func (rtp *RTP) Add(rtp1 *RTP)

Add - add

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) AddReturns

func (rtp *RTP) AddReturns(ret float64)

AddReturns -

func (*RTP) Bet

func (rtp *RTP) Bet(bet int64)

Bet -

func (*RTP) CalcRTP

func (rtp *RTP) CalcRTP()

CalcRTP -

func (*RTP) Clone

func (rtp *RTP) Clone() *RTP

Clone - clone

func (*RTP) NewStats

func (rtp *RTP) NewStats(tagname string)

NewStats -

func (*RTP) OnPlayerPoolData

func (rtp *RTP) OnPlayerPoolData(ps sgc7game.IPlayerState)

OnPlayerPoolData -

func (*RTP) OnResult

func (rtp *RTP) OnResult(stake *sgc7game.Stake, i int, prs []*sgc7game.PlayResult, gameData any)

OnResult -

func (*RTP) OnResults

func (rtp *RTP) OnResults(lst []*sgc7game.PlayResult, gameData any)

OnResults -

func (*RTP) OnStats

func (rtp *RTP) OnStats(tagname string, val int64)

OnStats -

func (*RTP) Save2CSV

func (rtp *RTP) Save2CSV(fn string) error

Save2CSV -

func (*RTP) SaveAllReturns

func (rtp *RTP) SaveAllReturns(dir string, fnprefix string)

SaveAllReturns -

func (*RTP) SaveReturns2CSV

func (rtp *RTP) SaveReturns2CSV(fn string) error

SaveReturns2CSV -

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 NewRTPGameMod

func NewRTPGameMod(gamemod string) *RTPNode

NewRTPGameMod - new 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 NewRTPRoot

func NewRTPRoot() *RTPNode

NewRTPRoot - new RTPNode

func NewRTPSymbol

func NewRTPSymbol(gamemod string, tag string, symbol int) *RTPNode

NewRTPSymbol - new RTPNode

func NewRTPSymbol2

func NewRTPSymbol2(gamemod string, tag string, symbol int, onSymbolResult FuncOnResult) *RTPNode

NewRTPSymbol2 - new RTPNode

func NewRTPSymbolNums

func NewRTPSymbolNums(gamemod string, tag string, symbol int, nums int) *RTPNode

NewRTPSymbolNums - new RTPNode

func NewRTPSymbolNums2

func NewRTPSymbolNums2(gamemod string, tag string, symbol int, nums int, onSymbolNumsResult FuncOnResult) *RTPNode

NewRTPSymbolNums2 - new RTPNode

func (*RTPNode) Add

func (node *RTPNode) Add(node1 *RTPNode)

Add - add

func (*RTPNode) AddChild

func (node *RTPNode) AddChild(name string, c *RTPNode)

AddChild -

func (*RTPNode) CalcRTP

func (node *RTPNode) CalcRTP(totalbet int64)

CalcRTP -

func (*RTPNode) ChgSymbolNumsFunc

func (node *RTPNode) ChgSymbolNumsFunc(funcOnResult FuncOnResult)

ChgSymbolNumsFunc -

func (*RTPNode) Clone

func (node *RTPNode) Clone() *RTPNode

Clone - clone

func (*RTPNode) GenGameModString

func (node *RTPNode) GenGameModString(gamemod string, sn []int, totalbet int64) string

GenGameModString -

func (*RTPNode) GenRootString

func (node *RTPNode) GenRootString(sn []int, totalbet int64) string

GenRootString -

func (*RTPNode) GenSymbolString

func (node *RTPNode) GenSymbolString(gamemod string, tag string, symbol int, sn []int, totalbet int64) string

GenSymbolString -

func (*RTPNode) GenTagString

func (node *RTPNode) GenTagString(gamemod string, tag string, sn []int, totalbet int64) string

GenTagString -

func (*RTPNode) GetGameMods

func (node *RTPNode) GetGameMods(arr []string) []string

GetGameMods -

func (*RTPNode) GetSymbolNums

func (node *RTPNode) GetSymbolNums(arr []int) []int

GetSymbolNums -

func (*RTPNode) GetSymbolNumsWon

func (node *RTPNode) GetSymbolNumsWon(gamemod string, tag string, symbol int, sn int) int64

GetSymbolNumsWon -

func (*RTPNode) GetSymbols

func (node *RTPNode) GetSymbols(arr []int) []int

GetSymbols -

func (*RTPNode) GetTags

func (node *RTPNode) GetTags(arr []string, gamemod string) []string

GetTags -

func (*RTPNode) OnResult

func (node *RTPNode) OnResult(pr *sgc7game.PlayResult, gameData any)

OnResult -

type RTPReturnData

type RTPReturnData struct {
	Return     float64
	TotalTimes int64
	Times      int64
	Total      float64
}

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 -

type RTPStats

type RTPStats struct {
	TagName  string
	MaxVal   int64
	MinVal   int64
	TotalVal int64
	Times    int64
	AvgVal   int64
}

func (*RTPStats) Clone

func (rtpstats *RTPStats) Clone() *RTPStats

Clone - clone

func (*RTPStats) GenString

func (rtpstats *RTPStats) GenString() string

func (*RTPStats) Merge

func (rtpstats *RTPStats) Merge(stats1 *RTPStats)

Add - add

func (*RTPStats) OnEnd

func (rtpstats *RTPStats) OnEnd()

func (*RTPStats) OnRTPStats

func (rtpstats *RTPStats) OnRTPStats(val int64)

Jump to

Keyboard shortcuts

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