Documentation
¶
Index ¶
- Variables
- func AnalyzeWeights[T int | float32 | float64](vw *sgc7game.ValWeights, runner FuncRunnerWithValWeights[T]) (*sgc7game.ValMapping[int, T], error)
- func AutoChgWeights[T int | float32 | float64](vw *sgc7game.ValWeights, target T, runner FuncRunnerWithValWeights[T], ...) (*sgc7game.ValWeights, error)
- func AutoGenReels(w, h int, paytables *sgc7game.PayTables, syms []SymbolType, wilds []SymbolType, ...) (*sgc7game.ReelsData, error)
- func CalcScatterWinsInReels(paytables *sgc7game.PayTables, rss *ReelsStats, symbol SymbolType, num int, ...) (int64, error)
- func CalcSymbolWins(rss *ReelsStats, wilds []SymbolType, symbol SymbolType, symbol2 SymbolType, ...) (int64, error)
- func CalcSymbolWinsInReelsWithLine(paytables *sgc7game.PayTables, rss *ReelsStats, symbols []SymbolType, ...) (int64, error)
- func FindSymbol(symbols []SymbolType, symbol SymbolType) int
- func GenReels(rss *ReelsStats, minoff int, trytimes int) (*sgc7game.ReelsData, error)
- func GenReelsMainSymbolsDistance(rss *ReelsStats, mainSymbols []SymbolType, minoff int, trytimes int) (*sgc7game.ReelsData, error)
- func HasSymbol(symbols []SymbolType, symbol SymbolType) bool
- func IsFirstWild(lst []InReelSymbolType, num int) bool
- type FuncRunnerWithValWeights
- type InReelSymbolType
- type ReelStats
- func (rs *ReelStats) AddSymbol(symbol SymbolType, num int)
- func (rs *ReelStats) BuildSymbols(excludeSymbols []SymbolType) []SymbolType
- func (rs *ReelStats) BuildSymbols2(excludeSymbols1 []SymbolType, excludeSymbols2 []SymbolType) []SymbolType
- func (rs *ReelStats) BuildSymbolsEx(symbols []SymbolType) []SymbolType
- func (rs *ReelStats) BuildSymbolsWithWeights(excludeSymbols []SymbolType) (*sgc7game.ValWeights, error)
- func (rs *ReelStats) BuildSymbolsWithWeights2(excludeSymbols1 []SymbolType, excludeSymbols2 []SymbolType) (*sgc7game.ValWeights, error)
- func (rs *ReelStats) BuildSymbolsWithWeightsEx(symbols []SymbolType) (*sgc7game.ValWeights, error)
- func (rs *ReelStats) Clone() *ReelStats
- func (rs *ReelStats) CountSymbolsNum(symbols []SymbolType) int
- func (rs *ReelStats) GetCanAddSymbols(symbols []SymbolType) []SymbolType
- func (rs *ReelStats) GetSymbolStats(symbol SymbolType) *SymbolStats
- func (rs *ReelStats) GetSymbolWithIndex(index int) SymbolType
- func (rs *ReelStats) RemoveSymbol(symbol SymbolType, num int) int
- type ReelsStats
- func BuildBasicReelsStats(reelnum int, paytables *sgc7game.PayTables, excludeSyms []SymbolType) (*ReelsStats, error)
- func BuildBasicReelsStatsEx(reelnum int, syms []SymbolType) (*ReelsStats, error)
- func BuildReelsStats(reels *sgc7game.ReelsData, mapSymbols *SymbolsMapping) (*ReelsStats, error)
- func LoadReelsStats(fn string) (*ReelsStats, error)
- func (rss *ReelsStats) ClearEmptySymbols()
- func (rss *ReelsStats) Clone() *ReelsStats
- func (rss *ReelsStats) CloneWithMapping(mapSymbols *SymbolsMapping) *ReelsStats
- func (rss *ReelsStats) GetNum(reelindex int, symbol SymbolType, symbol2 SymbolType, wilds []SymbolType, ...) int
- func (rss *ReelsStats) GetReelLength(reelindex int) int
- func (rss *ReelsStats) GetReelLengthNoSymbol(reelindex int, symbol SymbolType, wilds []SymbolType) int
- func (rss *ReelsStats) GetScatterNum(reelindex int, symbol SymbolType, irstype InReelSymbolType, height int) int
- func (rss *ReelsStats) GetSymbolNum(reelindex int, symbol SymbolType, wilds []SymbolType) int
- func (rss *ReelsStats) GetSymbolNumNoWild(reelindex int, symbol SymbolType, wilds []SymbolType) int
- func (rss *ReelsStats) HasSymbols(symbol SymbolType) bool
- func (rss *ReelsStats) SaveExcel(fn string) error
- type SymbolStats
- type SymbolType
- type SymbolWinsStats
- type SymbolsMapping
- type SymbolsWinsFileMode
- type SymbolsWinsStats
- func AnalyzeReelsScatter(paytables *sgc7game.PayTables, reels *sgc7game.ReelsData, symbols []SymbolType, ...) (*SymbolsWinsStats, error)
- func AnalyzeReelsScatterEx(paytables *sgc7game.PayTables, rss *ReelsStats, symbols []SymbolType, ...) (*SymbolsWinsStats, error)
- func AnalyzeReelsWithLine(paytables *sgc7game.PayTables, reels *sgc7game.ReelsData, symbols []SymbolType, ...) (*SymbolsWinsStats, error)
- func AnalyzeReelsWithLineEx(paytables *sgc7game.PayTables, rss *ReelsStats, symbols []SymbolType, ...) (*SymbolsWinsStats, error)
- func NewSymbolsWinsStats(num int) *SymbolsWinsStats
- func (ssws *SymbolsWinsStats) Clone() *SymbolsWinsStats
- func (ssws *SymbolsWinsStats) CountRTP() float64
- func (ssws *SymbolsWinsStats) GetSymbolWinsStats(symbol SymbolType) *SymbolWinsStats
- func (ssws *SymbolsWinsStats) IsFine() bool
- func (ssws *SymbolsWinsStats) Merge(ssws1 *SymbolsWinsStats)
- func (ssws *SymbolsWinsStats) MergeWithMulti(ssws1 *SymbolsWinsStats, multi int)
- func (ssws *SymbolsWinsStats) SaveExcel(fn string, fms []SymbolsWinsFileMode) error
- func (ssws *SymbolsWinsStats) SaveExcelSheet(f *excelize.File, fm SymbolsWinsFileMode) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnkonow - unknow error ErrUnkonow = errors.New("unknow error") // ErrInvalidReel - invalid reel ErrInvalidReel = errors.New("invalid reel") // ErrInvalidInReelSymbolType - invalid InReelSymbolType ErrInvalidInReelSymbolType = errors.New("invalid InReelSymbolType") // ErrInvalidReelsStatsExcelFile - invalid ReelsStats excel file ErrInvalidReelsStatsExcelFile = errors.New("invalid ReelsStats excel file") // ErrInvalidReelsStatsExcelColname - invalid ReelsStats excel colname ErrInvalidReelsStatsExcelColname = errors.New("invalid ReelsStats excel colname") // ErrNoValidSymbols - no valid symbols ErrNoValidSymbols = errors.New("no valid symbols") // ErrValidParamInAutoChgWeights - invalid param in AutoChgWeights ErrValidParamInAutoChgWeights = errors.New("invalid param in AutoChgWeights") // ErrInvalidDataInAGRDataList - invalid data in agrDataList ErrInvalidDataInAGRDataList = errors.New("invalid data in agrDataList") // ErrNoResultInAutoChgWeights - no result in AutoChgWeights ErrNoResultInAutoChgWeights = errors.New("no result in AutoChgWeights") )
Functions ¶
func AnalyzeWeights ¶
func AnalyzeWeights[T int | float32 | float64](vw *sgc7game.ValWeights, runner FuncRunnerWithValWeights[T]) (*sgc7game.ValMapping[int, T], error)
func AutoChgWeights ¶
func AutoChgWeights[T int | float32 | float64](vw *sgc7game.ValWeights, target T, runner FuncRunnerWithValWeights[T], precision int) (*sgc7game.ValWeights, error)
func AutoGenReels ¶
func AutoGenReels(w, h int, paytables *sgc7game.PayTables, syms []SymbolType, wilds []SymbolType, totalBet int, lineNum int) (*sgc7game.ReelsData, error)
func CalcScatterWinsInReels ¶
func CalcScatterWinsInReels(paytables *sgc7game.PayTables, rss *ReelsStats, symbol SymbolType, num int, height int) (int64, error)
CalcScatterWinsInReels -
func CalcSymbolWins ¶
func CalcSymbolWins(rss *ReelsStats, wilds []SymbolType, symbol SymbolType, symbol2 SymbolType, lst []InReelSymbolType) (int64, error)
lst is like [S, W, S+W, No S+W, All]
func CalcSymbolWinsInReelsWithLine ¶
func CalcSymbolWinsInReelsWithLine(paytables *sgc7game.PayTables, rss *ReelsStats, symbols []SymbolType, wilds []SymbolType, symbol SymbolType, num int, wildPayoutSymbol SymbolType) (int64, error)
CalcSymbolWinsInReelsWithLine - symbol 不可能是 wild
func FindSymbol ¶
func FindSymbol(symbols []SymbolType, symbol SymbolType) int
func GenReelsMainSymbolsDistance ¶
func GenReelsMainSymbolsDistance(rss *ReelsStats, mainSymbols []SymbolType, minoff int, trytimes int) (*sgc7game.ReelsData, error)
随机,主要符号需要尽量分散开
func HasSymbol ¶
func HasSymbol(symbols []SymbolType, symbol SymbolType) bool
func IsFirstWild ¶
func IsFirstWild(lst []InReelSymbolType, num int) bool
Types ¶
type InReelSymbolType ¶
type InReelSymbolType int
const ( IRSTypeAll InReelSymbolType = 0 IRSTypeSymbol InReelSymbolType = 1 IRSTypeWild InReelSymbolType = 2 IRSTypeSymbolAndWild InReelSymbolType = 3 IRSTypeNoSymbolAndNoWild InReelSymbolType = 4 IRSTypeNoWild InReelSymbolType = 5 IRSTypeNoSymbol InReelSymbolType = 6 IRSTypeSymbol2 InReelSymbolType = 7 IRSTypeSymbol2AndWild InReelSymbolType = 8 )
func NewInReelSymbolTypeArr ¶
func NewInReelSymbolTypeArr(num int) []InReelSymbolType
type ReelStats ¶
type ReelStats struct { MapSymbols map[SymbolType]*SymbolStats TotalSymbolNum int }
func BuildReelStats ¶
func BuildReelStats(reel []int, mapSymbols *SymbolsMapping) (*ReelStats, error)
func NewReelStats ¶
func NewReelStats() *ReelStats
func (*ReelStats) AddSymbol ¶
func (rs *ReelStats) AddSymbol(symbol SymbolType, num int)
func (*ReelStats) BuildSymbols ¶
func (rs *ReelStats) BuildSymbols(excludeSymbols []SymbolType) []SymbolType
func (*ReelStats) BuildSymbols2 ¶
func (rs *ReelStats) BuildSymbols2(excludeSymbols1 []SymbolType, excludeSymbols2 []SymbolType) []SymbolType
func (*ReelStats) BuildSymbolsEx ¶
func (rs *ReelStats) BuildSymbolsEx(symbols []SymbolType) []SymbolType
func (*ReelStats) BuildSymbolsWithWeights ¶
func (rs *ReelStats) BuildSymbolsWithWeights(excludeSymbols []SymbolType) (*sgc7game.ValWeights, error)
func (*ReelStats) BuildSymbolsWithWeights2 ¶
func (rs *ReelStats) BuildSymbolsWithWeights2(excludeSymbols1 []SymbolType, excludeSymbols2 []SymbolType) (*sgc7game.ValWeights, error)
func (*ReelStats) BuildSymbolsWithWeightsEx ¶
func (rs *ReelStats) BuildSymbolsWithWeightsEx(symbols []SymbolType) (*sgc7game.ValWeights, error)
func (*ReelStats) CountSymbolsNum ¶
func (rs *ReelStats) CountSymbolsNum(symbols []SymbolType) int
func (*ReelStats) GetCanAddSymbols ¶
func (rs *ReelStats) GetCanAddSymbols(symbols []SymbolType) []SymbolType
func (*ReelStats) GetSymbolStats ¶
func (rs *ReelStats) GetSymbolStats(symbol SymbolType) *SymbolStats
func (*ReelStats) GetSymbolWithIndex ¶
func (rs *ReelStats) GetSymbolWithIndex(index int) SymbolType
func (*ReelStats) RemoveSymbol ¶
func (rs *ReelStats) RemoveSymbol(symbol SymbolType, num int) int
type ReelsStats ¶
type ReelsStats struct { Reels []*ReelStats Symbols []SymbolType }
func BuildBasicReelsStats ¶
func BuildBasicReelsStats(reelnum int, paytables *sgc7game.PayTables, excludeSyms []SymbolType) (*ReelsStats, error)
func BuildBasicReelsStatsEx ¶
func BuildBasicReelsStatsEx(reelnum int, syms []SymbolType) (*ReelsStats, error)
func BuildReelsStats ¶
func BuildReelsStats(reels *sgc7game.ReelsData, mapSymbols *SymbolsMapping) (*ReelsStats, error)
func LoadReelsStats ¶
func LoadReelsStats(fn string) (*ReelsStats, error)
func (*ReelsStats) ClearEmptySymbols ¶
func (rss *ReelsStats) ClearEmptySymbols()
func (*ReelsStats) Clone ¶
func (rss *ReelsStats) Clone() *ReelsStats
func (*ReelsStats) CloneWithMapping ¶
func (rss *ReelsStats) CloneWithMapping(mapSymbols *SymbolsMapping) *ReelsStats
func (*ReelsStats) GetNum ¶
func (rss *ReelsStats) GetNum(reelindex int, symbol SymbolType, symbol2 SymbolType, wilds []SymbolType, irstype InReelSymbolType) int
func (*ReelsStats) GetReelLength ¶
func (rss *ReelsStats) GetReelLength(reelindex int) int
func (*ReelsStats) GetReelLengthNoSymbol ¶
func (rss *ReelsStats) GetReelLengthNoSymbol(reelindex int, symbol SymbolType, wilds []SymbolType) int
func (*ReelsStats) GetScatterNum ¶
func (rss *ReelsStats) GetScatterNum(reelindex int, symbol SymbolType, irstype InReelSymbolType, height int) int
func (*ReelsStats) GetSymbolNum ¶
func (rss *ReelsStats) GetSymbolNum(reelindex int, symbol SymbolType, wilds []SymbolType) int
func (*ReelsStats) GetSymbolNumNoWild ¶
func (rss *ReelsStats) GetSymbolNumNoWild(reelindex int, symbol SymbolType, wilds []SymbolType) int
func (*ReelsStats) HasSymbols ¶
func (rss *ReelsStats) HasSymbols(symbol SymbolType) bool
func (*ReelsStats) SaveExcel ¶
func (rss *ReelsStats) SaveExcel(fn string) error
type SymbolStats ¶
type SymbolStats struct { Symbol SymbolType Num int }
type SymbolType ¶
type SymbolType int
type SymbolWinsStats ¶
type SymbolWinsStats struct { Symbol SymbolType WinsNum []int64 Wins []int64 Total int64 }
func (*SymbolWinsStats) Clone ¶
func (sws *SymbolWinsStats) Clone() *SymbolWinsStats
func (*SymbolWinsStats) IsFine ¶
func (sws *SymbolWinsStats) IsFine() bool
func (*SymbolWinsStats) Merge ¶
func (sws *SymbolWinsStats) Merge(sws1 *SymbolWinsStats)
func (*SymbolWinsStats) MergeWithMulti ¶
func (sws *SymbolWinsStats) MergeWithMulti(sws1 *SymbolWinsStats, multi int)
type SymbolsMapping ¶
type SymbolsMapping struct {
MapSymbols map[SymbolType]SymbolType
}
func NewSymbolsMapping ¶
func NewSymbolsMapping() *SymbolsMapping
func (*SymbolsMapping) Add ¶
func (mapSymbols *SymbolsMapping) Add(src SymbolType, dest SymbolType)
func (*SymbolsMapping) Has ¶
func (mapSymbols *SymbolsMapping) Has(s SymbolType) bool
type SymbolsWinsFileMode ¶
type SymbolsWinsFileMode int
const ( SWFModeRTP SymbolsWinsFileMode = 1 SWFModeWins SymbolsWinsFileMode = 2 SWFModeWinsNum SymbolsWinsFileMode = 3 )
type SymbolsWinsStats ¶
type SymbolsWinsStats struct { MapSymbols map[SymbolType]*SymbolWinsStats Symbols []SymbolType Num int TotalBet int64 TotalWins int64 }
func AnalyzeReelsScatter ¶
func AnalyzeReelsScatter(paytables *sgc7game.PayTables, reels *sgc7game.ReelsData, symbols []SymbolType, mapSymbols *SymbolsMapping, height int) (*SymbolsWinsStats, error)
func AnalyzeReelsScatterEx ¶
func AnalyzeReelsScatterEx(paytables *sgc7game.PayTables, rss *ReelsStats, symbols []SymbolType, height int) (*SymbolsWinsStats, error)
func AnalyzeReelsWithLine ¶
func AnalyzeReelsWithLine(paytables *sgc7game.PayTables, reels *sgc7game.ReelsData, symbols []SymbolType, wilds []SymbolType, mapSymbols *SymbolsMapping, betMul int, lineNum int) (*SymbolsWinsStats, error)
func AnalyzeReelsWithLineEx ¶
func AnalyzeReelsWithLineEx(paytables *sgc7game.PayTables, rss *ReelsStats, symbols []SymbolType, wilds []SymbolType, betMul int, lineNum int) (*SymbolsWinsStats, error)
func NewSymbolsWinsStats ¶
func NewSymbolsWinsStats(num int) *SymbolsWinsStats
func (*SymbolsWinsStats) Clone ¶
func (ssws *SymbolsWinsStats) Clone() *SymbolsWinsStats
func (*SymbolsWinsStats) CountRTP ¶
func (ssws *SymbolsWinsStats) CountRTP() float64
func (*SymbolsWinsStats) GetSymbolWinsStats ¶
func (ssws *SymbolsWinsStats) GetSymbolWinsStats(symbol SymbolType) *SymbolWinsStats
func (*SymbolsWinsStats) IsFine ¶
func (ssws *SymbolsWinsStats) IsFine() bool
func (*SymbolsWinsStats) Merge ¶
func (ssws *SymbolsWinsStats) Merge(ssws1 *SymbolsWinsStats)
func (*SymbolsWinsStats) MergeWithMulti ¶
func (ssws *SymbolsWinsStats) MergeWithMulti(ssws1 *SymbolsWinsStats, multi int)
func (*SymbolsWinsStats) SaveExcel ¶
func (ssws *SymbolsWinsStats) SaveExcel(fn string, fms []SymbolsWinsFileMode) error
func (*SymbolsWinsStats) SaveExcelSheet ¶
func (ssws *SymbolsWinsStats) SaveExcelSheet(f *excelize.File, fm SymbolsWinsFileMode) error
Click to show internal directories.
Click to hide internal directories.