/** s-DLIM Extraction test. */ public void testArrivalRateFileIntoSequence() { try { ModelExtractor.extractArrivalRateFileIntoSequenceBinarySplits( root, ArrivalRateReader.readFileToList(TEST_TRACE, 0.0), 24, 1, "SinTrend", "SinTrend", "MULT", true); testOutputModel(0.16, 0.1); } catch (CalibrationException e) { fail("Model Extractor threw a CalibrationException: " + e.getMessage()); } catch (IOException e) { fail("Did not find arrival rate file."); } }
/** * hl-DLIM Extraction test. This one is really hard to test for correctness, as the "correct" * result could pretty much be anything. So all this test does is to check, whether the result ist * at least in the approximate ballpark. */ public void testArrivalRateFileIntoParameters() { try { HLDlimParameterContainer params = ModelExtractor.extractArrivalRateFileIntoParameters( TEST_TRACE, 24, 0.0, 1, "SinTrend", "SinTrend", "MULT", true); assertTrue(params.getFirstPeak() > 1000000 && params.getFirstPeak() < 3500000); assertTrue(params.getLastPeak() > 1000000 && params.getLastPeak() < 3500000); assertTrue(params.getInnerBase() > 1500000); assertTrue(params.getBase() > 0); assertTrue(params.getPeakIntervalWidth() < 24); assertTrue(params.getPeakNum() > 0); assertTrue(params.getNoiseMax() > 0); assertTrue(params.getTrendPoints().length > 50); } catch (CalibrationException e) { fail("Model Extractor threw a CalibrationException: " + e.getMessage()); } }
/** p-DLIM Extraction test. */ public void testArrivalRateFilePeriodic() { int[] weekly = {3, 4}; int[] biweekly = {7, 7}; try { ModelExtractor.extractSequenceFromArrivalRateFilePeriodic( root, ArrivalRateReader.readFileToList(TEST_TRACE, 0.0), 24, Arrays.asList(weekly, biweekly), "SinTrend", "SinTrend", "MULT", false); testOutputModel(0.18, 0.15); } catch (CalibrationException e) { fail("Model Extractor threw a CalibrationException: " + e.getMessage()); } catch (IOException e) { fail("Did not find arrival rate file."); } }