T - The element which is to be scheduled.public class BucketSequencer<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. With this sequencing algorithm, source buckets of events of type A, B, and C are initialized with the respective number of instances. Then, each bucket in turn is drawn from in round robin fashion, with each bucket being removed from the rotation when it becomes empty.
These examples simply show in symbolic terms how the ordering is affected by different ratios.
| Constructor and Description |
|---|
BucketSequencer() |
| Modifier and Type | Method and Description |
|---|---|
int[] |
seqIndexByRatioFunc(List<T> elems,
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> elems, 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.