T - The element which is to be scheduled.public class IntervalSequencer<T> extends Object implements ElementSequencer<T>
Given a set of three events A, B, and C, and a set of respective frequencies of these events 5, 5, and 1. In short form: A:5,B:5,C:1. This means that a total of 11 events will be scheduled. In order to support interleaving the events over the cycle, each event is scheduled independently according to an ideal schedule. For A, over the unit interval of (0,0,1.0), it would occur at 0.0, 0.2, 0.4, 0.6, and 0.8, restarting again at the next unit interval. B would have exactly the same ideal schedule. However, A occurs first in the list, and is given sequencing precedence at any point at which both events occur at exactly the same scheduled offset. Essentially, events are first scheduled in the unit interval according to their ideal equidistant schedule in the unit interval, and then by their order of appearance as presented. The unit interval does not actually determine when in time an event may occur, but is used for the major-minor sequencing rules above. The result is merely a stable sequence for execution planning separate from the specific timing of each event.
These examples simply show in symbolic terms how the ordering is affected by different ratios. It is important to keep in mind that the ratios have no primary influence on relative ordering when events overlap in time. In that case, order of presentation breaks the tie.
| Constructor and Description |
|---|
IntervalSequencer() |
| Modifier and Type | Method and Description |
|---|---|
int[] |
seqIndexByRatioFunc(List<T> elements,
ToLongFunction<T> ratioFunc) |
int[] |
seqIndexesByRatios(List<T> elems,
List<Long> ratios) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitseqElementsByRatioFunc, sequenceSummarypublic int[] seqIndexByRatioFunc(List<T> elements, ToLongFunction<T> ratioFunc)
seqIndexByRatioFunc in interface ElementSequencer<T>public int[] seqIndexesByRatios(List<T> elems, List<Long> ratios)
seqIndexesByRatios in interface ElementSequencer<T>Copyright © 2017. All rights reserved.