private static void deleteFirstDataPointAndCropData(SimulationConstructionSet scs) { scs.gotoInPointNow(); scs.tick(1); scs.setInPoint(); scs.cropBuffer(); }
private static void deleteFirstDataPointAndCropData(SimulationConstructionSet scs) { scs.gotoInPointNow(); scs.tick(1); scs.setInPoint(); scs.cropBuffer(); scs.gotoOutPointNow(); }
public void cropFirstPoint() { scs.cropBuffer(); scs.gotoInPointNow(); scs.stepForwardNow(1); scs.setInPoint(); scs.cropBuffer(); }
private static void deleteFirstDataPointAndCropData(SimulationConstructionSet scs) { scs.gotoInPointNow(); scs.tick(1); scs.setInPoint(); scs.cropBuffer(); scs.gotoOutPointNow(); }
public void cropFirstPoint() { scs.cropBuffer(); scs.gotoInPointNow(); scs.stepForwardNow(1); scs.setInPoint(); scs.cropBuffer(); }
public void cropInitialSimPoints(int numberOfDataPointsToCrop) { scs.cropBuffer(); scs.gotoInPointNow(); scs.stepForwardNow(numberOfDataPointsToCrop); scs.setInPoint(); scs.cropBuffer(); }
scss.get(0).gotoInPointNow(); scss.get(0).simulate(1); BlockingSimulationRunner.waitForSimulationToFinish(scss.get(0), maximumClockRunTimeInSeconds, true);
if (createVideo) scs.gotoInPointNow();
public static void testRewindabilityNumberOfTicks(SimulationConstructionSet scs, int nTicks, List<String> namesToSkipOver) throws SimulationExceededMaximumTimeException { // create state files int nStateFiles = 2; ArrayList<File> stateFiles = createStateFiles(nStateFiles); // System.out.println("Simulation created"); // run, write state file, rewind, repeat for (int i = 0; i < nStateFiles; i++) { scs.simulate(nTicks); BlockingSimulationRunner.waitForSimulationToFinish(scs, 120.0, true); scs.writeState(stateFiles.get(i)); // System.out.println("Run " + i + " done."); scs.gotoInPointNow(); assertEquals(scs.getIndex(), 0); } compare(stateFiles, scs, namesToSkipOver); }
/** * Simple rewindability test. * run, write state file, rewind, run, write state file. * @throws SimulationExceededMaximumTimeException */ public static void testRewindabilitySimple(SimulationConstructionSet scs, double simulationTime, ArrayList<String> namesToSkipOver) throws SimulationExceededMaximumTimeException { // create state files int nStateFiles = 2; ArrayList<File> stateFiles = createStateFiles(nStateFiles); // System.out.println("Simulation created"); // run, write state file, rewind, repeat for (int i = 0; i < nStateFiles; i++) { scs.simulate(simulationTime); BlockingSimulationRunner.waitForSimulationToFinish(scs, 120.0, true); scs.writeState(stateFiles.get(i)); // System.out.println("Run " + i + " done."); scs.gotoInPointNow(); assertEquals(scs.getIndex(), 0); } // compare compare(stateFiles, scs, namesToSkipOver); }
scs.gotoInPointNow(); scs.simulate(nTicksFinal); waitForSimulationToFinish(scs);
@Override public void doFinalAction(SimulationConstructionSet scs0, SimulationConstructionSet scs1) { SimulationConstructionSet[] scss = {scs0, scs1}; for (SimulationConstructionSet scs : scss) { scs.setInPoint(); scs.simulate(nTicksCompare); } for (SimulationConstructionSet scs : scss) { waitForSimulationToFinish(scs); } File stateFile = new File("stateFile"); scs0.writeState(stateFile); scs0.gotoInPointNow(); scs0.simulate(1); scs0.writeState(stateFile); stateFile.delete(); for (SimulationConstructionSet scs : scss) { scs.simulate(nTicksFinal); } for (SimulationConstructionSet scs : scss) { waitForSimulationToFinish(scs); } }
private void cropSCSBuffer(SimulationConstructionSet scs, SimulationTestingParameters simulationTestingParameters) { if (scs != null) { scs.gotoInPointNow(); scs.tick(2); ThreadTools.sleep(100L); scs.setInPoint(); ThreadTools.sleep(100L); scs.cropBuffer(); if (simulationTestingParameters.getKeepSCSUp()) { ThreadTools.sleepForever(); } } }
YoDouble t = (YoDouble) scs.getVariable("t"); scs.gotoInPointNow(); while(Math.abs(desiredICPX.getDoubleValue()) < 1e-4)
simulationConstructionSet.gotoInPointNow();
simulationConstructionSet.gotoInPointNow();
simulationConstructionSet.gotoInPointNow();
scs.gotoInPointNow(); scs.tick(500);
assertEquals(100, scs.getIndex()); scs.gotoInPointNow(); assertEquals(2, simulationRewoundListener.getCount()); assertEquals(0, scs.getIndex());