103104105106107108109
* @return mean trajectory time in seconds */ public UncertainValue2 getMeanTrajectoryTime() { double mean = sum / count; double std = Math.sqrt(sumSquare / count - Math.pow(mean, 2.0)); return new UncertainValue2(mean / 1000.0, std / 1000.0); }
123124125126127128129130131132133
String eol = System.getProperty("line.separator"); writer.append("Simulation time: " + getSimulationTime() + " s" + eol); UncertainValue2 trajTime = getMeanTrajectoryTime(); writer.append("Average trajectory time: " + trajTime.doubleValue() + " +- " + trajTime.uncertainty() + " ms"); writer.close(); }
4748495051525354
@Test public void testGetMeanTrajectoryTime() { UncertainValue2 trajTime = listener.getMeanTrajectoryTime(); assertTrue(trajTime.doubleValue() > 0); }