Class BurstSelector

  • All Implemented Interfaces:

    public class BurstSelector
    extends Object
    implements DatesSelector
    Selector generating high rate bursts of dates separated by some rest period.

    The dates can be aligned to whole steps in some time scale. So for example if a rest period of 3600s is used and the alignment time scale is set to UTC, the earliest date of each burst will occur at whole hours in UTC time.

    BEWARE! This class stores internally the last selected dates, so it is neither reusable across several fixed step or continuous schedulers, nor thread-safe. A separate selector should be used for each scheduler and for each thread in multi-threading context.

    Luc Maisonobe
    • Constructor Detail

      • BurstSelector

        public BurstSelector​(int maxBurstSize,
                             double highRateStep,
                             double burstPeriod,
                             TimeScale alignmentTimeScale)
        Simple constructor.

        The burstPeriod ignores the duration of the burst itself. This means that if burst of maxBurstSize=256 dates each separated by highRateStep=100ms should be selected with burstPeriod=300s, then the first burst would contain 256 dates from t0 to t0+25.5s and the second burst would start at t0+300s, not at t0+325.5s.

        If alignment to some time scale is needed, it applies only to the first date in each burst.

        maxBurstSize - maximum number of selected dates in a burst
        highRateStep - step between two consecutive dates within a burst (s)
        burstPeriod - period between the start of each burst (s)
        alignmentTimeScale - alignment time scale for first date in burst (null is alignment is not needed)
    • Method Detail

      • selectDates

        public List<AbsoluteDate> selectDates​(AbsoluteDate start,
                                              AbsoluteDate end)
        Select dates within an interval.

        The start and end date may be either in direct or reverse chronological order. The list is produced in the same order as start and end, i.e. direct chronological order if start is earlier than end or reverse chronological order if start is later than end.

        The ordering (direct or reverse chronological order) should not be changed between calls, otherwise unpredictable results may occur.

        Specified by:
        selectDates in interface DatesSelector
        start - interval start
        end - interval end
        selected dates within this interval