private void PrintCumulative(RunArguments args, CumulativeResult result) { this._outputService.Write("\r \n"); this._outputService.WriteLine($"Results out of {args.Groups} sets of {args.Iterations}"); this._outputService.WriteLine("-----------------------------------------------------------"); this._outputService.WriteLine($"Banner: {this.SelectedGacha.Name}"); this._outputService.WriteLine($"Pull: {this.SelectedPull.Name}"); this._outputService.WriteLine("-----------------------------------------------------------"); this._outputService.WriteLine($"Min Rainbows: {result.MinRainbows}"); this._outputService.WriteLine($"Min On-Banner Rainbows: {result.MinOnBanner} ({result.MinOnBannerPercentage}%) - ({result.MinOnBannerCount} times)"); this._outputService.WriteLine($"Min Off-Banner Rainbows: {result.MinOffBanner} ({result.MinOffBannerPercentage}%)"); this._outputService.WriteLine("-----------------------------------------------------------"); this._outputService.WriteLine($"Max Rainbows: {result.MaxRainbows}"); this._outputService.WriteLine($"Max On-Banner Rainbows: {result.MaxOnBanner} ({result.MaxOnBannerPercentage}%)"); this._outputService.WriteLine($"Max Off-Banner Rainbows: {result.MaxOffBanner} ({result.MaxOffBannerPercentage}%)"); }
public void Execute(params string[] args) { var arguments = RunArguments.From(args); Randomizer.Refresh = arguments.RngRefresh; Randomizer.Method = arguments.RngMethod; this.SelectedGacha = this._configService.GetGacha(arguments.Banner ?? "STD"); this.SelectedPull = this._configService.GetPull(arguments.Pull ?? "3*"); if (this.SelectedGacha == null) { throw new HelpException("-b", $"Unknown banner code {arguments.Banner}"); } if (this.SelectedPull == null) { throw new HelpException("-p", $"Unknown pull code {arguments.Banner}"); } int groups = Math.Max(0, arguments.Groups); if (groups > 0) { this._outputService.Write("Running simulation, group {0} of {1}, iteration {2} of {3}", 0, arguments.Groups, 0, arguments.Iterations); CumulativeResult result = new CumulativeResult(); for (int i = 0; i < groups; i++) { result.Groups.Add(this.RunGroup(arguments, false, i + 1)); } this.PrintCumulative(arguments, result); } else { this._outputService.Write("Running simulation, iteration {0} of {1}", 0, arguments.Iterations); this.RunGroup(arguments); } }