UtilizationModelPlanetLab extends UtilizationModelAbstract { protected final int getIntervalSize(final int startIndex, final int endIndex) { final int index = endIndex - startIndex; return index >= 0 ? index : (utilization.length - startIndex) + endIndex; } UtilizationModelPlanetLab(final String workloadFilePath, final double schedulingInterval);  UtilizationModelPlanetLab(final String workloadFilePath, final UnaryOperator<Double> mapper);  UtilizationModelPlanetLab(final String workloadFilePath, final double schedulingInterval, final int dataSamples); private  UtilizationModelPlanetLab(
        final InputStreamReader sreader,
        final double schedulingInterval,
        final int dataSamples); private  UtilizationModelPlanetLab(
        final InputStreamReader sreader,
        final double schedulingInterval,
        final int dataSamples,
        final UnaryOperator<Double> mapper); static UtilizationModelPlanetLab getInstance(final String workloadFilePath); static UtilizationModelPlanetLab getInstance(final String workloadFilePath, final double schedulingInterval); static UtilizationModelPlanetLab getInstance(final String workloadFilePath, final UnaryOperator<Double> mapper); int getDataSamples(); double getSchedulingInterval(); final void setSchedulingInterval(final double schedulingInterval); static final int DEF_DATA_SAMPLES; static final int DEF_SCHEDULING_INTERVAL; }
@Test public void testGetIntervalSize1() { final int expected = 1; assertEquals(expected, instance.getIntervalSize(1, 2)); }
@Test public void testGetIntervalSize1EndLowerThanStart() { final int expected = 1; assertEquals(expected, instance.getIntervalSize(287, 0)); }
@Test public void testGetIntervalSize10EndLowerThanStart() { final int expected = 10; assertEquals(expected, instance.getIntervalSize(287, 9)); }
@Test public void testGetIntervalSize20EndLowerThanStart() { final int expected = 20; assertEquals(expected, instance.getIntervalSize(277, 9)); }
@Test public void testGetIntervalSize4EndLowerThanStart() { final int expected = 4; assertEquals(expected, instance.getIntervalSize(286, 2)); }
@Test public void testGetIntervalSize10() { final int expected = 10; assertEquals(expected, instance.getIntervalSize(1, 11)); }