MapModelProvider

class MapModelProvider(modelBuilders: MutableMap<String, ModelBuilderIfc> = mutableMapOf()) : ModelProviderIfc

A class implementing the ModelProviderIfc interface to manage and provide models based on unique identifiers. It uses a mutable map to store model builders, where each builder is responsible for instantiating a specific model.

Parameters

modelBuilders

A mutable map containing model identifiers and their corresponding ModelCreator functions. Default is an empty map.

Constructors

Link copied to clipboard
constructor(modelIdentifier: String, builder: ModelBuilderIfc)

Secondary constructor for the MapModelProvider class.

constructor(modelBuilders: MutableMap<String, ModelBuilderIfc> = mutableMapOf())

Creates a MapModelProvider with an optional initial set of model builders.

Functions

Link copied to clipboard
fun addModelCreator(modelIdentifier: String, builder: ModelBuilderIfc)

Adds a ModelBuilderIfc to the provider.

Link copied to clipboard
open override fun experimentalParameters(modelIdentifier: String): ExperimentRunParameters

Retrieves the experimental run parameters for the model identified by the given identifier. This method extracts detailed configurations and settings required to execute the experiment.

Link copied to clipboard
open override fun inputNames(modelIdentifier: String): List<String>

Retrieves the list of input names associated with the specified model.

Link copied to clipboard
open override fun isModelProvided(modelIdentifier: String): Boolean

Verifies whether a model is available based on the given identifier.

Link copied to clipboard
open override fun modelIdentifiers(): List<String>

Retrieves a list of model identifiers that are available.

Link copied to clipboard
open override fun provideModel(modelIdentifier: String): Model

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.

Link copied to clipboard
fun removeModelCreator(modelIdentifier: String): Boolean

Removes a ModelCreator from the provider.

Link copied to clipboard
open override fun responseNames(modelIdentifier: String): List<String>

Retrieves a list of response names associated with the specified model.