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)

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

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

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.36"

# Data frame of the packages installed with this version of SyncroSim
package(mySession) 
#>                        name
#> 1                      Name
#> 2           burnp3basemodel
#> 3                burnP3Plus
#> 4       burnP3PlusCell2Fire
#> 5      burnP3PlusPrometheus
#> 6                 demosales
#> 7                  designer
#> 8                     dgsim
#> 9                       epi
#> 10       epiModelVocVaccine
#> 11               helloworld
#> 12          helloworldConda
#> 13           helloworldOmni
#> 14       helloworldPipeline
#> 15        helloworldSpatial
#> 16 helloworldSpatialReports
#> 17           helloworldTime
#> 18    helloworldUncertainty
#> 19                  netlogo
#> 20                omniscape
#> 21               prioritizr
#> 22                    stsim
#> 23             stsimcbmcfs3
#> 24             stsimNestweb
#> 25                stsimpvfc
#> 26                  stsimsf
#> 27                    wisdm
#>                                                                                                       description
#> 1                                                                                                     Description
#> 2                                                                                               BurnP3 base model
#> 3                                                                  Burn-P3+ package for burn probability modeling
#> 4                                                          Cell2Fire fire growth model add-on package for BurnP3+
#> 5                                                         Prometheus fire growth model add-on package for BurnP3+
#> 6                                                                               Demo Sales SyncroSim Base Package
#> 7                                                                                      SyncroSim Package Designer
#> 8                                                                  Simulates demographics of wildlife populations
#> 9                                                                         Model of epidemic infections and deaths
#> 10                                                               Integrates VOCs and vaccination in the Epi model
#> 11                                                                                            Hello World Package
#> 12                                          Example demonstrating how to create a package with Conda environments
#> 13                                                                  Example demonstrating how to create a package
#> 14                                                                     Example demonstrating how to use pipelines
#> 15                                                                  Example demonstrating how to use spatial data
#> 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                                                  Omni-directional habitat connectivity based on circuit theory
#> 21                                                                               Systematic conservation planning
#> 22                                                               The ST-Sim state-and-transition simulation model
#> 23 Integrates the Carbon Budget Model for the Canadian Forest Sector (CBM-CFS3) into the ST-Sim simulation model.
#> 24                                                                                                 ST-Sim Nestweb
#> 25                         Integrates Potential Vegetation Fuels Change (PVFC) for LANDFIRE into the ST-Sim model
#> 26                                                   Integrates stocks and flows into the ST-Sim simulation model
#> 27                                                         Workbench for Integrated Species Distribution Modeling
#>    version                                                              NA
#> 1  Version                                                        Location
#> 2    0.0.0          C:\\Users\\birch\\SyncroSim\\Packages\\burnp3basemodel
#> 3    0.4.3               C:\\Users\\birch\\SyncroSim\\Packages\\burnP3Plus
#> 4    0.4.4      C:\\Users\\birch\\SyncroSim\\Packages\\burnP3PlusCell2Fire
#> 5    0.4.4     C:\\Users\\birch\\SyncroSim\\Packages\\burnP3PlusPrometheus
#> 6    1.1.1                C:\\Users\\birch\\SyncroSim\\Packages\\demosales
#> 7   1.0.15                 C:\\Users\\birch\\SyncroSim\\Packages\\designer
#> 8    2.3.3                    C:\\Users\\birch\\SyncroSim\\Packages\\dgsim
#> 9    1.1.3                      C:\\Users\\birch\\SyncroSim\\Packages\\epi
#> 10   1.0.3       C:\\Users\\birch\\SyncroSim\\Packages\\epiModelVocVaccine
#> 11   1.0.0               C:\\Users\\birch\\SyncroSim\\Packages\\helloworld
#> 12   1.0.7                           C:\\gitprojects\\helloworldConda\\src
#> 13   1.0.1           C:\\Users\\birch\\SyncroSim\\Packages\\helloworldOmni
#> 14   1.0.0       C:\\Users\\birch\\SyncroSim\\Packages\\helloworldPipeline
#> 15   1.0.6        C:\\Users\\birch\\SyncroSim\\Packages\\helloworldSpatial
#> 16   1.0.3 C:\\Users\\birch\\SyncroSim\\Packages\\helloworldSpatialReports
#> 17   1.0.0           C:\\Users\\birch\\SyncroSim\\Packages\\helloworldTime
#> 18   1.0.0    C:\\Users\\birch\\SyncroSim\\Packages\\helloworldUncertainty
#> 19   1.2.1                  C:\\Users\\birch\\SyncroSim\\Packages\\netlogo
#> 20   1.0.1                C:\\Users\\birch\\SyncroSim\\Packages\\omniscape
#> 21   1.0.0               C:\\Users\\birch\\SyncroSim\\Packages\\prioritizr
#> 22  3.3.14                    C:\\Users\\birch\\SyncroSim\\Packages\\stsim
#> 23  1.0.17             C:\\Users\\birch\\SyncroSim\\Packages\\stsimcbmcfs3
#> 24   1.0.1                                   C:\\gitprojects\\stsimNestweb
#> 25   1.0.7                                 C:\\gitprojects\\stsimpvfc\\src
#> 26  3.3.12                  C:\\Users\\birch\\SyncroSim\\Packages\\stsimsf
#> 27   1.0.9                    C:\\Users\\birch\\SyncroSim\\Packages\\wisdm
#>        NA
#> 1  Status
#> 2      OK
#> 3      OK
#> 4      OK
#> 5      OK
#> 6      OK
#> 7      OK
#> 8      OK
#> 9      OK
#> 10     OK
#> 11     OK
#> 12     OK
#> 13     OK
#> 14     OK
#> 15     OK
#> 16     OK
#> 17     OK
#> 18     OK
#> 19     OK
#> 20     OK
#> 21     OK
#> 22     OK
#> 23     OK
#> 24     OK
#> 25     OK
#> 26     OK
#> 27     OK

