Run one or more SyncroSim Scenario(s).

run(
  ssimObject,
  scenario = NULL,
  summary = FALSE,
  jobs = 1,
  copyExternalInputs = FALSE,
  transformerName = NULL,
  forceElements = FALSE
)

# S4 method for character
run(
  ssimObject,
  scenario = NULL,
  summary = FALSE,
  jobs = 1,
  copyExternalInputs = FALSE,
  transformerName = NULL,
  forceElements = FALSE
)

# S4 method for list
run(
  ssimObject,
  scenario = NULL,
  summary = FALSE,
  jobs = 1,
  copyExternalInputs = FALSE,
  transformerName = NULL,
  forceElements = FALSE
)

# S4 method for SsimObject
run(
  ssimObject,
  scenario = NULL,
  summary = FALSE,
  jobs = 1,
  copyExternalInputs = FALSE,
  transformerName = NULL,
  forceElements = FALSE
)

# S4 method for BreakpointSession
run(ssimObject, scenario, summary, jobs, copyExternalInputs, forceElements)

Arguments

ssimObject

SsimLibrary, Project, or Scenario object, or a list of Scenarios, or character (i.e. path to a SsimLibrary on disk)

scenario

character, integer, or vector of these. Scenario names or ids. If NULL (default), then runs all Scenarios associated with the SsimObject. Note that integer ids are slightly faster

summary

logical. If FALSE (default) result Scenario objects are returned. If TRUE (faster) result Scenario ids are returned

jobs

integer. The number of jobs to run. Passed to SyncroSim where multithreading is handled

copyExternalInputs

logical. If FALSE (default) then a copy of external input files (e.g. GeoTIFF files) is not created for each job. Otherwise, a copy of external inputs is created for each job. Applies only when jobs>1

transformerName

character. The name of the transformer to run (optional)

forceElements

logical. If TRUE then returns a single result Scenario as a named list; if FALSE (default) returns a single result Scenario as a Scenario object. Applies only when summary=FALSE

Value

If summary = FALSE, returns a result Scenario object or a named list of result Scenarios. The name is the parent Scenario for each result. If summary = TRUE, returns summary info for result Scenarios.

Details

Note that breakpoints are ignored unless the SsimObject is a single Scenario.

Examples

if (FALSE) {
# Install helloworldSpatial package
addPackage("helloworldSpatial")

# Set the file path and name of the new SsimLibrary
myLibraryName <- file.path(tempdir(),"testlib")

# Set the SyncroSim Session, SsimLibrary, Project, and Scenario
mySession <- session(printCmd=T)
myLibrary <- ssimLibrary(name = myLibraryName,
                         session = mySession, 
                         package = "helloworldSpatial",
                         template = "example-library",
                         forceUpdate = TRUE)
myProject <- project(myLibrary, project = "Definitions")
myScenario <- scenario(myProject, scenario = "My Scenario")

# Run with default parameters
resultScenario <- run(myScenario)

# Only return summary information
resultScenario <- run(myScenario, summary = TRUE)

# Run with multiprocessing
resultScenario <- run(myScenario, jobs = 6)

# Return results as a named list
resultScenario <- run(myScenario, forceElements = TRUE)
}