Report Builder
Builder for assembling a ReportNode tree using a Kotlin DSL.
Each method corresponds to one ReportNode leaf type and appends a node to the current builder's child list. The section method creates a nested ReportBuilder, applies the user's block, and wraps the result in a ReportNode.Section.
Users never instantiate this class directly — use the top-level report function:
val doc = report("My Report") {
heading("Summary", level = 2)
statTable(myStats, confidenceLevel = 0.90)
section("Details") {
histogram(myHistogram)
plot(myPlot, caption = "Distribution")
}
}KSL-provided extension functions on ReportBuilder (e.g., histogram(), multipleComparison(), simulationResults()) add domain-specific content by calling the primitive methods below, keeping this class small and stable.
All mutable state uses the my prefix per KSL coding conventions.
Functions
Appends a self-contained section containing a goodnessOfFit sub-section for every distribution in results, sorted by overall MODA value (best first).
Appends a self-contained section that first reports the Bootstrap configuration and then delegates to bootstrapEstimate for the statistical results.
Appends a self-contained section reporting the results of a single BootstrapEstimateIfc. No configuration metadata (estimator, stream, antithetic) is emitted here; use bootstrap for Bootstrap instances that require configuration.
Appends a self-contained section summarising a list of BootstrapEstimateIfc objects. Typical sources are ksl.utilities.statistic.BootstrapSampler.bootStrapEstimates and ksl.utilities.statistic.CaseBootstrapSampler.bootStrapEstimates.
Appends a full controls report section for export.
Appends a self-contained section summarising the characteristics of the raw data held by data, with no plots.
Appends a self-contained section containing four exploratory plots for the data held by data.
Appends a "Experiment Configuration" data table derived from ExperimentTableData and a derived replication count.
Appends a single histogram sub-section for one response from the database.
Appends a single histogram section for one in-simulation ksl.modeling.variable.HistogramResponse, fetched from the database by name.
Appends a single integer-frequency sub-section for one response from the database.
Appends a single integer-frequency section for one in-simulation ksl.modeling.variable.IntegerFrequencyResponse, fetched from the database by name.
Appends a "Histogram — responseName" section containing an across-replication statistics table for responseName and (when showPlot is true) a HistogramPlot built from the per-replication observations.
Appends a "Normality — responseName" section containing a normal Q-Q plot and a normal P-P plot of the per-replication values, referenced against a Normal distribution fitted by moment matching (sample mean and variance).
Appends an "Observations — responseName" section containing an ObservationsPlot of the per-replication values in replication order — useful for spotting run-to-run trends or outliers that a histogram hides.
Appends a "Frequencies" section for the named experiment.
Appends a "Histograms" section for the named experiment.
Appends a complete set of sections for the named experiment in the following order:
Appends a "Simulation Summary" section for the named experiment, containing:
Appends a "Time Series Across Replications — responseName" section containing a per-period statistics table (Period, Start, End, Count, Mean, Std Dev, Half Width, CI Lower, CI Upper, Min, Max) and a plot of the mean trajectory.
Appends a "Time Series by Replication — responseName" section overlaying one line per replication, with the period index on the x-axis and the response value on the y-axis.
Appends one across-replication time-series sub-section per distinct time-series response recorded for expName. Emits nothing when the experiment has no stored time-series data.
Appends a "Within-Replication Diagnostics — responseName" section bundling, in order: an across-replication statistics table, a histogram, an observations plot, and normal Q-Q / P-P plots — the full diagnostic set for one response.
Appends a self-contained section reporting the full structure and results of de.
Appends a MultiBoxPlot comparing per-replication distributions across executed design points for a single responseName in de.
Appends a self-contained regression-analysis section for a single response from de.
Appends a self-contained section summarising the characteristics of the integer data held by pmf, with no plots.
Appends a self-contained section reporting the goodness-of-fit results for a single DiscretePMFGoodnessOfFit.
Backward-compatible overload that renders the discrete goodness-of-fit section for a live DiscretePMFGoodnessOfFit, using modeler for the PMF comparison plot's empirical data. Delegates to the PMFFitData renderer.
Appends a self-contained section containing three exploratory plots for the integer data held by pmf. No fitted distribution is assumed.
Appends a self-contained section describing the complete structure of design.
Appends a single section containing a DataTable of all 15 run-configuration fields from params.
Appends a self-contained section reporting the goodness-of-fit results for a single fitted distribution (PDFFitData).
Backward-compatible overload that renders the goodness-of-fit section for a live ScoringResult, using modeler for the bootstrap parameter estimates. Delegates to the PDFFitData renderer.
Appends a self-contained section that reports the bin structure, over/underflow summary, bin frequency table, statistics on binned observations, and a histogram plot.
Overload of histogram that accepts a HistogramIfc reference.
Appends a self-contained section that reports the frequency distribution, summary statistics on the observed integer values, and a frequency bar plot.
Appends a table of JSON controls from controls.
Appends a single section describing the terms of model.
Appends a self-contained section for a MC1DIntegration experiment.
Appends a self-contained section reporting the configuration, convergence diagnostics, and statistical estimate for any MCExperiment.
Appends a single Experiment Configuration section containing a DataTable of all setup parameters for exp.
Appends a single Convergence Diagnostics section for exp.
Appends a self-contained section for a MCMultiVariateIntegration experiment.
Whether this sample is large enough for the component count to be answerable at all.
What was known about the sample before anything was fitted to it.
The recommended mixture, one row per component.
The evidence for and against each candidate count, with the criteria side by side.
Every criterion at every candidate count, and where each one's minimum falls.
Whether the reported density depends on where the cuts between components fell.
The sample the mixtures were fitted to: its statistics, and the structural facts that decide what can be fitted to it.
The four diagnostic panels for the recommendation and, by default, for the best single distribution beside it.
What should make a reader doubt the recommendation.
Whether the fitted density is a fair description of the sample it came from.
Goodness-of-fit tests for the recommended mixture.
How often the recommended component count survives resampling.
The recommendation against the best single distribution.
Appends a self-contained section reporting the results of a live AdditiveMODAModel. This is a thin backward-compatible entry point: it projects the model into a MODAReportData holder via modaReportData and delegates to the moda overload that renders from the holder. See that overload for the section structure produced.
Appends a self-contained section reporting MODA results from a MODAReportData holder. The holder is produced from a live AdditiveMODAModel (via modaReportData) or from a reconstructed/serialized result, so the same standard report renders from either source.
Appends a self-contained section reporting a MODAAnalyzer result.
Appends a self-contained section reporting a MultiBootstrap container: first the container configuration (name, estimator, per-factor n and B), then a bootstrapEstimates section for all internal Bootstrap instances.
Appends a MultiBoxPlot built from pre-assembled observation data.
Appends a self-contained section for a MultipleComparisonAnalyzer.
Appends a MultiBoxPlot comparing the per-replication distributions of all alternatives in mca.
Appends a ConfidenceIntervalsPlot showing the across-replication confidence interval for each alternative's mean.
Appends a table of numeric controls from controls.
Appends one section per replication in repNums for an observation-based (ksl.modeling.variable.Response) ResponseTrace.
Appends a ReportNode.PageBreak separator.
Appends a ReportNode.Paragraph with the given text.
Appends a self-contained section containing residual diagnostics and three standard regression diagnostic plots for rr.
Appends a self-contained section containing the regression coefficient table and a significance summary for rr. No plots are included.
Appends a self-contained section containing the ANOVA decomposition and global model fit measures for rr. No plots are included.
Appends trace sections for a ResponseTrace, auto-selecting the correct visualisation based on ResponseTrace.isTimeWeighted.
Appends a self-contained section reporting the full contents of runner.
Appends a MultiBoxPlot comparing per-replication distributions of a single responseName across the executed scenarios in runner.
Creates a nested section with the given title and appends it to this builder. The block is applied to a new ReportBuilder scoped to the section.
Appends a section containing one sub-section per integer-frequency response collected by the model, each rendered by integerFrequency.
Appends a section containing one sub-section per histogram collected by the model, each rendered by histogram.
Appends a complete simulation results report as a sequence of sections inside the current builder scope, in the following order:
Appends a self-contained section reporting the full contents of run.
Appends a section containing simulation metadata (model name, experiment name, replications, run length, warm-up length) and the across-replication statistics half-width summary table.
Appends a section containing one sub-section per TimeSeriesResponse found in the model, each rendered by timeSeriesResponse.
Appends a completed-snapshot across-replication statistics section.
Appends a single histogram section from snapshot histogram rows.
Appends a single integer-frequency section from snapshot frequency rows.
Appends a run-summary section for the simulation run embedded in an SimulationSnapshot.ExperimentCompleted snapshot.
Appends a "Frequencies" section for a completed snapshot.
Appends a "Histograms" section for a completed snapshot.
Appends the standard completed-snapshot report sections in canonical order.
Appends a "Time-Series Responses" section from completed-snapshot time-series rows.
Convenience overload that reads Solver.solverResult and delegates to solverResult.
Appends a single DataTable enumerating the supplied solver's configuration properties — the structured form of Solver.toString, usable in any ReportBuilder-built document.
Appends a self-contained section reporting the outcome of a simulation optimisation run described by a SolverResult.
Appends a self-contained section that reports the state frequency distribution, summary statistics on the observed state numbers, optional transition matrices, and a frequency bar plot.
Appends one section per replication in repNums for a time-weighted (ksl.modeling.variable.TWResponse) ResponseTrace.
Appends a self-contained section for a single StatisticIfc instance.
Appends a compact single-row ksl.utilities.io.report.ast.ReportNode.StatTable for stat without wrapping it in a section.
Appends a single ksl.utilities.io.report.ast.ReportNode.StatTable for a list of StatisticIfc instances — the most common reporting case for across-replication summary statistics.
Appends a ReportNode.StatPropertyTable — a vertical Property | Value table for a single StatisticIfc.
Appends a ReportNode.StatTable for the given list of StatisticIfc instances.
Appends a table of string controls from controls.
Appends a self-contained section that reports the frequency distribution and an optional frequency bar plot for a StringFrequency tabulation.
A cost-summary section: for each attached CostFormulation, a compact tier × line matrix of average costs (only the tiers and lines the topology actually produces), a TOTAL row, and the formulation's total in each ksl.modeling.supplychain.cost.CostBasis with a confidence half-width. Each line is labelled with its units, because a column holds lines of both denominations and the TOTAL row is not that column's sum. When more than one formulation is attached, a comparison table per basis is appended for the comparative study.
An inventory-performance section: one row per inventory holding point (sorted by level) with the aggregate replication-average on-hand, on-order, backordered, first-fill-rate, and customer wait time.
A topology overview section: a one-line summary plus a node table (name, kind, level, supplier) and an item table (unit cost, weight, cube).
Appends a "Schema" section describing the column structure of any TabularFile.
Appends a "Columns" section for a TabularInputFile with a dedicated sub-section for each column.
Appends the canonical full report for a TabularInputFile: a summary section followed by a per-column detail section.
Appends a "Summary" section for a TabularInputFile containing the column schema, a compact across-column statistics table for all numeric columns, and a distinct/missing count table for all text columns.
Appends a ReportNode.RawText verbatim text block. Rendered as <pre> in HTML, a fenced code block in Markdown, or indented plain text in the text renderer.
Appends a self-contained section that reports the configuration and per-period across-replication statistics for a TimeSeriesResponse.
Appends a single ksl.utilities.io.report.ast.ReportNode.WeightedStatTable for a list of WeightedStatistic instances.
Appends a ReportNode.WeightedStatPropertyTable — a vertical Property | Value table for a single WeightedStatistic.
Appends a ReportNode.WeightedStatTable for the given list of WeightedStatistic instances. WeightedStatistic implements ksl.utilities.statistic.WeightedStatisticIfc rather than StatisticIfc and must flow through this dedicated node. For a single weighted statistic property sheet use weightedStatPropertyTable.
Appends a warm-up analysis section for a WelchFileObserver.
Appends a warm-up analysis section for a WelchDataFileAnalyzer.
Appends a self-contained section reporting the results of a WelchANOVA test.