# Data frame of the base packages installed with this version of SyncroSim
package(mySession, installed = "BASE") 
#>                        name
#> 1                burnP3Plus
#> 2                 demosales
#> 3                  designer
#> 4                     dgsim
#> 5                       epi
#> 6                helloworld
#> 7            helloworldOmni
#> 8        helloworldPipeline
#> 9         helloworldSpatial
#> 10 helloworldSpatialReports
#> 11           helloworldTime
#> 12    helloworldUncertainty
#> 13                  netlogo
#> 14                omniscape
#> 15               prioritizr
#> 16                    stsim
#> 17                    wisdm
#> 18          helloworldConda
#>                                                              description
#> 1                         Burn-P3+ package for burn probability modeling
#> 2                                      Demo Sales SyncroSim Base Package
#> 3                                             SyncroSim Package Designer
#> 4                         Simulates demographics of wildlife populations
#> 5                                Model of epidemic infections and deaths
#> 6                                                    Hello World Package
#> 7                          Example demonstrating how to create a package
#> 8                             Example demonstrating how to use pipelines
#> 9                          Example demonstrating how to use spatial data
#> 10                         Example demonstrating how to use spatial data
#> 11                            Example demonstrating how to use timesteps
#> 12                           Example demonstrating how to use iterations
#> 13                     Runs the NetLogo agent-based modeling environment
#> 14         Omni-directional habitat connectivity based on circuit theory
#> 15                                      Systematic conservation planning
#> 16                      The ST-Sim state-and-transition simulation model
#> 17                Workbench for Integrated Species Distribution Modeling
#> 18 Example demonstrating how to create a package with Conda environments
#>    version
#> 1    0.4.3
#> 2    1.1.1
#> 3   1.0.15
#> 4    2.3.3
#> 5    1.1.3
#> 6    1.0.0
#> 7    1.0.1
#> 8    1.0.0
#> 9    1.0.6
#> 10   1.0.3
#> 11   1.0.0
#> 12   1.0.0
#> 13   1.2.1
#> 14   1.0.1
#> 15   1.0.0
#> 16  3.3.14
#> 17   1.0.9
#> 18   1.0.7

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