Methods to create or return a SyncroSim Session.

session(x = NULL, silent = TRUE, printCmd = FALSE, condaFilepath = NULL)

# S4 method for missingOrNULLOrChar
session(x = NULL, silent = TRUE, printCmd = FALSE, condaFilepath = NULL)

# S4 method for SsimObject
session(x = NULL, silent = TRUE, printCmd = FALSE, condaFilepath = NULL)

session(ssimObject) <- value

# S4 method for NULLOrChar
session(ssimObject) <- value

# S4 method for SsimObject
session(ssimObject) <- value

Arguments

x

character or SsimObject. Path to SyncroSim installation. If NULL (default), then default path is used

silent

logical. Applies only if x is a path or NULL If TRUE, warnings from the console are ignored. Otherwise they are printed. Default is FALSE

printCmd

logical. Applies only if x is a path or NULL If TRUE, arguments passed to the SyncroSim console are also printed. Helpful for debugging. Default is FALSE

condaFilepath

string. Gets or sets the path to the Conda installation folder. Can be used to direct SyncroSim to a custom Conda installation. If "default" (default), then default Conda installation folder is used

ssimObject

Project or Scenario object

value

Session object

Value

A SyncroSim Session object.

Details

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.

Examples

# \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"

# Lists the version of SyncroSim Session
version(mySession)
#> [1] "2.4.0"

# Data frame of the packages installed with this version of SyncroSim
package(mySession) 
#>                        name
#> 1                    burnP3
#> 2           burnp3basemodel
#> 3                burnP3Plus
#> 4       burnP3PlusCell2Fire
#> 5      burnP3PlusPrometheus
#> 6                 demosales
#> 7                  designer
#> 8                       epi
#> 9        epiModelVocVaccine
#> 10               helloworld
#> 11          helloworldConda
#> 12           helloworldOmni
#> 13       helloworldPipeline
#> 14        helloworldSpatial
#> 15   helloworldSpatialConda
#> 16 helloworldSpatialReports
#> 17           helloworldTime
#> 18    helloworldUncertainty
#> 19                  netlogo
#> 20                stconnect
#> 21                    stsim
#> 22             stsimcbmcfs3
#> 23                  stsimsf
#> 24                    wisdm
#>                                                                                                       description
#> 1                                                                   Burn-P3 package for burn probability modeling
#> 2                                                                                               BurnP3 base model
#> 3                                                                  Burn-P3+ package for burn probability modeling
#> 4                                                          Cell2Fire fire growth model add-on package for Burn-P3
#> 5                                                    Prometheus fire growth model add-on package for Burn-P3 Plus
#> 6                                                                               Demo Sales SyncroSim Base Package
#> 7                                                                                      SyncroSim Package Designer
#> 8                                                                         Model of epidemic infections and deaths
#> 9                                                                Integrates VOCs and vaccination in the Epi model
#> 10                                                                  Example demonstrating how to create a package
#> 11                                          Example demonstrating how to create a package with Conda environments
#> 12                                                                  Example demonstrating how to create a package
#> 13                                                                     Example demonstrating how to use pipelines
#> 14                                                                  Example demonstrating how to use spatial data
#> 15                                                                       Example demonstrating conda environments
#> 16                                                                  Example demonstrating how to use spatial data
#> 17                                                                     Example demonstrating how to use timesteps
#> 18                                                                    Example demonstrating how to use iterations
#> 19                                                              Runs the NetLogo agent-based modeling environment
#> 20                                                   Connectivity planning for future climate and land-use change
#> 21                                                               The ST-Sim state-and-transition simulation model
#> 22 Integrates the Carbon Budget Model for the Canadian Forest Sector (CBM-CFS3) into the ST-Sim simulation model.
#> 23                                                   Integrates stocks and flows into the ST-Sim simulation model
#> 24                                                         Workbench for Integrated Species Distribution Modeling
#>    version
#> 1    0.0.0
#> 2    0.0.0
#> 3    0.1.1
#> 4    0.1.1
#> 5    0.1.2
#> 6    1.1.0
#> 7    1.0.1
#> 8    1.1.3
#> 9    1.0.2
#> 10   1.0.1
#> 11   1.0.1
#> 12   1.0.1
#> 13   1.0.0
#> 14   1.0.4
#> 15   1.0.0
#> 16   1.0.3
#> 17   1.0.0
#> 18   1.0.0
#> 19   1.2.0
#> 20  1.1.16
#> 21   3.3.9
#> 22  1.0.14
#> 23  3.3.10
#> 24   1.0.0

# Data frame of the base packages installed with this version of SyncroSim
package(mySession, installed = "BASE") 
#>                        name
#> 1                    burnP3
#> 2                burnP3Plus
#> 3                 demosales
#> 4                  designer
#> 5                       epi
#> 6                helloworld
#> 7           helloworldConda
#> 8            helloworldOmni
#> 9        helloworldPipeline
#> 10        helloworldSpatial
#> 11   helloworldSpatialConda
#> 12 helloworldSpatialReports
#> 13           helloworldTime
#> 14    helloworldUncertainty
#> 15                  netlogo
#> 16                stconnect
#> 17                    stsim
#> 18                    wisdm
#>                                                              description
#> 1                          Burn-P3 package for burn probability modeling
#> 2                         Burn-P3+ package for burn probability modeling
#> 3                                      Demo Sales SyncroSim Base Package
#> 4                                             SyncroSim Package Designer
#> 5                                Model of epidemic infections and deaths
#> 6                          Example demonstrating how to create a package
#> 7  Example demonstrating how to create a package with Conda environments
#> 8                          Example demonstrating how to create a package
#> 9                             Example demonstrating how to use pipelines
#> 10                         Example demonstrating how to use spatial data
#> 11                              Example demonstrating conda environments
#> 12                         Example demonstrating how to use spatial data
#> 13                            Example demonstrating how to use timesteps
#> 14                           Example demonstrating how to use iterations
#> 15                     Runs the NetLogo agent-based modeling environment
#> 16          Connectivity planning for future climate and land-use change
#> 17                      The ST-Sim state-and-transition simulation model
#> 18                Workbench for Integrated Species Distribution Modeling
#>    version
#> 1    0.0.0
#> 2    0.1.1
#> 3    1.1.0
#> 4    1.0.1
#> 5    1.1.3
#> 6    1.0.1
#> 7    1.0.1
#> 8    1.0.1
#> 9    1.0.0
#> 10   1.0.4
#> 11   1.0.0
#> 12   1.0.3
#> 13   1.0.0
#> 14   1.0.0
#> 15   1.2.0
#> 16  1.1.16
#> 17   3.3.9
#> 18   1.0.0

# Set a new SyncroSim Session for the SyncroSim Project
session(myProject) <- session(x = filepath(session(myProject)))
# }