private static Statistics Operate(Statistics stats, int i, Func <int, int, int> operation) => Operate(stats, null, i, operation);
private static Statistics Operate(Statistics first, Statistics second, Func <int, int, int> operation) => Operate(first, second, 0, operation);
public static double AccountWN8(Dictionary <int, ExpectedValues> expectedValues, Dictionary <int, Statistics> tankStats, out Statistics cumulatedStats) { cumulatedStats = new Statistics(); ExpectedValues cumulatedExpected = new ExpectedValues(); foreach (var pair in tankStats) { if (expectedValues.TryGetValue(pair.Key, out ExpectedValues values)) { cumulatedExpected += values * pair.Value.Battles; cumulatedStats += pair.Value; } } cumulatedExpected /= cumulatedStats.Battles; return(Calculate(cumulatedStats, cumulatedExpected)); }
public static double AccountWN8(IExpectedValueList expectedValueList, string version, Dictionary <int, Statistics> tankStats, out Statistics cumulatedStats) { return(AccountWN8(expectedValueList[version], tankStats, out cumulatedStats)); }
public static double EstimatedAccountWN8Newest(IExpectedValueList expectedValueList, WinrateRecord[] winrateRecords, Statistics cumulatedStats) { return(EstimatedAccountWN8(expectedValueList, expectedValueList.Versions.Max(), winrateRecords, cumulatedStats)); }
public static double EstimatedAccountWN8(IExpectedValueList expectedValueList, string version, WinrateRecord[] winrateRecords, Statistics cumulatedStats) { Dictionary <int, ExpectedValues> expectedValues = expectedValueList[version]; ExpectedValues cumulatedExpected = new ExpectedValues(); foreach (var winrateRecord in winrateRecords) { if (expectedValues.TryGetValue(winrateRecord.TankID, out ExpectedValues values)) { cumulatedExpected += values * winrateRecord.Battles; } } cumulatedExpected /= cumulatedStats.Battles; return(Calculate(cumulatedStats, cumulatedExpected)); }