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 getStandardDeviation() { return super.getStandardDeviation(); }
/** * @see org.apache.commons.math.stat.descriptive.SummaryStatistics#getStandardDeviation() */ public synchronized double getStandardDeviation() { return super.getStandardDeviation(); }
/** * {@inheritDoc}. This version returns the standard deviation of all the * aggregated data. * * @see StatisticalSummary#getStandardDeviation() */ public double getStandardDeviation() { synchronized (statistics) { return statistics.getStandardDeviation(); } }
/** * {@inheritDoc} */ @Override public synchronized double getStandardDeviation() { return super.getStandardDeviation(); }
/** * {@inheritDoc}. This version returns the standard deviation of all the * aggregated data. * * @see StatisticalSummary#getStandardDeviation() */ public double getStandardDeviation() { synchronized (statistics) { return statistics.getStandardDeviation(); } }
public double getStandardDeviation() { return statistics.getStandardDeviation(); } }
public double getInDegreeStdDev() { // return avgIn; return inStats.getStandardDeviation(); }
public double getStandardDeviation() { return summaryStatistics.getStandardDeviation(); }
double getScore() throws IOException { return Math.max(1, stats.getMean() * stats.getMean() - stats.getStandardDeviation() * stats.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; } }
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()); }
@Override public void analyseImage(FImage image) { final FImage limg = image.process(laplacian); final FImage aimg = image.process(average); final SummaryStatistics stats = new SummaryStatistics(); for (int r = 0; r < limg.height; r++) { for (int c = 0; c < limg.width; c++) { if (mask != null && mask.pixels[r][c] == 0) continue; if (aimg.pixels[r][c] != 0) { stats.addValue(Math.abs(limg.pixels[r][c] / aimg.pixels[r][c])); } } } sharpnessVariation = stats.getStandardDeviation(); }
/** * Pretty print a time * @param ss the stats defining the time * @return a string representing the time */ public static String format(SummaryStatistics ss) { if (ss.getN() == 1) { return formatTime(ss.getMean()); } return formatTime(ss.getMean(), ss.getStandardDeviation()); }
/** * Pretty print a time * @param ss the stats defining the time * @return a string representing the time */ public static String format(SummaryStatistics ss) { if (ss.getN() == 1) { return formatTime(ss.getMean()); } return formatTime(ss.getMean(), ss.getStandardDeviation()); }
private void writeDistribution(Language language, File outputDir, Genome genome) throws IOException { String fileName = language.getName() + " " + "Min: " + (int) genome.getFitness().stats.getMin() + " " + "Mean: " + (int) genome.getFitness().stats.getMean() + " " + "Max: " + (int) genome.getFitness().stats.getMax() + " " + "SD: " + (int) genome.getFitness().stats.getStandardDeviation() + " " + "Score: " + (int) genome.getFitness().getScore(); File output = new File(outputDir, fileName); FileWriter writer = new FileWriter(output); writer.write(genome.getFitness().toString() + "\n" + genome.toString()); writer.close(); }