I'm developing a long-running algorithm and want to give my users an idea of what is the current state of the calculation. I thought of adding a progress bar indicating the percentage of all the calculations already done.
My problem is that the total number of calculations to perform can not be estimated beforehand. I'm somehow discovering a tree and cannot know how vast the tree is without actually exploring it.
With regards to the progress bar it means that the progress bar can sometimes go backward.
For example, let's say that my tree has 10 root elements at the beginning, I perform calculations on the first element so I'm at 1/10 = 10%
completion but discover 10 new others elements at the same time, leading to a 1/20 = 5%
completion.
Is the progress bar still useful is that case ? I want to avoid to only report X out of Y elements processed
.
Is there a better way to report the status of the number of processed elements when the number of elements to process can grow ?
Answer
If it is possible to traverse the entire tree before beginning processing, I would display an indeterminate progress bar while you discover the branches and then switch to a traditional progress bar once you know the maximum value.
If you cannot identify the total size of the tree before processing, then a progress bar may not be the best option. A progress bar indicates progress towards a known and unchanging maximum. If you don't know the maximum, you can't define the parameters of the progress bar.
In that case, maybe a textual description that is updated in real time would work better. Something like:
Discovered Items: 115
Processed Items: 32
I would definitely not recommend having the progress bar move backwards. This tells the viewer that progress is proceeding backwards or being undone, which is not the case.
No comments:
Post a Comment