I am looking for an algorithm to calculate the next set of operations in a sequence. Here is the simple definition of the sequence.
- Task 1A will be done every 500 hours
- Task 2A will be done every 1000 hours
- Task 3A will be done every 1500 hours
So at t=500, do 1A. At t=1000, do both 1A and 2A, at t=1500 do 1A and 3A, but not 2A as 1500 is not a multiple of 1000. You get the idea.
It would be quite easy if I had the actual time, but I don't. What I have is the history of tasks (eg last time a [1A+2A] was done).
Knowing last time (eg [1A+2A]) is not enough to decide:
- [1A+2A] could be at t=1000: next is [1A+3A] at t=1500
- [1A+2A] could be at t=5000: next is [1A] at t=5500
Is there an algorithm for this? It looks like a familiar problem (some sort of sieve?) but I can't seem to find a solution.
Also it must "scale" as I actually have more than 3 tasks.