Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think it depends on how you define 'best'. For instance, if you wanted tasks to run every m seconds "on average", there's an easy way to do it using the same sort of algorithm as the Bresenham method to draw lines (a task that's 'n seconds every m seconds' is much like scattering n vertical steps among m horizontal steps when drawing a line). Assign each task a counter and a step value (for "1 second every 3 seconds" the step would be 1/3). Then add the step to the counter every 'cycle' through. When a counter goes above zero that task should run (and subtract 1 from the counter). If you have several counters above zero, choose the largest one. That may give you a solution that is "good enough" for the slightly more complex form as well.</p> <p>The "1/4" and "1/3" example though sounds like you have a requirement to run the tasks "exactly" m seconds apart. Starting from a list and adding a new task to maximize the count is not a difficult search problem - but I do not think this is what you need. The A(1/4) B(1/4) C(1/2) example would give A B x x A B x x after adding A then B. Then C could not be added,</p> <p>I think there are obvious candidates for fitness functions - a table of n,m,start can have a fitness function which is the portion of the time where no more than one task is scheduled. GA/annealing would have a good chance of finding a steady state solution if one exists. But in cases like (1/4), (1/3) wwhere there appears to be no steady state solution, defining 'best' should also define your fitness function.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload