Bundle Model Provider
Adapter that exposes one or more LoadedBundles through the existing ksl.simulation.ModelProviderIfc contract used by KSLAppSession. This lets callers that today take a ModelProviderIfc (such as the four reference Swing apps) consume bundle-supplied models without any change to the interaction-layer API.
Model identifiers are flattened across all wrapped bundles: each KSLBundledModel.modelId becomes a top-level identifier in this provider. When two bundles ship a model with the same modelId, the first wins and a warning is logged; the global key in the substrate is the pair (bundleId, modelId), but this adapter exposes only the bare modelId because that is what ModelProviderIfc callers know. Hosted consumers that need to disambiguate (a future REST or MCP runtime) should consume bundles directly rather than through this adapter.
The iteration order of modelIdentifiers is deterministic: it follows the constructor's bundle order, then within each bundle the declared models order. Callers may rely on this for stable picker layouts.
In addition to the ModelProviderIfc surface, this class exposes builderFor(modelIdentifier), returning the underlying ksl.simulation.ModelBuilderIfc. This is needed by callers (for example ksl.controls.experiments.ParallelDesignedExperiment) that must construct many models from one builder rather than receive a single built model. The base interface intentionally does not expose a builder, so callers needing one must hold a typed reference to BundleModelProvider.
Functions
Returns the ModelBuilderIfc for the model with the given identifier. Distinct from provideModel: this returns the factory, not a built model. Used by callers such as ParallelDesignedExperiment that must build the same model many times.
Returns the ModelBuilderIfc for the model identified by the unambiguous (bundleId, modelId) pair. Distinct from provideModel: this returns the factory, not a built model.
Verifies whether a model is available based on the given identifier.
Returns true when a model is provided at the unambiguous (bundleId, modelId) pair. Distinct from the single-string isModelProvided, which uses the flat byModelId lookup with first-wins shadowing.
Retrieves a list of model identifiers that are available.
Provides a model instance based on the given identifier. If the model corresponding to the identifier is available, this method returns the instance of the model.
Builds and returns the model identified by the unambiguous (bundleId, modelId) pair. Used to resolve ModelReference.ByBundleAndModelId against a multi-bundle document.