本文整理汇总了C#中Parameters.Ibeta方法的典型用法代码示例。如果您正苦于以下问题:C# Parameters.Ibeta方法的具体用法?C# Parameters.Ibeta怎么用?C# Parameters.Ibeta使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parameters
的用法示例。
在下文中一共展示了Parameters.Ibeta方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCombinedUptimeCombinations
private static void GetCombinedUptimeCombinations(Parameters p, float t, int index)
{
// Up time(x) = sum_r=0..inf Ibeta(r+1, x - r * cooldown, p) - Ibeta(r+1, x - duration - r * cooldown, p)
// t := x * interval
// Uptime(t) = sum_r=0..inf Ibeta(r+1, t / interval - r * cooldown / interval, p) - Ibeta(r+1, t / interval - duration / interval - r * cooldown / interval, p)
for (int i = 0; i < p.N; i++)
{
if (p.triggerInterval[i] == 0.0f)
{
float x = t - p.o[i]; // on use effects start straight on offset and then every cooldown
if (x >= 0 && x % p.c[i] < p.d[i])
{
p.uptime[i] = 1.0f;
}
else
{
p.uptime[i] = 0.0f;
}
}
else
{
float x = t / p.triggerInterval[i] - p.o[i];
if (p.c[i] == 0.0f)
{
// support for cooldown = 0
if (p.d[i] <= 1.0f)
{
p.uptime[i] = p.d[i] * p.p[i];
}
else
{
p.uptime[i] = 1.0f - (float)Math.Pow(1f - p.p[i], Math.Min(x, p.d[i]));
}
}
else
{
// normal case for duration < cooldown
p.uptime[i] = 0.0f;
int r = 1;
while (x > 0)
{
p.uptime[i] += p.Ibeta(r, x, p.p[i]);
float xd = x - p.d[i];
if (xd > 0)
{
p.uptime[i] -= p.Ibeta(r, xd, p.p[i]);
}
r++;
x -= p.c[i];
}
}
}
}
for (int i = 0; i < p.NC; i++)
{
p.combinedUptime[index, i] = 1.0f;
for (int j = 0; j < p.N; j++)
{
if ((i & (1 << j)) == 0)
{
p.combinedUptime[index, i] *= (1.0f - p.uptime[j] * p.k[j]);
}
else
{
p.combinedUptime[index, i] *= p.uptime[j] * p.k[j];
}
}
}
}
示例2: GetCombinedUptime
private static float GetCombinedUptime(Parameters p, float t)
{
// Uptime(x) = sum_r=0..inf Ibeta(r+1, x - r * cooldown, p) - Ibeta(r+1, x - duration - r * cooldown, p)
// t := x * interval
// Uptime(t) = sum_r=0..inf Ibeta(r+1, t / interval - r * cooldown / interval, p) - Ibeta(r+1, t / interval - duration / interval - r * cooldown / interval, p)
float combinedUptime = 1.0f;
for (int i = 0; i < p.effects.Length; i++)
{
float x = t / p.triggerInterval[i] - p.o[i];
float uptime = 0.0f;
int r = 1;
while (x > 0)
{
uptime += p.Ibeta(r, x, p.p[i]);
float xd = x - p.d[i];
if (xd > 0)
{
uptime -= p.Ibeta(r, xd, p.p[i]);
}
r++;
x -= p.c[i];
}
combinedUptime *= uptime;
}
return combinedUptime;
}