SupplyChainBuilder

Instantiates a running MultiEchelonNetwork from a NetworkSpec.

This is the single consumer of the spec layer (§4 of the DSL plan): the Kotlin DSL and the TOML/JSON loaders all produce a NetworkSpec; this object is the only thing that consumes one and touches runtime framework types.

The build follows the framework's hardened construction-order contract — item types, then nodes in topological (parent-before-child) order with their supplier edges and inventories, then demand generators, and finally cost formulations last, after the topology is final. That ordering is exactly what the cost-formulation ordering and coverage guards require, so the builder is the canonical "do-it-right" path.

See also

Functions

Link copied to clipboard
fun build(model: Model, spec: NetworkSpec): BuildResult

Build spec under model. Validates first via NetworkSpec.validate and throws IllegalArgumentException with every problem listed if the spec is malformed.

Link copied to clipboard

Materialize an RVSpec into the KSL random variable carrying its stream number — the single choke point for stream-number handling (CLAUDE.md §4.1). Reproducibility is the spec author's responsibility; the builder does no implicit stream assignment.