Re: Algorithm for determining % complete of a program



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.
.



Relevant Pages

  • Re: Progress Bar
    ... as A1 is incremented, another column lights up. ... cell depending on the progress. ... give you a progress bar with a 10% increment. ... field w/o VB? ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Progress bar during file processing
    ... Why not just increment the progress ... You might well end up needing a progress bar for your progress bar. ... > a StreamReader to read the files and whenever I start working on a new ...
    (microsoft.public.dotnet.framework.windowsforms)
  • thread a activex control call ?
    ... Before calling the activex methods, I start a timer attached to a progress ... The bar starts to increment, then stops and ... progress bar continues to increment - ie it shows progress after all the ...
    (microsoft.public.vb.general.discussion)
  • Re: ProgressBar incremented from outside of Form
    ... After onClick event on button the following method executes: ... How can I increment my progress bar without giving ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Custom CRect Question
    ... Our progress bar needs to keep track of the current frame, total frames in ... the session, the session number, and total number of sessions. ... So what this sounds like is you have several "bars", one of which is a progress along the ... So this isn't a stacked progress bar, ...
    (microsoft.public.vc.mfc)