private double Reward(Work work) { var usedRating = work.UsedRating(); var rating = usedRating.Id().Filled() ? usedRating.Value() : _formula.DefaultRating(); var percentile = _formula.WinProbabilityOfA(rating, _formula.DefaultRating()); var additions = Math.Min(work.Additions(), 250); return(additions / (1d - percentile)); }
private void PrintWorkToConsole(Output output, Work work) { output.WriteLine($"Author: <{work.Author().Email()}>"); output.WriteLine($"base: {work.Start()}"); output.WriteLine($"head: {work.End()}"); if (work.Since() is object) { output.WriteLine($"Since: {work.Since()}"); } if (work.Link() is object) { output.WriteLine($"Link: {work.Link()}"); } output.WriteLine($"Additions: {work.Additions()}"); output.WriteLine($"Reward: {Reward(work):F2}"); PrintWorkRatingsToConsole(output, work); }