
Create an iterator based on sens of the current iteration within a scenario (DSA)
sens_iterator(sens, n_sensitivity)
Integer iterator based on the number of sensitivity analyses being run and the total iterator
current analysis iterator
total number of analyses to be run
In a situation like a DSA, where two (low and high) scenarios are run, sens will go from 1 to n_sensitivity*2. However, this is not ideal as the parameter selector may depend on knowing the parameter order (i.e., 1, 2, 3...), which means resetting the counter back to 1 once sens reaches n_sensitivity (or any multiple of n_sensitivity) is needed.
sens_iterator(5,20)
sens_iterator(25,20)
Run the code above in your browser using DataLab