toReport

fun BatchStatistic.toReport(title: String = name, confidenceLevel: Double = 0.95, block: ReportBuilder.() -> Unit = { batchStatistic(this@toReport, confidenceLevel = confidenceLevel) }): ReportNode.Document(source)

Builds a ReportNode.Document whose default content is the full batch-statistic section (batch configuration table and statistics on batch means).

Zero-code path:

myBatchStat.toReport().showInBrowser()
myBatchStat.toReport().writeMarkdown()

Custom block replaces the default:

myBatchStat.toReport("Queue Length Analysis") {
batchStatistic(this@toReport) // standard section
paragraph("Confidence interval is tight enough for decision.")
}

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to BatchStatistic.name

confidenceLevel

confidence level for half-width and CI columns; must be in (0, 1)

block

optional DSL block; replaces the default when provided


fun BootstrapEstimateIfc.toReport(title: String = "Bootstrap Analysis ", confidenceLevel: Double = 0.95, showDensityPlot: Boolean = false, block: ReportBuilder.() -> Unit = { bootstrapEstimate(this@toReport, confidenceLevel = confidenceLevel, showDensityPlot = showDensityPlot) }): ReportNode.Document(source)

Builds a ReportNode.Document containing a single-estimate bootstrap report via bootstrapEstimate. Does not include configuration metadata; use Bootstrap.toReport for Bootstrap instances.

Zero-code path:

val be = BootstrapEstimate(name, n, estimate, replicates)
be.toReport().showInBrowser()

Return

the assembled ReportNode.Document

Parameters

title

document title

confidenceLevel

confidence level for CI computations; must be in (0, 1)

showDensityPlot

when true, appends a histogram of the bootstrap replicates

block

optional DSL block; replaces the default when provided


fun Bootstrap.toReport(title: String = "Bootstrap Analysis ", confidenceLevel: Double = 0.95, showDensityPlot: Boolean = false, block: ReportBuilder.() -> Unit = { bootstrap(this@toReport, confidenceLevel = confidenceLevel, showDensityPlot = showDensityPlot) }): ReportNode.Document(source)

