Re: Algorithm for determining % complete of a program
- From: Dave <solomons_dad.w.marks_and_whom@xxxxxxxxxx>
- Date: Wed, 26 Jul 2006 13:19:34 +0100
mross462@xxxxxxxxx wrote:
Hello all,
I'm wondering if there someone could help me investigate an algorithm
for determining the progression status (% complete) of an application
that I'm currently working on. It currently has 4 phases where
different data can be obtained from the program to obtain this
progression status. The application is devided into the following sub
processes, with their corresponding data references.
1. Intialization of objects. (# of types of objects are known)
2. Reading and validating each member of a particular object from a
file. (# of bytes in file read)
3. Validating objects with common values (# of objects with common
values known)
4. Writing a file with the validity tags and addresses of objects (Same
as above)
5. Removing all objects and clearing memory (same as above)
If anyone could point me in a good direction, it would be appreciated.
Thanks
Exact algorithm will depend on how accurate you want the output to be and how you define "accurate".
Each step operates on the same number N of objects (apparently) so in one possible method you could increment a counter C after each object in each step; the total T is 5*N so the percentage complete is C/T*100. If some objects take substantially longer to process than others then this could mean the progress bar has fits and starts, but this could be good enough.
If you want the progress bar to move smoothly at the same rate that's more complicated, but if adjusting the rate is acceptable then the calculation isn't much more than the above; each time you increment the counter, recalculate the predicted end time and the progress bar could be incremented by a separate thread so increments can happen while a single object is being updated.
If a rate change is unacceptable then it's unlikely you'll get a perfect solution unless you can guarantee the timing of the processing of a given object, but you could certainly approximate it - this though would probably suffer from the Microsoft effect ("Five seconds remaining" - two hours later - "Five seconds remaining").
Dave.
.
- References:
- Algorithm for determining % complete of a program
- From: mross462
- Algorithm for determining % complete of a program
- Prev by Date: Re: what is best lang to learn to make $$
- Next by Date: Re: 5000 RapidShare Ebooks
- Previous by thread: Re: Algorithm for determining % complete of a program
- Next by thread: Re: Algorithm for determining % complete of a program
- Index(es):
Relevant Pages
|