submit

fun submit(config: RunConfiguration, provider: ModelProviderIfc? = null, attachments: List<RunAttachmentIfc> = emptyList(), scope: CoroutineScope = CoroutineScope(SimulationDispatcher.default + SupervisorJob()), preRunWarnings: List<RunWarningType> = emptyList()): RunHandle(source)

Builds the model from config and submits it for asynchronous execution.

Return

a RunHandle for observing progress and obtaining the result

Parameters

config

the run configuration describing the model, controls, and experiment parameters

provider

required when RunConfiguration.modelReference is ksl.app.config.ModelReference.ByProviderId; ignored for ksl.app.config.ModelReference.ByJar

attachments

optional RunAttachmentIfc instances wired into the run (e.g. ksl.app.session.ReplicationDataAttachment)

scope

coroutine scope that owns the simulation coroutine

preRunWarnings

validation warnings emitted before run lifecycle events