NetworkSpec

@Serializable
data class NetworkSpec(val name: String, val transportStrategy: TransportStrategySpec = TransportStrategySpec.SharedCarrier, val items: List<ItemSpec>, val nodes: List<NodeSpec>, val demandGenerators: List<DemandGeneratorSpec> = emptyList(), val costFormulations: List<CostFormulationSpec> = emptyList())(source)

The canonical, serializable description of a multi-echelon supply-chain network — the single data form that the Kotlin DSL, the TOML/JSON loaders, and programmatic generators all produce, and that SupplyChainBuilder consumes to instantiate a running MultiEchelonNetwork.

Topology is a flat node list with parent references rather than nested structures: this handles arbitrary multi-tier depth, is reorder- and refactor-tolerant, and makes validation (cycle detection, one-root, reference resolution) straightforward.

The spec is pure data — no references to KSL runtime types. Validate it with validate before building.

Parameters

name

network name

transportStrategy

how shipments move between nodes

items

every item type the network carries

nodes

every IHP / cross-dock, each pointing at its supplier via NodeSpec.parent

demandGenerators

customer-demand arrival processes at nodes

costFormulations

cost formulations to attach (after topology)

See also

Constructors

Link copied to clipboard
constructor(name: String, transportStrategy: TransportStrategySpec = TransportStrategySpec.SharedCarrier, items: List<ItemSpec>, nodes: List<NodeSpec>, demandGenerators: List<DemandGeneratorSpec> = emptyList(), costFormulations: List<CostFormulationSpec> = emptyList())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Serialize this spec to a JSON string.

Link copied to clipboard

Serialize this spec to a TOML string.

Link copied to clipboard

Validate the structural and reference integrity of this NetworkSpec, returning every problem found (not just the first). An empty list means the spec is well-formed and safe to pass to SupplyChainBuilder.build.