progressBar: Sets the progress bar in the SyncroSim User Interface

Description Usage Arguments Value Examples

View source: R/ssimEnvironment.R

Description

This function is designed to facilitate the development of R-based Syncrosim Packages, such as beginning, stepping, ending, and reporting the progress for a SyncroSim simulation.

Usage

1
2
3
4
5
6
progressBar(
  type = "step",
  iteration = NULL,
  timestep = NULL,
  totalSteps = NULL
)

Arguments

type

character. Update to apply to progress bar. Options include "begin", "end", "step", and "report" (Default is "step")

iteration

integer. The current iteration. Only used if type = "report"

timestep

integer. The current timestep. Only used if type = "report"

totalSteps

integer. The total number of steps in the simulation. Only used if type = "begin"

Value

No returned value, used for side effects

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
# Begin the progress bar for a simulation
progressBar(type = "begin", totalSteps = numIterations * numTimesteps)

# Increase the progress bar by one step for a simulation
progressBar(type = "step")

# Report progress for a simulation
progressBar(type = "report", iteration = iter, timestep = ts)

# End the progress bar for a simulation
progressBar(type = "end")

## End(Not run)

rsyncrosim documentation built on Oct. 28, 2021, 1:07 a.m.