Model Reference
Serialisable pointer to a model source.
ModelReference stores only string data; it contains no live object references and is safe to persist and transport. Resolving a reference to a live ksl.simulation.Model is done at configuration-application time by RunConfiguration.buildModel.
Four variants:
ByProviderId — looks the model up in a caller-supplied ksl.simulation.ModelProviderIfc
ByJar — loads the model's ksl.simulation.ModelBuilderIfc from a JAR file via ksl.utilities.io.JARModelBuilder
ByBundleAndModelId — resolves a
(bundleId, modelId)pair against aBundleModelProviderEmbedded — marker that the model is supplied in-process by the originating framework (Single-app); the saved file is intentionally non-portable and consuming apps surface a distinguished error
Serialised form
The sealed hierarchy uses the standard kotlinx-serialization class discriminator. The @SerialName annotations on each subclass produce short, human-readable type tags in both JSON and TOML:
[modelReference]
type = "byProviderId"
providerId = "MM1""modelReference": { "type": "byProviderId", "providerId": "MM1" }Inheritors
Types
References a model unambiguously by the pair of its enclosing bundle and the model identifier within that bundle. Use when a document references multiple bundles and a scenario must select exactly one of them (the byProviderId variant relies on flat-modelId lookup which is ambiguous in a multi-bundle document).
References a model whose ksl.simulation.ModelBuilderIfc is loaded from a JAR file via ksl.utilities.io.JARModelBuilder.
References a model registered in a ksl.simulation.ModelProviderIfc by its identifier string. The provider itself must be supplied at run time via RunConfiguration.buildModel.
Marker that the originating application held its model in-process (as Kotlin code, not as a JAR or bundle) and the saved configuration therefore does not contain a portable pointer to it. Written by the Single-app framework; resolved at run time by handing the framework's own ksl.simulation.ModelProviderIfc — keyed on modelName — to the orchestrator.