Builds a ReportNode.Document containing a full bootstrap report (configuration

Zero-code path:

val bs = Bootstrap(data, BSEstimatorIfc.Average())
bs.generateSamples(999)
bs.toReport().showInBrowser()

Custom block:

bs.toReport("Mean Bootstrap — Waiting Time") {
bootstrap(bs, showDensityPlot = true)
paragraph("The BCa interval is preferred for skewed estimators.")
}

Return

the assembled ReportNode.Document

Parameters

title

document title

confidenceLevel

confidence level for CI computations; must be in (0, 1)

showDensityPlot

when true, appends a histogram of the bootstrap replicates

block

optional DSL block; replaces the default when provided


fun List<BootstrapEstimateIfc>.toReport(title: String = "Bootstrap Estimates", confidenceLevel: Double = 0.95, showDetail: Boolean = false, showDensityPlot: Boolean = false, block: ReportBuilder.() -> Unit = { bootstrapEstimates(this@toReport, confidenceLevel = confidenceLevel, showDetail = showDetail, showDensityPlot = showDensityPlot) }): ReportNode.Document(source)

Builds a ReportNode.Document containing a bootstrap estimates list report via bootstrapEstimates. Intended for the output of ksl.utilities.statistic.BootstrapSampler.bootStrapEstimates and ksl.utilities.statistic.CaseBootstrapSampler.bootStrapEstimates.

Zero-code path:

val estimates = BootstrapSampler(data, BasicStatistics()).bootStrapEstimates(999)
estimates.toReport("Basic Statistics Bootstrap").showInBrowser()

Return

the assembled ReportNode.Document

Parameters

title

document title

confidenceLevel

confidence level for CI computations; must be in (0, 1)

showDetail

when true, appends a full bootstrapEstimate sub-section per estimate

showDensityPlot

passed through to each bootstrapEstimate when showDetail is true

block

optional DSL block; replaces the default when provided


fun MultiBootstrap.toReport(title: String = "Multi-Bootstrap Analysis ", confidenceLevel: Double = 0.95, showDetail: Boolean = false, showDensityPlot: Boolean = false, block: ReportBuilder.() -> Unit = { multiBootstrap(this@toReport, confidenceLevel = confidenceLevel, showDetail = showDetail, showDensityPlot = showDensityPlot) }): ReportNode.Document(source)

Builds a ReportNode.Document containing a full multi-bootstrap report via multiBootstrap.

Zero-code path:

val mb = MultiBootstrap(dataMap = mapOf("System A" to dataA, "System B" to dataB))
mb.generateSamples(999)
mb.toReport().showInBrowser()

Custom block:

mb.toReport("Throughput Comparison") {
multiBootstrap(mb, showDetail = true, showDensityPlot = true)
paragraph("Both systems have overlapping percentile CIs at the 95% level.")
}

Return

the assembled ReportNode.Document

Parameters

title

document title

confidenceLevel

confidence level for CI computations; must be in (0, 1)

showDetail

when true, appends per-factor bootstrapEstimate sub-sections

showDensityPlot

when true and showDetail is true, appends replicate histograms

block

optional DSL block; replaces the default when provided


fun Controls.toReport(title: String? = null, groupByElement: Boolean = false, includeAllowedValues: Boolean = true, jsonValueWidth: Int = 60, includeComment: Boolean = true, block: ReportBuilder.() -> Unit = run { val export = this.exportAll() val lambda: ReportBuilder.() -> Unit = { controlsReport( export = export, groupByElement = groupByElement, includeAllowedValues = includeAllowedValues, jsonValueWidth = jsonValueWidth, includeComment = includeComment, ) } lambda }): ReportNode.Document(source)

Builds a ReportNode.Document for this Controls instance.

Controls.exportAll is called once to snapshot the current state; the resulting ModelControlsExport is passed to controlsReport.

The default block calls controlsReport with the supplied parameters. A custom block replaces the default content entirely.

Zero-code usage:

model.controls().toReport().showInBrowser()
model.controls().toReport(groupByElement = true).writeMarkdown()

Custom block:

model.controls().toReport("Pharmacy Model — Parameters") {
paragraph("Controls captured before replication 1.")
val export = this@toReport.exportAll()
numericControlsTable(export.numericControls)
stringControlsTable(export.stringControls, includeAllowedValues = false)
}

Parameters

title

document title; defaults to "${modelName} — Controls"

groupByElement

true for element-grouped layout

includeAllowedValues

passed through to stringControlsTable

jsonValueWidth

passed through to jsonControlsTable

includeComment

passed through to all three table methods

block

optional DSL block; replaces the default content when provided


fun ModelControlsExport.toReport(title: String? = null, groupByElement: Boolean = false, includeAllowedValues: Boolean = true, jsonValueWidth: Int = 60, includeComment: Boolean = true, block: ReportBuilder.() -> Unit = { controlsReport( export = this@toReport, groupByElement = groupByElement, includeAllowedValues = includeAllowedValues, jsonValueWidth = jsonValueWidth, includeComment = includeComment, ) }): ReportNode.Document(source)

Builds a ReportNode.Document for this ModelControlsExport.

Enables offline reporting from a saved JSON snapshot without a live model:

val export = Controls.exportJson.decodeFromString<ModelControlsExport>(savedJson)
export.toReport().showInBrowser()

The default block calls controlsReport with the supplied parameters. A custom block replaces the default content entirely.

Parameters

title

document title; defaults to "${modelName} — Controls"

groupByElement

true for element-grouped layout

includeAllowedValues

passed through to stringControlsTable

jsonValueWidth

passed through to jsonControlsTable

includeComment

passed through to all three table methods

block

optional DSL block; replaces the default content when provided


fun DesignedExperimentIfc.toReport(title: String = "Designed Experiment ", confidenceLevel: Double = 0.95, coded: Boolean = false, showDetails: Boolean = false, boxPlotResponses: List<String> = emptyList(), block: ReportBuilder.() -> Unit = { designedExperiment(this@toReport, confidenceLevel, coded, showDetails, boxPlotResponses) }): ReportNode.Document(source)

Builds a ReportNode.Document containing a full designed experiment report for any implementation of DesignedExperimentIfc.


fun DesignedExperiment.toReport(title: String = "Designed Experiment ", confidenceLevel: Double = 0.95, coded: Boolean = false, showDetails: Boolean = false, boxPlotResponses: List<String> = emptyList(), block: ReportBuilder.() -> Unit = { designedExperiment(this@toReport, confidenceLevel, coded, showDetails, boxPlotResponses) }): ReportNode.Document(source)

Builds a ReportNode.Document containing a full designed experiment report via designedExperiment.

Zero-code path:

de.simulateAll(numRepsPerDesignPoint = 10)
de.toReport("R-Q Inventory Experiment").showInBrowser()

Coded scale with per-point details:

de.toReport("Response Surface Study", coded = true, showDetails = true)
.showInBrowser()

Custom block:

de.toReport("Factorial Study") {
designedExperiment(this@toReport, coded = true)
paragraph("Regression analysis follows in the next section.")
}

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to the experiment name

confidenceLevel

confidence level for response statistics; defaults to 0.95

coded

false (default) = original scale; true = coded scale for the design point matrix

showDetails

true includes per-design-point simulationRun sections; defaults to false

boxPlotResponses

list of response names for which a MultiBoxPlot is included; defaults to empty (no box plots); pass DesignedExperiment.responseNames for all responses

block

optional DSL block; replaces the default when provided


fun ExperimentalDesignIfc.toReport(title: String = "Experimental Design", coded: Boolean = false, block: ReportBuilder.() -> Unit = { experimentalDesign(this@toReport, coded) }): ReportNode.Document(source)

Builds a ReportNode.Document containing a full experimental-design report via experimentalDesign.

Zero-code path:

val fd = FactorialDesign(setOf(factorA, factorB, factorC))
fd.toReport("My Factorial Design").showInBrowser()

Custom block (design on coded scale + linear model in one document):

ccd.toReport("Response Surface Setup") {
experimentalDesign(ccd, coded = true)
linearModel(ccd.linearModel(LinearModel.Type.FirstAndSecond))
}

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to "Experimental Design"

coded

false (default) = original scale; true = coded scale

block

optional DSL block; replaces the default when provided


fun Factor.toReport(title: String = name, block: ReportBuilder.() -> Unit = { factor(this@toReport) }): ReportNode.Document(source)

Builds a ReportNode.Document containing a full factor report via factor.

Zero-code path:

val f = Factor("Temperature", doubleArrayOf(100.0, 150.0, 200.0))
f.toReport().showInBrowser()

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to the factor's name

block

optional DSL block; replaces the default when provided


fun LinearModel.toReport(title: String = "Linear Model", block: ReportBuilder.() -> Unit = { linearModel(this@toReport) }): ReportNode.Document(source)

Builds a ReportNode.Document containing a full linear model report via linearModel.

Zero-code path:

val m = LinearModel(setOf("A", "B", "C")).apply { specifyAllTerms() }
m.toReport("Full 3-Factor Model").showInBrowser()

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to "Linear Model"

block

optional DSL block; replaces the default when provided


fun IntegerFrequency.toReport(title: String = name, confidenceLevel: Double = 0.95, block: ReportBuilder.() -> Unit = { integerFrequency(this@toReport, confidenceLevel = confidenceLevel) }): ReportNode.Document(source)

Builds a ReportNode.Document whose default content is the full integer-frequency section (overview paragraph, frequency table, statistics on observed values, and plot).

Zero-code path:

serverCount.toReport().showInBrowser()
serverCount.toReport().writeMarkdown()

Custom block replaces the default:

serverCount.toReport("Number in System") {
integerFrequency(this@toReport) // standard section
paragraph("Mode is ${this@toReport.mode}.")
}

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to IntegerFrequency.name

confidenceLevel

confidence level for the StatTable CI; must be in (0, 1)

block

optional DSL block; replaces the default when provided


fun Histogram.toReport(title: String = name, confidenceLevel: Double = 0.95, block: ReportBuilder.() -> Unit = { histogram(this@toReport, confidenceLevel = confidenceLevel) }): ReportNode.Document(source)

Builds a ReportNode.Document whose default content is the full histogram section (overview paragraph, bin frequency table, statistics on binned data, and plot).

Zero-code path:

myHistogram.toReport().showInBrowser()
myHistogram.toReport().writeMarkdown()

Custom block replaces the default:

myHistogram.toReport("Wait Time Analysis") {
histogram(this@toReport) // standard histogram section
paragraph("Mean is within spec.") // appended after
}

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to Histogram.name

confidenceLevel

confidence level for the StatTable CI; must be in (0, 1)

block

optional DSL block; replaces the default when provided


fun HistogramIfc.toReport(title: String = name, confidenceLevel: Double = 0.95, block: ReportBuilder.() -> Unit = { histogram(this@toReport, confidenceLevel = confidenceLevel) }): ReportNode.Document(source)

Builds a ReportNode.Document for a HistogramIfc instance (e.g. ksl.utilities.statistic.CachedHistogram).

Identical in structure to Histogram.toReport but accepts the interface type, making it usable with histograms obtained from a ksl.simulation.Model via ksl.modeling.variable.HistogramResponseCIfc.histogram.

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to HistogramIfc.name

confidenceLevel

confidence level for the StatTable CI; must be in (0, 1)

block

optional DSL block; replaces the default when provided


fun KSLDatabase.toReport(expName: String, title: String = expName, confidenceLevel: Double = 0.95, showPlots: Boolean = true, block: ReportBuilder.() -> Unit = { dbSimulationResults(this@toReport, expName, confidenceLevel, showPlots) }): ReportNode.Document(source)

Builds a ReportNode.Document for a single named experiment in this database.

The default content is equivalent to calling dbSimulationResults for the named experiment: experiment configuration, across-replication statistics table, histograms (if any), and frequency distributions (if any).

Zero-code path:

val db = KSLDatabase("pharmacy.db")
db.toReport("Experiment 1").showInBrowser()
db.toReport("Experiment 1").writeMarkdown()

Custom block replaces the default — call dbSimulationResults inside the block to include the standard sections alongside additional custom content:

db.toReport("Experiment 1", title = "Pharmacy Study") {
dbSimulationResults(this@toReport, "Experiment 1")
section("Custom Notes") { paragraph("Analysis complete.") }
}

Return

the assembled ReportNode.Document

Parameters

expName

the experiment name to report

title

document title; defaults to the experiment name

confidenceLevel

confidence level for all statistical tables; must be in (0, 1)

showPlots

when true (default) histogram and frequency plots are included

block

optional DSL block; replaces the default when provided


fun KSLDatabase.toReport(title: String = label, confidenceLevel: Double = 0.95, showPlots: Boolean = true): ReportNode.Document(source)

Builds a ReportNode.Document covering all experiments stored in this database.

Each experiment appears as a top-level section inside the document, produced by dbSimulationResults. Experiments are reported in the order returned by KSLDatabase.experimentNames.

Zero-code path:

val db = KSLDatabase("pharmacy.db")
db.toReport().showInBrowser()
db.toReport().writeMarkdown()

When the database contains no experiments a single paragraph noting this is emitted.

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to the database label

confidenceLevel

confidence level for all statistical tables; must be in (0, 1)

showPlots

when true (default) histogram and frequency plots are included


fun MCExperiment.toReport(title: String = "Monte Carlo Experiment", block: ReportBuilder.() -> Unit = { mcExperiment(this@toReport) }): ReportNode.Document(source)

Builds a ReportNode.Document containing a full Monte Carlo experiment report via mcExperiment. Suitable for any MCExperiment, including user-defined subclasses that supply a custom ksl.utilities.mcintegration.MCReplicationIfc.

Zero-code path:

val exp = MCExperiment(myReplication)
exp.runSimulation()
exp.toReport("News Vendor Problem").showInBrowser()

Custom block:

exp.toReport("News Vendor Problem") {
mcExperiment(exp)
paragraph("The optimal order quantity is approximately 30 units.")
}

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to "Monte Carlo Experiment"

block

optional DSL block; replaces the default when provided


fun MC1DIntegration.toReport(title: String = "MC 1D Integration", block: ReportBuilder.() -> Unit = { mc1DIntegration(this@toReport) }): ReportNode.Document(source)

Builds a ReportNode.Document containing a full 1-D integration report via mc1DIntegration (problem setup + configuration + diagnostics + estimate).

Zero-code path:

val mc = MC1DIntegration(SinFunc(), UniformRV(0.0, Math.PI))
mc.runSimulation()
mc.toReport("Sine Integral").showInBrowser()

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to "MC 1D Integration"

block

optional DSL block; replaces the default when provided


fun MCMultiVariateIntegration.toReport(title: String = "MC Multivariate Integration", block: ReportBuilder.() -> Unit = { mcMultiVariateIntegration(this@toReport) }): ReportNode.Document(source)

Builds a ReportNode.Document containing a full multivariate integration report via mcMultiVariateIntegration (problem setup + configuration + diagnostics + estimate).

Zero-code path:

val mc = MCMultiVariateIntegration(MyFunc(), MVIndependentRV(2, UniformRV()))
mc.runSimulation()
mc.toReport("2D Integration Study").showInBrowser()

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to "MC Multivariate Integration"

block

optional DSL block; replaces the default when provided


fun AdditiveMODAModel.toReport(title: String = name.ifBlank { "MODA Results" }, block: ReportBuilder.() -> Unit = { moda(this@toReport) }): ReportNode.Document(source)

Builds a ReportNode.Document whose default content is the full MODA results section for this model (metric definitions, scores/values, rankings).

Zero-code path:

val model = pdfModeler.evaluateScoringResults(scoringResults)
model.toReport().showInBrowser()
model.toReport().writeMarkdown()
model.toReport().printText()

Supply a block to customise or extend the content:

val model = pdfModeler.evaluateScoringResults(scoringResults)
model.toReport("Distribution Fitting Study") {
moda(model)
paragraph("Recommended: ${model.sortedMultiObjectiveValuesByAlternative().first().first}")
}

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to AdditiveMODAModel.name or "MODA Results"

block

optional DSL block; replaces the default when provided


fun MODAAnalyzer.toReport(title: String = "MODA Analysis", confidenceLevel: Double = 0.95, block: ReportBuilder.() -> Unit = { modaAnalysis(this@toReport, confidenceLevel = confidenceLevel) }): ReportNode.Document(source)

Builds a ReportNode.Document whose default content is the full MODA analysis (average performance, average model results, MCB comparisons, rank frequencies).

MODAAnalyzer.analyze must be called before invoking this function.

Zero-code path:

modaAnalyzer.analyze()
modaAnalyzer.toReport().showInBrowser()
modaAnalyzer.toReport().writeMarkdown()
modaAnalyzer.toReport().printText()

Supply a block to customise or extend the content:

modaAnalyzer.analyze()
modaAnalyzer.toReport("System Comparison") {
modaAnalysis(modaAnalyzer, confidenceLevel = 0.90)
paragraph("Conclusion: prefer ${modaAnalyzer.averageMODA().sortedMultiObjectiveValuesByAlternative().first().first}.")
}

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to "MODA Analysis"

confidenceLevel

confidence level for all MCB and screening tables; must be in (0, 1)

block

optional DSL block; replaces the default when provided


fun MultipleComparisonAnalyzer.toReport(title: String = name.ifBlank { "Multiple Comparison Analysis" }, showAltCIPlot: Boolean = false, showBoxPlot: Boolean = false, block: ReportBuilder.() -> Unit = { multipleComparison(this@toReport, showAltCIPlot = showAltCIPlot, showBoxPlot = showBoxPlot) }): ReportNode.Document(source)

Builds a ReportNode.Document whose default content is the full multiple-comparison analysis section using all defaults from the MultipleComparisonAnalyzer object itself (MultipleComparisonAnalyzer.defaultLevel, MultipleComparisonAnalyzer.defaultIndifferenceZone).

Zero-code path:

mca.toReport().showInBrowser()
mca.toReport().writeMarkdown()
mca.toReport().printText()

Supply a block to customise direction, levels, or append additional content:

// Minimum-only with custom indifference zone
mca.toReport("Cost Study") {
multipleComparison(
this@toReport,
direction = MCBDirection.MIN,
indifferenceZone = 5.0
)
}

// Standard full report with a trailing note
mca.toReport("Throughput Study") {
multipleComparison(this@toReport)
paragraph("Recommendation: prefer ${this@toReport.nameOfMaximumAverageOfData}.")
}

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to MultipleComparisonAnalyzer.name or "Multiple Comparison Analysis" when the name is blank

showAltCIPlot

true includes an "Alternative Confidence Intervals" CI-plot sub-section in the default content; defaults to false

showBoxPlot

true includes a "Response Distributions" box-plot sub-section in the default content; defaults to false

block

optional DSL block; replaces the default when provided


fun PDFModeler.toReport(title: String = "Distribution Fitting — Data Analysis", confidenceLevel: Double = 0.95, block: ReportBuilder.() -> Unit = { dataStatisticalSummary(this@toReport, confidenceLevel = confidenceLevel) dataVisualization(this@toReport) }): ReportNode.Document(source)

Builds a ReportNode.Document containing a data exploration report for this PDFModeler — statistical summary and visualization plots — with no fitting results. Suitable for EDA before committing to a fitting run.

Zero-code path:

val modeler = PDFModeler(data)
modeler.toReport().showInBrowser()
modeler.toReport().writeMarkdown()

Custom block (use the captured local variable, not this@toReport):

modeler.toReport("My Data — EDA") {
dataStatisticalSummary(modeler)
dataVisualization(modeler)
paragraph("Data appears right-skewed; consider Exponential or Gamma.")
}

Return

the assembled ReportNode.Document

Parameters

title

document title

confidenceLevel

confidence level for the statistical property sheet

block

optional DSL block; replaces the default when provided


fun PDFModelingResults.toReport(modeler: PDFModeler, title: String = "Distribution Fitting Analysis", confidenceLevel: Double = 0.95, allGOF: Boolean = false, block: ReportBuilder.() -> Unit = { dataStatisticalSummary(modeler, confidenceLevel = confidenceLevel) dataVisualization(modeler) moda(this@toReport.evaluationModel, caption = "MODA Scoring Results") if (allGOF) { allGoodnessOfFit(this@toReport, modeler, confidenceLevel = confidenceLevel) } else { goodnessOfFit(this@toReport.topResultByScore, modeler, confidenceLevel = confidenceLevel) } }): ReportNode.Document(source)

Builds a ReportNode.Document containing a full distribution-fitting report: data statistical summary, visualization plots, MODA scoring results, and goodness-of-fit analysis.

The modeler parameter is required because PDFModelingResults does not hold a back-reference to the PDFModeler that produced it, and the data-exploration sections need the original data.

Zero-code path (GOF for recommended distribution only):

val modeler = PDFModeler(data)
val results = modeler.estimateAndEvaluateScores()
results.toReport(modeler).showInBrowser()
results.toReport(modeler).writeHtml()

Zero-code path (GOF for all fitted distributions):

results.toReport(modeler, allGOF = true).showInBrowser()

Custom block (use the captured local variables, not this@toReport):

results.toReport(modeler, "My Fitting Study") {
dataStatisticalSummary(modeler)
moda(results.evaluationModel, caption = "MODA Scoring")
goodnessOfFit(results.topResultByScore, modeler)
}

Return

the assembled ReportNode.Document

Parameters

modeler

the PDFModeler that produced these results

title

document title

confidenceLevel

confidence level for all CIs and GOF tests; must be in (0, 1)

allGOF

when true GOF is reported for every fitted distribution (sorted by MODA value); when false (default) only the top-ranked distribution's GOF is included

block

optional DSL block; replaces the default when provided


fun PMFModeler.toReport(title: String = "Discrete Distribution Fitting — Data Analysis", confidenceLevel: Double = 0.95, block: ReportBuilder.() -> Unit = { discreteDataSummary(this@toReport, confidenceLevel = confidenceLevel) discreteVisualization(this@toReport) }): ReportNode.Document(source)

Builds a ReportNode.Document containing a discrete data exploration report — statistical summary and visualization plots — with no goodness-of-fit analysis. Suitable for EDA before committing to a specific distribution.

Zero-code path:

val modeler = PMFModeler(data)
modeler.toReport().showInBrowser()
modeler.toReport().writeMarkdown()

Custom block (use the captured local variable, not this@toReport):

modeler.toReport("Arrival Count — EDA") {
discreteDataSummary(modeler)
discreteVisualization(modeler)
paragraph("Data appears Poisson; index of dispersion close to 1.0.")
}

Return

the assembled ReportNode.Document

Parameters

title

document title

confidenceLevel

confidence level for the statistics property sheet

block

optional DSL block; replaces the default when provided


fun DiscretePMFGoodnessOfFit.toReport(modeler: PMFModeler, title: String = "Discrete Distribution Fitting Analysis", confidenceLevel: Double = 0.95, block: ReportBuilder.() -> Unit = { discreteDataSummary(modeler, confidenceLevel = confidenceLevel) discreteVisualization(modeler) discreteGoodnessOfFit(this@toReport, modeler, confidenceLevel = confidenceLevel) }): ReportNode.Document(source)

Builds a ReportNode.Document containing a full discrete distribution fitting report: data statistical summary, visualization plots, and chi-squared goodness-of-fit analysis with a PMF comparison plot.

The modeler parameter is required because DiscretePMFGoodnessOfFit does not hold a back-reference to the PMFModeler that produced it, and the data-exploration sections plus PMFComparisonPlot need the original integer data.

Zero-code path:

val modeler = PMFModeler(data)
val results = modeler.estimateParameters(setOf(PoissonMLEParameterEstimator))
val mean = results.first().parameters!!.doubleParameter("mean")
val gof = PoissonGoodnessOfFit(data.toDoubles(), mean = mean)
gof.toReport(modeler).showInBrowser()

Custom block (use the captured local variables, not this@toReport):

gof.toReport(modeler, "Poisson Fit — Count Data") {
discreteDataSummary(modeler)
discreteGoodnessOfFit(gof, modeler)
paragraph("Poisson fit is acceptable at the 0.05 level.")
}

Return

the assembled ReportNode.Document

Parameters

modeler

the PMFModeler that provided the data

title

document title

confidenceLevel

significance level for the GOF test conclusion; must be in (0, 1)

block

optional DSL block; replaces the default when provided


fun RegressionResultsIfc.toReport(title: String = "Regression Analysis — ", confidenceLevel: Double = 0.95, block: ReportBuilder.() -> Unit = { regressionSummary(this@toReport, confidenceLevel = confidenceLevel) regressionParameters(this@toReport, confidenceLevel = confidenceLevel) regressionDiagnostics(this@toReport) }): ReportNode.Document(source)

Builds a ReportNode.Document containing a full OLS regression report: ANOVA + fit measures, parameter estimates with CIs, and diagnostic plots.

Zero-code path:

val ols = OLSRegression(regressionData)
ols.toReport().showInBrowser()
ols.toReport().writeMarkdown()

Custom block (use the captured local variable, not this@toReport):

ols.toReport("Delivery Time Study") {
regressionSummary(ols)
regressionParameters(ols)
paragraph("Both predictors significant; model explains 96% of variance.")
}

Return

the assembled ReportNode.Document

Parameters

title

document title

confidenceLevel

confidence level for parameter CIs and significance conclusions

block

optional DSL block; replaces the default when provided


fun ResponseTrace.toReport(title: String = name, repNums: List<Int> = replicationNumbers.take(1), startTime: Double = 0.0, endTime: Double = Double.MAX_VALUE, block: ReportBuilder.() -> Unit = { responseTrace(this@toReport, repNums, startTime, endTime) }): ReportNode.Document(source)

Builds a ReportNode.Document for this ResponseTrace.

The default block calls responseTrace, which auto-selects between stateVariableTrace and observationTrace based on ResponseTrace.isTimeWeighted.

Zero-code usage:

myTrace.toReport().showInBrowser()
myTrace.toReport(repNums = listOf(1, 3, 5), startTime = 20.0).writeMarkdown()

Custom block replaces the default:

myTrace.toReport("Queue Analysis") {
paragraph("Drive-through pharmacy — system time trace.")
responseTrace(myTrace, repNums = listOf(1, 2))
}

Parameters

title

document title; defaults to ResponseTrace.name

repNums

replication numbers to include; defaults to the first recorded replication

startTime

lower bound of the time window; defaults to 0.0

endTime

upper bound of the time window; defaults to Double.MAX_VALUE

block

optional DSL block; replaces the default content when provided


fun Scenario.toReport(title: String = "Scenario ", confidenceLevel: Double = 0.95, showTimings: Boolean = false, block: ReportBuilder.() -> Unit = { scenario(this@toReport, confidenceLevel, showTimings) }): ReportNode.Document(source)

Builds a ReportNode.Document containing a standalone scenario report via scenario.

Zero-code path:

scenario.simulate()
scenario.toReport("Queue Baseline").showInBrowser()

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to the scenario name

confidenceLevel

confidence level for response statistics; defaults to 0.95

showTimings

true includes the Replication Timing sub-section; defaults to false

block

optional DSL block; replaces the default when provided


fun ScenarioRunner.toReport(title: String = "Scenario Runner ", confidenceLevel: Double = 0.95, showTimings: Boolean = false, boxPlotResponses: List<String> = emptyList(), block: ReportBuilder.() -> Unit = { scenarioRunner(this@toReport, confidenceLevel, showTimings, boxPlotResponses) }): ReportNode.Document(source)

Builds a ReportNode.Document containing a full scenario runner report via scenarioRunner.

Zero-code path:

runner.simulate()
runner.toReport("Queue Study").showInBrowser()

Custom block:

runner.toReport("Server Count Study") {
paragraph("Three server configurations were compared.")
scenarioRunner(this@toReport, confidenceLevel = 0.99)
}

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to the runner name

confidenceLevel

confidence level for response statistics; defaults to 0.95

showTimings

true includes Replication Timing sub-sections; defaults to false

boxPlotResponses

list of response names for which a cross-scenario ksl.utilities.io.plotting.MultiBoxPlot is included; defaults to empty (no box plots)

block

optional DSL block; replaces the default when provided


fun SimulationReporter.toReport(title: String = "Simulation Report", confidenceLevel: Double = 0.95, block: ReportBuilder.() -> Unit = { simulationSummary(this@toReport, confidenceLevel = confidenceLevel) }): ReportNode.Document(source)

Builds a ReportNode.Document whose default content is the simulation summary section (across-replication statistics table) for this reporter — without model metadata, since SimulationReporter does not expose the model reference directly.

Use Model.toReport when you have the model available and want the full report including experiment configuration, histograms, frequencies, and time-series data.

The block parameter is optional; omitting it produces the canonical summary. Supplying a block replaces the default:

model.simulationReporter.toReport("My Study") {
simulationSummary(this@toReport) // standard summary section
section("Custom Analysis") { ... } // appended after
}

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to "Simulation Report"

confidenceLevel

confidence level for half-width and CI columns; must be in (0, 1)

block

optional DSL block; replaces the default when provided


fun Model.toReport(title: String = simulationName, confidenceLevel: Double = 0.95, block: ReportBuilder.() -> Unit = { simulationResults(simulationReporter, this@toReport, confidenceLevel) }): ReportNode.Document(source)

Builds a complete ReportNode.Document for this model using the standard simulation results structure (experiment metadata, across-replication statistics, histograms, frequencies, and time-series responses).

This is the preferred zero-code path for getting a full simulation report in any output format:

model.simulate()
model.toReport().showInBrowser()
model.toReport().writeMarkdown()
model.toReport().writeLaTeX()

The block parameter is optional; omitting it produces the canonical report. Supplying a block replaces the default content — call simulationResults inside the block to include the standard sections alongside custom content:

model.toReport("Extended Study") {
simulationResults(simulationReporter, this@toReport)
section("Custom Analysis") { multipleComparison(mca) }
}

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to Model.simulationName

confidenceLevel

confidence level for all statistical tables; must be in (0, 1)

block

optional DSL block; replaces the default when provided


fun ExperimentRunParameters.toReport(title: String = "Experiment Run Parameters ", block: ReportBuilder.() -> Unit = { experimentRunParameters(this@toReport) }): ReportNode.Document(source)

Builds a ReportNode.Document containing a standalone run-parameters report via experimentRunParameters.

Zero-code path:

val params = model.extractRunParameters()
params.toReport("Pre-Run Configuration").showInBrowser()

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to the experiment name

block

optional DSL block; replaces the default when provided


fun SimulationRun.toReport(title: String = "Simulation Run ", confidenceLevel: Double = 0.95, showTimings: Boolean = false, block: ReportBuilder.() -> Unit = { simulationRun(this@toReport, confidenceLevel, showTimings) }): ReportNode.Document(source)

Builds a ReportNode.Document containing a full simulation run report via simulationRun.

Zero-code path:

val run = SimulationRunner(model).simulate()
run.toReport().showInBrowser()

Custom block:

run.toReport("Pallet Work Center — Baseline") {
simulationRun(this@toReport)
paragraph("Utilization target of 85% was achieved.")
}

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to the run name

confidenceLevel

confidence level for response statistics; defaults to 0.95

showTimings

true includes the Replication Timing sub-section; defaults to false because timing data is diagnostic rather than part of the primary experimental output

block

optional DSL block; replaces the default when provided


fun SimulationSnapshot.ExperimentCompleted.toReport(title: String = defaultSnapshotTitle(this), showPlots: Boolean = true, showTimeSeries: Boolean = true, showDiagnostics: Boolean = false, timeSeriesConfidenceLevel: Double = 0.95, outputDirectory: OutputDirectory? = null, block: ReportBuilder.() -> Unit = { snapshotSimulationResults( this@toReport, showPlots = showPlots, showTimeSeries = showTimeSeries, showDiagnostics = showDiagnostics, timeSeriesConfidenceLevel = timeSeriesConfidenceLevel ) }): ReportNode.Document(source)

Builds a report document for a completed simulation snapshot.

The default content is equivalent to snapshotSimulationResults. Supplying block replaces the default content; call snapshotSimulationResults from the block when composing the standard sections with custom commentary.

Parameters

outputDirectory

optional KSL output directory used as the default target for convenience render calls such as writeMarkdown() and showInBrowser()


fun StateFrequency.toReport(title: String = name, confidenceLevel: Double = 0.95, showStatistics: Boolean = true, showTransitions: Boolean = true, showTransitionProportions: Boolean = false, showPlot: Boolean = true, proportions: Boolean = false, block: ReportBuilder.() -> Unit = { stateFrequency( this@toReport, confidenceLevel = confidenceLevel, showStatistics = showStatistics, showTransitions = showTransitions, showTransitionProportions = showTransitionProportions, showPlot = showPlot, proportions = proportions ) }): ReportNode.Document(source)

Builds a ReportNode.Document whose default content is the full state-frequency section (overview paragraph, state frequency table, statistics on observed states, transition count matrix, and plot).

Zero-code path:

machineStateFreq.toReport().showInBrowser()
machineStateFreq.toReport().writeMarkdown()

Custom block replaces the default:

machineStateFreq.toReport("Machine State Analysis") {
stateFrequency(this@toReport, showTransitionProportions = true)
paragraph("Steady-state distribution estimated from proportions above.")
}

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to StateFrequency.name

confidenceLevel

confidence level for the StatPropertyTable CI; must be in (0, 1)

showStatistics

when true (default) numeric statistics on observed state numbers are included

showTransitions

when true (default) a transition count matrix is included

showTransitionProportions

when true a transition proportion matrix is included (default false)

showPlot

when true (default) a frequency bar chart is included

proportions

when true the bar chart y-axis shows proportions instead of counts

block

optional DSL block; replaces the default when provided


fun StatisticIfc.toReport(title: String = name, confidenceLevel: Double = 0.95, block: ReportBuilder.() -> Unit = { statistic(this@toReport, confidenceLevel) }): ReportNode.Document(source)

Builds a ReportNode.Document whose default content is a full property-sheet section for this statistic (identical to calling statistic inside a report {} block).

The block parameter is optional; omitting it produces the canonical report. Supplying a block replaces the default content entirely — call statistic inside the block to include the standard section alongside custom content:

myStat.toReport {
statistic(this@toReport) // standard section
paragraph("Custom commentary.") // appended after
}

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to StatisticIfc.name

confidenceLevel

confidence level for half-width and CI rows; must be in (0, 1)

block

optional DSL block; replaces the default when provided


fun StatisticReporter.toReport(title: String = reportTitle ?: "Statistical Report", confidenceLevel: Double = 0.95, block: ReportBuilder.() -> Unit = { statistics(this@toReport.statistics, confidenceLevel = confidenceLevel) }): ReportNode.Document(source)

Builds a ReportNode.Document whose default content is a compact half-width summary ksl.utilities.io.report.ast.ReportNode.StatTable for all statistics held by this reporter.

The block parameter is optional; omitting it produces the canonical compact table. Supplying a block replaces the default:

myReporter.toReport("Service Time Analysis") {
statistics(this@toReport.statistics) // standard compact table
paragraph("Additional notes.")
}

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to StatisticReporter.reportTitle when set, otherwise "Statistical Report"

confidenceLevel

confidence level for half-width and CI columns; must be in (0, 1)

block

optional DSL block; replaces the default when provided


fun StringFrequency.toReport(title: String = name, showPlot: Boolean = true, proportions: Boolean = false, block: ReportBuilder.() -> Unit = { stringFrequency(this@toReport, showPlot = showPlot, proportions = proportions) }): ReportNode.Document(source)

Builds a ReportNode.Document whose default content is the full string-frequency section (overview paragraph, frequency table, and plot).

Zero-code path:

classificationFrequency.toReport().showInBrowser()
classificationFrequency.toReport().writeMarkdown()

Custom block replaces the default:

classificationFrequency.toReport("Classification Results") {
stringFrequency(this@toReport)
paragraph("See also the confusion matrix above.")
}

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to StringFrequency.name

showPlot

when true (default) a bar chart is included in the section

proportions

when true the bar chart y-axis shows proportions instead of counts

block

optional DSL block; replaces the default when provided


fun TabularOutputFile.toReport(title: String = path.fileName.toString(), block: ReportBuilder.() -> Unit = { tabularFileSchema(this@toReport) }): ReportNode.Document(source)

Builds a ReportNode.Document for this TabularOutputFile whose default content is a schema section (tabularFileSchema).

Row data is not accessible from a TabularOutputFile (rows are write-only until flushed and re-opened as a TabularInputFile), so the schema is the only safe content. Convert to a TabularInputFile via TabularOutputFile.asTabularInputFile if a full report including data is needed.

Zero-code path:

val tof = TabularOutputFile(columns, path)
tof.toReport().showInBrowser()

Custom block replaces the default:

tof.toReport("Output Schema") {
tabularFileSchema(this@toReport)
paragraph("Written during pre-processing phase.")
}

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to the file name

block

optional DSL block; replaces the default when provided


fun TabularInputFile.toReport(title: String = path.fileName.toString(), maxRows: Int = 500, confidenceLevel: Double = 0.95, detail: Boolean = false, showPlots: Boolean = true, block: ReportBuilder.() -> Unit = { tabularInputFileResults( file = this@toReport, maxRows = maxRows, confidenceLevel = confidenceLevel, detail = detail, showPlots = showPlots ) }): ReportNode.Document(source)

Builds a ReportNode.Document for this TabularInputFile whose default content is the full standard report (tabularInputFileResults): column schema, compact statistics table for numeric columns, text-column summary, and per-column drill-down sections with histograms and value-frequency tables.

Zero-code path:

val tif = TabularInputFile(path)
tif.toReport().showInBrowser()
tif.toReport().writeMarkdown()

Custom block replaces the default — call tabularInputFileResults inside the block to include the standard report alongside additional custom content:

tif.toReport("Sensor Analysis", maxRows = 2000) {
tabularInputFileResults(this@toReport, maxRows = 2000, detail = true)
section("Commentary") { paragraph("Outliers noted in column C3.") }
}

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to the file name

maxRows

maximum rows read per column for all sub-sections; 0 = all rows; defaults to 500

confidenceLevel

confidence level for all statistical tables; must be in (0, 1)

detail

true appends a diagnostic statistics table to the summary section

showPlots

when true (default) histogram plots are included

block

optional DSL block; replaces the default when provided


fun WeightedStatistic.toReport(title: String = name, block: ReportBuilder.() -> Unit = { weightedStatistic(this@toReport) }): ReportNode.Document(source)

Builds a ReportNode.Document whose default content is a vertical property-sheet section for this weighted statistic.

Zero-code path:

serverUtilization.toReport().showInBrowser()
serverUtilization.toReport().writeMarkdown()

Custom block replaces the default:

serverUtilization.toReport("Utilization Analysis") {
weightedStatistic(this@toReport) // standard section
paragraph("Target utilisation is 0.85.")
}

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to WeightedStatistic.name

block

optional DSL block; replaces the default when provided


fun WelchANOVA.toReport(title: String = "Welch's ANOVA", confidenceLevel: Double = 0.95, block: ReportBuilder.() -> Unit = { welchAnova(this@toReport, confidenceLevel = confidenceLevel) }): ReportNode.Document(source)

Builds a ReportNode.Document whose default content is the full Welch's ANOVA section.

Zero-code path:

anova.toReport().showInBrowser()
anova.toReport().writeMarkdown()

Custom block replaces the default:

anova.toReport("Experiment Results") {
welchAnova(this@toReport)
paragraph("See attached data for raw observations.")
}

Return

the assembled ReportNode.Document

Parameters

title

document title; defaults to "Welch's ANOVA"

confidenceLevel

confidence level for per-group CI columns (default 0.95)

block

optional DSL block; replaces the default when provided


fun WelchFileObserver.toReport(title: String = responseName, includePartialSums: Boolean = true, includeBatchMeans: Boolean = false, includeBiasTest: Boolean = false, deletionPoint: Int = -1, block: ReportBuilder.() -> Unit = { welchAnalysis( observer = this@toReport, includePartialSums = includePartialSums, includeBatchMeans = includeBatchMeans, includeBiasTest = includeBiasTest, deletionPoint = deletionPoint ) }): ReportNode.Document(source)

Builds a ReportNode.Document for this WelchFileObserver.

The default block calls welchAnalysis with the supplied parameters. A custom block replaces the default content entirely.

Zero-code usage:

myObserver.toReport().showInBrowser()
myObserver.toReport(includeBatchMeans = true).writeMarkdown()
myObserver.toReport(includeBiasTest = true, includeBatchMeans = true).showInBrowser()

Custom block:

myObserver.toReport("Queue Warm-Up Study") {
paragraph("System time for 5 replications.")
welchAnalysis(myObserver,
includePartialSums = true,
includeBiasTest = true,
includeBatchMeans = true)
}

Parameters

title

document title; defaults to WelchFileObserver.responseName

includePartialSums

true (default) includes a PartialSumsPlot

includeBatchMeans

true appends a batch-means analysis section

includeBiasTest

true appends a Schruben initialization bias test section

deletionPoint

observation index for post-deletion analysis; -1 means use the MSER recommendation

block

optional DSL block; replaces the default content when provided