public interface ModelRunner
forTicks(int)
and forRuns(long)
need to be set in order for the
model to run.
Multi run results are returned in a RunResult
object
Start the runner with run()
or runAsync()
Modifier and Type | Method and Description |
---|---|
void |
cancelRun()
If an async simulation is running, stop it.
|
ModelRunner |
forRuns(long runs)
Set number of times to run the simulation.
|
ModelRunner |
forTicks(int ticks)
Set number of ticks to run simulation for.
|
RunResult |
getCompletedResults()
Wait for an async simulation to complete and get results.
|
java.lang.String |
getExportPath()
Get sub directory where to export this models data.
|
float |
getProgress()
Get the progress of an async running simulation
|
long |
getRuns() |
int |
getTicks() |
RunResult |
run()
Start running the multi run simulation
|
scala.concurrent.Future<RunResult> |
runAsync()
Start running the multi run simulation in the background, allowing you to track the progress
with
getProgress() |
ModelRunner |
withCustomMetadata(java.lang.String metadata)
Set metadata to be exported.
|
ModelRunner |
withExportPath(java.lang.String exportPath)
Set sub directory to export this models data to.
|
ModelRunner |
withInput(java.lang.String jsonInput)
|
ModelRunner |
withScenario(simudyne.core.runner.scenario.ScenarioRunRequest scenario,
java.lang.String runId) |
ModelRunner forTicks(int ticks)
ticks
- to run simulation for. If not set, defaults to zero.ModelRunner
instanceint getTicks()
ModelRunner forRuns(long runs)
runs
- Number of times to run the simulation. If not set, defaults to zero.ModelRunner
instancelong getRuns()
ModelRunner withInput(java.lang.String jsonInput)
jsonInput
- A json string with the field names and valuesModelRunner
instanceModelRunner withExportPath(java.lang.String exportPath)
exportPath
- java.lang.String getExportPath()
ModelRunner withCustomMetadata(java.lang.String metadata)
metadata
- RunResult run()
RunResult
with aggregated simulation datascala.concurrent.Future<RunResult> runAsync()
getProgress()
RunResult
with aggregated simulation datafloat getProgress()
RunResult getCompletedResults()
RunResult
with aggregated simulation datavoid cancelRun()
ModelRunner withScenario(simudyne.core.runner.scenario.ScenarioRunRequest scenario, java.lang.String runId)