Object is initalised with total number of iterations that are expected to occur.
User can then update the object with the add
method to indicate how many more iterations
have just occurred.
Every time step
* 100 % of iterations have occurred a message is printed to the console.
Use the quiet
argument to prevent the object from printing anything at all
Public fields
step
real, percentage of iterations to allow before printing the progress to the console
step_current
integer, the total number of iterations completed since progress was last printed to the console
n
integer, the current number of completed iterations
n_max
integer, total number of expected iterations to be completed acts as the denominator for calculating progress percentages
quiet
logical holds whether or not to print anything
Methods
Method new()
Create progressLogger object
Usage
progressLogger$new(n_max, quiet = FALSE, step = 0.1)
Method add()
Records that n
more iterations have been completed
this will add that number to the current step count (step_current
) and will
print a progress message to the log if the step limit (step
) has been reached.
This function will do nothing if quiet
has been set to TRUE