【发布时间】:2013-05-14 01:48:14
【问题描述】:
我想写一个随机数生成算法。但我不希望这些数字是完全随机的。我希望它们依赖于许多不同的因素。我所说的因子是指值在 0 到 1 之间的变量。
所以因素可能是 -
Bounce // 0.56 // Should afffect the outcome by 10% // inversely proportional to outcome
Spin // 0.71 // Should afffect the outcome by 20% // inversely proportional to outcome
Light // 0.99 // Should afffect the outcome by 5% // directly proportional to outcome
Crowd Support // 1.00 // Should afffect the outcome by 5% // directly proportional to outcome
Pressure // 0.89 // Should afffect the outcome by 10% // inversely proportional to outcome
Experience // 0.76 // Should afffect the outcome by 10% // directly proportional to outcome
Skill // 0.56 // Should afffect the outcome by 40% // directly proportional to outcome
现在基于这些因素,我想生成一个 0-6 之间的随机数或一个检票口。
我正在编写这个算法来模拟板球比赛。
我可以采取什么方法来编写这样的算法?
【问题讨论】:
-
变量如何改变结果?值 1 而不是值 0.5,这是什么意思?平均随机结果更高?
-
代码无关紧要。问题是纯数学。你有不同的因素,但你想根据它们计算什么?它们之间有什么关系?
-
@LasseV.Karlsen 因因素而异,技能越高得分越高,压力越大得分越低。
-
@AnkurSharma 问题是没有足够的细节,这是一个讨论类型的问题,因为你需要和某人坐下来进行实验,讨论你得到的结果,修改算法或公式,进行更多实验等。这不是问答问题。公式只有在你计算出来之后才会存在,所以你不能只是要求别人给你。没有人拥有它。
-
@LasseV.Karlsen 同意。我需要用我自己的大脑。感谢您的意见。