public static void main(String[] args) { SummaryStatistics statObject = new SummaryStatistics(); SummaryStatistics statByte = new SummaryStatistics(); for (int i = 0; i < 10; i++) { statByte.addValue(testByte()); statObject.addValue(testObject()); } System.out.println("Time (ms) Object: " + statObject.getMean() + " | " + statObject.getStandardDeviation()); System.out.println("Time (ms) Byte: " + statByte.getMean() + " | " + statByte.getStandardDeviation()); }
public static void main(String[] args) { SummaryStatistics statObject = new SummaryStatistics(); SummaryStatistics statByte = new SummaryStatistics(); for (int i = 0; i < 10; i++) { statByte.addValue(testByte()); statObject.addValue(testObject()); } System.out.println("Time (ms) Object: " + statObject.getMean() + " | " + statObject.getStandardDeviation()); System.out.println("Time (ms) Byte: " + statByte.getMean() + " | " + statByte.getStandardDeviation()); }
@Test public void testMemoryLeakage() { long memoryBaseline = 0; SummaryStatistics stats = new SummaryStatistics(); int numRuns = 25; for (int r = 0; r < numRuns; r++) { if (r == 1 || r == (numRuns - 1)) { memoryBaseline = MemoryAssess.getMemoryUse(); stats.addValue(memoryBaseline); //System.out.println("Memory before run "+(r+1)+": " + memoryBaseline / 1024 + " KB"); } for (int t = 0; t < 1000; t++) { graph.addVertex(); graph.tx().rollback(); TitanTransaction tx = graph.newTransaction(); tx.addVertex(); tx.rollback(); } if (r == 1 || r == (numRuns - 1)) { memoryBaseline = MemoryAssess.getMemoryUse(); stats.addValue(memoryBaseline); //System.out.println("Memory after run " + (r + 1) + ": " + memoryBaseline / 1024 + " KB"); } clopen(); } System.out.println("Average: " + stats.getMean() + " Std. Dev: " + stats.getStandardDeviation()); assertTrue(stats.getStandardDeviation() < stats.getMin()); }
@Test public void testMemoryLeakage() { long memoryBaseline = 0; SummaryStatistics stats = new SummaryStatistics(); int numRuns = 25; for (int r = 0; r < numRuns; r++) { if (r == 1 || r == (numRuns - 1)) { memoryBaseline = MemoryAssess.getMemoryUse(); stats.addValue(memoryBaseline); //System.out.println("Memory before run "+(r+1)+": " + memoryBaseline / 1024 + " KB"); } for (int t = 0; t < 1000; t++) { graph.addVertex(); graph.tx().rollback(); JanusGraphTransaction tx = graph.newTransaction(); tx.addVertex(); tx.rollback(); } if (r == 1 || r == (numRuns - 1)) { memoryBaseline = MemoryAssess.getMemoryUse(); stats.addValue(memoryBaseline); //System.out.println("Memory after run " + (r + 1) + ": " + memoryBaseline / 1024 + " KB"); } clopen(); } System.out.println("Average: " + stats.getMean() + " Std. Dev: " + stats.getStandardDeviation()); assertTrue(stats.getStandardDeviation() < stats.getMin()); }
/** * {@inheritDoc} */ @Override public synchronized double getMean() { return super.getMean(); }
/** * {@inheritDoc} */ @Override public synchronized double getMean() { return super.getMean(); }
/** * {@inheritDoc}. This version returns the mean of all the aggregated data. * * @see StatisticalSummary#getMean() */ public double getMean() { synchronized (statistics) { return statistics.getMean(); } }
/** * {@inheritDoc}. This version returns the mean of all the aggregated data. * * @see StatisticalSummary#getMean() */ public double getMean() { synchronized (statistics) { return statistics.getMean(); } }
/** * @see org.apache.commons.math.stat.descriptive.SummaryStatistics#getMean() */ public synchronized double getMean() { return super.getMean(); }
public double getMeanOutDegree() { // return avgOut; return outStats.getMean(); }
/** * @return the colourfulness value from the last image analysed */ public double getColorfulness() { final double var_rg = rgStats.getVariance(); final double var_yb = ybStats.getVariance(); final double mean_rg = rgStats.getMean(); final double mean_yb = ybStats.getMean(); final double stddev = Math.sqrt(var_rg + var_yb); final double mean = Math.sqrt(mean_rg * mean_rg + mean_yb * mean_yb); return stddev + 0.3 * mean; }
/** * @return the colourfulness value from the last image analysed */ public double getColorfulness() { final double var_rg = rgStats.getVariance(); final double var_yb = ybStats.getVariance(); final double mean_rg = rgStats.getMean(); final double mean_yb = ybStats.getMean(); final double stddev = Math.sqrt(var_rg + var_yb); final double mean = Math.sqrt(mean_rg * mean_rg + mean_yb * mean_yb); return stddev + 0.3 * mean; }
public static void main(String[] args) { SummaryStatistics statObject = new SummaryStatistics(); SummaryStatistics statByte = new SummaryStatistics(); for (int i = 0; i < 10; i++) { statByte.addValue(testByte()); statObject.addValue(testObject()); } System.out.println("Time (ms) Object: " + statObject.getMean() + " | " + statObject.getStandardDeviation()); System.out.println("Time (ms) Byte: " + statByte.getMean() + " | " + statByte.getStandardDeviation()); }
public static void main(String[] args) { SummaryStatistics statObject = new SummaryStatistics(); SummaryStatistics statByte = new SummaryStatistics(); for (int i = 0; i < 10; i++) { statByte.addValue(testByte()); statObject.addValue(testObject()); } System.out.println("Time (ms) Object: " + statObject.getMean() + " | " + statObject.getStandardDeviation()); System.out.println("Time (ms) Byte: " + statByte.getMean() + " | " + statByte.getStandardDeviation()); }
public String toString() { if (cachedStringRepresentation == null) { try { cachedStringRepresentation = "Min: " + (int) stats.getMin() + ", mean: " + (int) stats.getMean() + ", max: " + (int) stats.getMax() + ", stddev: " + (int) stats.getStandardDeviation() + ", score: " + (int) getScore(); } catch (IOException e) { throw new RuntimeException(e); } } return cachedStringRepresentation; } }
/** * Return a {@link StatisticalSummaryValues} instance reporting current * statistics. * * @return Current values of statistics */ public StatisticalSummary getSummary() { return new StatisticalSummaryValues(getMean(), getVariance(), getN(), getMax(), getMin(), getSum()); }
/** * Return a {@link StatisticalSummaryValues} instance reporting current * statistics. * @return Current values of statistics */ public StatisticalSummary getSummary() { return new StatisticalSummaryValues(getMean(), getVariance(), getN(), getMax(), getMin(), getSum()); }
/** * Return a {@link StatisticalSummaryValues} instance reporting current * statistics. * @return Current values of statistics */ public StatisticalSummary getSummary() { return new StatisticalSummaryValues(getMean(), getVariance(), getN(), getMax(), getMin(), getSum()); }