如何计算每个球员的最长连胜纪录
我有一个名为 TournamentXPlayer 的 mySQL 扑克数据库,其中包含一个名为 TournamentXPlayerID 的主索引以及 TournamentID、PlayerID、Finish 和 Payout。 我一直在寻找方法来计算每个玩家获得现金奖励的最长连续记录。后来我想包括其他一些东西,比如球员的个人连胜记录(并非所有球员都参加每场比赛,但有些球员在参加比赛时表现得非常好)、最长的连胜记录,甚至最长的连胜记录。然而目前我根本不知道如何最好地计算连胜。 这可以做到吗?
谢谢 特里
I have a mySQL poker database called TournamentXPlayer that contains a primary index called TournamentXPlayerID and TournamentID, PlayerID, Finish, and Payout.
I've been looking at ways to count each players longest streak of finishing with a cash prize. Later I would like to include other things like a players personal streak (Not all player play every game but some do really well when they do play), longest winning streaks, and even longest streak without winning a prize. However at the moment I can't work out how best to count a streak at all.
Can this be done?
Thanks
Terry
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我假设tournamentID 会自动递增,因此它提供了数据的时间顺序。
这是组内排序的经典问题。为此,您需要考虑以下变量:
在本例中,etap 为:
I assumed that tournamentID is automatically incremented so it provides the chronology of the data.
This is the classic problem of the order by inside a group. For that purpose, you need to consider variables such as :
In this example, the etaps are :
当您要计算连胜数时,您需要知道玩家完成锦标赛的时间。否则,如果玩家进行多桌比赛,您将得到错误的结果,因为他可能在一场超级筹码锦标赛中玩了 15 个小时并获得了奖金,同时注册并退出了多个超级筹码锦标赛。您可以按 ID(相对于开始时间)对锦标赛进行排序,但如果您没有时间,当玩家完成时,您将永远不会得到正确的结果。
如果我们假设玩家根本不参加多桌比赛,则使用以下算法:
留下评论,如果您有问题,我将编辑/完成我的答案
When You are going to calculate streaks, You need to know the time, when a player finished the tournament. Otherwise, You will get wrong results if a players is multitabling, because, he might be playing one superstack tourney for 15 hours and finish in the money and in the meanwhile register and drop out of multiple hyperturbo tourneys. You can sort the tournaments by ID-s (relative to starting time), but You'll never get the right result, if You don't have the time, when player finished.
If we assume, that players don't multitable at all, then use the following algorithm:
Leave a comment, if You got questions, I will edit/complete my answer