private void finalizeStep(ArcState state, Robin robin) throws IOException { // should store long arcSteps = steps.get(); double arcXff = xff.get(); long nanSteps = state.getNanSteps(); //double nanPct = (double) nanSteps / (double) arcSteps; double accumValue = state.getAccumValue(); if (nanSteps <= arcXff * arcSteps && !Double.isNaN(accumValue)) { if (getConsolFun() == ConsolFun.AVERAGE) { accumValue /= (arcSteps - nanSteps); } robin.store(accumValue); } else { robin.store(Double.NaN); } state.setAccumValue(Double.NaN); state.setNanSteps(0); }
private void finalizeStep(ArcState state, Robin robin) throws IOException { // should store long arcSteps = steps.get(); double arcXff = xff.get(); long nanSteps = state.getNanSteps(); double accumValue = state.getAccumValue(); if (nanSteps <= arcXff * arcSteps && !Double.isNaN(accumValue)) { if (consolFun.get() == ConsolFun.AVERAGE) { accumValue /= (arcSteps - nanSteps); } robin.store(accumValue); } else { robin.store(Double.NaN); } state.setAccumValue(Double.NaN); state.setNanSteps(0); }
private void accumulate(ArcState state, double value) throws IOException { if (Double.isNaN(value)) { state.setNanSteps(state.getNanSteps() + 1); } else { switch (consolFun.get()) { case MIN: state.setAccumValue(Util.min(state.getAccumValue(), value)); break; case MAX: state.setAccumValue(Util.max(state.getAccumValue(), value)); break; case FIRST: if (Double.isNaN(state.getAccumValue())) { state.setAccumValue(value); } break; case LAST: state.setAccumValue(value); break; case AVERAGE: case TOTAL: state.setAccumValue(Util.sum(state.getAccumValue(), value)); break; } } }
"" + arc.getRows(), InspectorModel.formatDouble(state.getAccumValue()), "" + state.getNanSteps(), "" + arc.getStartTime() + " [" + new Date(arc.getStartTime() * 1000L) + "]", "" + arc.getEndTime() + " [" + new Date(arc.getEndTime() * 1000L) + "]"
private void accumulate(ArcState state, double value) throws IOException { if (Double.isNaN(value)) { state.setNanSteps(state.getNanSteps() + 1); } else { switch (ConsolFun.valueOf(consolFun.get())) { case MIN: state.setAccumValue(Util.min(state.getAccumValue(), value)); break; case MAX: state.setAccumValue(Util.max(state.getAccumValue(), value)); break; case LAST: state.setAccumValue(value); break; case AVERAGE: case TOTAL: state.setAccumValue(Util.sum(state.getAccumValue(), value)); break; } } }