Skip to content

Commit

Permalink
Updating deprecated environment functions
Browse files Browse the repository at this point in the history
  • Loading branch information
katieb1 committed Dec 16, 2021
1 parent 8b3727b commit 87fc104
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/circcon.R
Expand Up @@ -17,9 +17,9 @@ myProject <- project()
# Active scenario
myScenario <- scenario()
# Create SyncroSim temporary folder
tempFolderPath <- envTempFolder("CircuitConnectivity")
tempFolderPath <- runtimeTempFolder("CircuitConnectivity")
# Create output folder
outputFolderPath <- envOutputFolder(myScenario, "stconnect_CCOutputCumulativeCurrent")
outputFolderPath <- runtimeOutputFolder(myScenario, "stconnect_CCOutputCumulativeCurrent")
# Temporary Hack: save a small file to the output folder so that it doesn't get deleted when SyncroSim cleans the library and automatically deletes empty folders
write.table("file to save folder", file.path(outputFolderPath,"saveFolder.txt"))

Expand Down Expand Up @@ -64,16 +64,16 @@ totalTimesteps <- runSettings$MaximumTimestep - runSettings$MinimumTimestep + 1

# Run simulation ---------------------------------------------------------------------------
# Report on simulation progress
envBeginSimulation(totalIterations * totalTimesteps)
progressBar(type="begin", totalSteps=as.integer(totalIterations*totalTimesteps))

# Loop over all iterations, timesteps, and species
for (iteration in runSettings$MinimumIteration:runSettings$MaximumIteration) {

for (timestep in timestepSet) {

# Report on simulation progress
envReportProgress(iteration, timestep)
progressBar(type="report", iteration=iteration, timestep=timestep)

#Read in state class and age rasters for this iteration and timestep
stateclassMap <- datasheetRaster(myScenario, datasheet = "stsim_OutputSpatialState", iteration = iteration, timestep = timestep)
ageMap <- datasheetRaster(myScenario, datasheet = "stsim_OutputSpatialAge", iteration = iteration, timestep = timestep)
Expand Down Expand Up @@ -235,8 +235,8 @@ for (iteration in runSettings$MinimumIteration:runSettings$MaximumIteration) {

} # speciesRow
# Report on simulation progress
envStepSimulation()
progressBar(type="step")

} # timestep

} # iteration
Expand All @@ -247,4 +247,4 @@ saveDatasheet(myScenario, circuitOut, "stconnect_CCOutputCumulativeCurrent")
saveDatasheet(myScenario, effectivePermeabilityOut, "stconnect_CCOutputMetric")

# End simulation ---------------------------------------------------------------------------
envEndSimulation()
progressBar(type="end")
2 changes: 1 addition & 1 deletion src/package.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>

<package name="stconnect" displayName="Connectivity planning for future climate and land-use change" version="1.1.15" url="http://apexrms.github.io/stconnect/">
<package name="stconnect" displayName="Connectivity planning for future climate and land-use change" version="1.1.16" url="http://apexrms.github.io/stconnect/">

<transformers>

Expand Down

0 comments on commit 87fc104

Please sign in to comment.