Methods to create or return a SyncroSim Session
.
session(x = NULL, silent = TRUE, printCmd = FALSE) # S4 method for missingOrNULLOrChar session(x = NULL, silent = TRUE, printCmd = FALSE) # S4 method for SsimObject session(x = NULL, silent = TRUE, printCmd = FALSE) session(ssimObject) <- value # S4 method for character session(ssimObject) <- value # S4 method for SsimObject session(ssimObject) <- value
x | character or SsimObject. Path to SyncroSim installation. If |
---|---|
silent | logical. Applies only if x is a path or |
printCmd | logical. Applies only if x is a path or |
ssimObject | |
value |
|
A SyncroSim Session
object.
In order to avoid problems with SyncroSim version compatibility and SsimLibrary
updating, the new Session must have the same filepath as the Session of the
SsimObject
e.g. filepath(value)==filepath(session(ssimObject))
.
Therefore, the only time when you will need to set a new SyncroSim Session is if you
have updated the SyncroSim software and want to update an existing SsimObject
to use the new software.
# \donttest{ # Specify file path and name of new SsimLibrary myLibraryName <- file.path(tempdir(), "testlib") # Set up a SyncroSim Session, SsimLibrary, and Project mySession <- session() myLibrary <- ssimLibrary(name = myLibraryName, session = mySession) myProject <- project(myLibrary, project = "Definitions") # Lists the folder location of SyncroSim Session filepath(mySession)#> [1] "C:/Program Files/SyncroSim"#> [1] "2.3.10"#> name #> 1 burnP3 #> 2 helloworld #> 3 helloworldConda #> 4 helloworldOmni #> 5 helloworldPipeline #> 6 helloworldSpatial #> 7 helloworldTime #> 8 helloworldUncertainty #> 9 netlogo #> 10 stconnect #> 11 stsim #> 12 stsimsf #> description #> 1 Burn-P3 package for burn probability modeling #> 2 Example demonstrating how to create a package #> 3 Example demonstrating how to create a package with Conda environments #> 4 Example demonstrating how to create a package #> 5 Example demonstrating how to use pipelines #> 6 Example demonstrating how to use spatial data #> 7 Example demonstrating how to use timesteps #> 8 Example demonstrating how to use iterations #> 9 Runs the NetLogo agent-based modeling environment #> 10 Connectivity planning for future climate and land-use change #> 11 The ST-Sim state-and-transition simulation model #> 12 Integrates stocks and flows into the ST-Sim simulation model #> version #> 1 0.0.0 #> 2 1.0.1 #> 3 1.0.1 #> 4 1.0.1 #> 5 1.0.0 #> 6 1.0.3 #> 7 1.0.0 #> 8 1.0.0 #> 9 1.2.0 #> 10 1.1.16 #> 11 3.3.5 #> 12 3.3.4# Data frame of the base packages installed with this version of SyncroSim package(mySession, installed = "BASE")#> name #> 1 burnP3 #> 2 helloworld #> 3 helloworldConda #> 4 helloworldOmni #> 5 helloworldPipeline #> 6 helloworldSpatial #> 7 helloworldTime #> 8 helloworldUncertainty #> 9 netlogo #> 10 stconnect #> 11 stsim #> description #> 1 Burn-P3 package for burn probability modeling #> 2 Example demonstrating how to create a package #> 3 Example demonstrating how to create a package with Conda environments #> 4 Example demonstrating how to create a package #> 5 Example demonstrating how to use pipelines #> 6 Example demonstrating how to use spatial data #> 7 Example demonstrating how to use timesteps #> 8 Example demonstrating how to use iterations #> 9 Runs the NetLogo agent-based modeling environment #> 10 Connectivity planning for future climate and land-use change #> 11 The ST-Sim state-and-transition simulation model #> version #> 1 0.0.0 #> 2 1.0.1 #> 3 1.0.1 #> 4 1.0.1 #> 5 1.0.0 #> 6 1.0.3 #> 7 1.0.0 #> 8 1.0.0 #> 9 1.2.0 #> 10 1.1.16 #> 11 3.3.5# Set a new SyncroSim Session for the SyncroSim Project session(myProject) <- session(x = filepath(session(myProject))) # }