SimulationResults
namespace Griff.Simulations;
public sealed class SimulationResultsWhat came of a Simulation: for each step of its sweep (one without), each pair of rows’ wins, losses and draws, turns and seconds, damage dealt and taken, gold and XP earned and the values tracked, averaged over its runs, with each side’s health and the tracked values over a run; as tables (ToTable, Matrix, SweepTable, OverARun) to show, chart and export, and Findings saying what stands out: one-sided pairs, rows far from the rest, levels that change nothing and levels that jump.
Properties
Section titled “Properties”Elapsed
Section titled “Elapsed”public TimeSpan Elapsed { get; }How long they took.
Findings
Section titled “Findings”public IReadOnlyList<string> Findings { get; }What stands out, most striking first: one-sided pairs, rows far from the rest, dead levels and jumps.
FirstLabel
Section titled “FirstLabel”public string FirstLabel { get; }What the first side is called: its table’s name (“Classes”), or its entity’s.
GameSteps
Section titled “GameSteps”public long GameSteps { get; }How many steps the runs’ games took in all.
IsSceneRun
Section titled “IsSceneRun”public bool IsSceneRun { get; }True if it played a whole scene each run (see Scene), rather than fights.
Measures
Section titled “Measures”public IReadOnlyList<string> Measures { get; }What each pair has a value of: Win %, Loss %, Draw %, Turns, Seconds, Turns to Win, Seconds to Win, Damage Dealt, Damage Taken, then what the first side earned (Gold, XP) and the values tracked.
PointLabel
Section titled “PointLabel”public string PointLabel { get; }What each point of a value over a run is: “Turn” (each turn of a fight, or each second), or “Second” when they’re taken every so many seconds (named by the second of game time each is at).
SecondLabel
Section titled “SecondLabel”public string SecondLabel { get; }What the second side is called (“Enemies”).
Simulation
Section titled “Simulation”public Simulation Simulation { get; }The simulation as it was played.
public IReadOnlyList<SimulationStepResults> Steps { get; }Each step of the sweep, in order; one without a sweep.
StepsPerSecond
Section titled “StepsPerSecond”public double StepsPerSecond { get; }How many game steps were played a second of real time, all the threads together.
Summary
Section titled “Summary”public string Summary { get; }A line saying what was played and how it went: “1,800 runs in 1.2 s on 16 threads. Classes win 61% of fights against Enemies, in 4.2 turns.”
SweepLabel
Section titled “SweepLabel”public string? SweepLabel { get; }The sweep’s column, e.g. “Level”, or null without a sweep.
Threads
Section titled “Threads”public int Threads { get; }How many threads shared them.
TotalRuns
Section titled “TotalRuns”public int TotalRuns { get; }How many runs were played in all.
Warnings
Section titled “Warnings”public IReadOnlyList<string> Warnings { get; }What the games said as they played (a Table Values naming a column the table hasn’t got), each once.
Methods
Section titled “Methods”Matrix
Section titled “Matrix”public Table Matrix(int step = 0, string measure = "Win %")Every pair at step: a row for each of the first side’s rows, a column for each of the second’s, each cell the pair’s measure (its win rate by default): the matrix.
Number
Section titled “Number”public static string Number(double value)A number as the results write it: at most two places, trailing zeros dropped (4.25, 61.5, 12).
OverARun
Section titled “OverARun”public Table OverARun(int step, int first, int second)A pair’s values over a run, averaged over its runs: a row for each point (each turn, or each second without turns; named 1, 2, 3…; or every Track Every seconds, named by the second each is at: 0, 240, 480…), a column for each value (each side’s health, gold and XP earned, the tracked values).
OverTime
Section titled “OverTime”public Table OverTime()Every pair’s values over a run at every step, every point of them: a row for each point (named as in OverARun), a column for each pair’s each value (“Hire Early: Cash”, “Base Rent 300: Hire Early: Cash” in a sweep). What exporting the results writes beside them for values tracked every so many seconds.
PairName
Section titled “PairName”public string PairName(SimulationPairResult pair)What a pair is called: “Warrior vs Slime”, or in a scene run with no second table just its first row (“Hire Early”), or the scene’s name.
Percent
Section titled “Percent”public static string Percent(double value)A share out of 100 as the results write it: 61%, 4.5%.
StepAt
Section titled “StepAt”public SimulationStepResults? StepAt(double? value)The step whose sweep value is value (or the only one), or null.
SweepTable
Section titled “SweepTable”public Table SweepTable(string measure = "Win %")The sweep: a row for each step, named by its value (“1”, “2”, “3”, so it charts as a line over the levels), a column for all the first side’s rows together and one for each, each cell the measure averaged over the second side’s rows.
ToTable
Section titled “ToTable”public Table ToTable(int step = -1)A row a pair (“Warrior vs Slime”, “Level 3: Warrior vs Slime” in a sweep), with its sides’ rows, the sweep’s value and every measure: the results table. step -1 has every step’s pairs.
Fields
Section titled “Fields”WinRate
Section titled “WinRate”public const string WinRateThe measure that says how one-sided a pair is: the share of fights the first side won.