public void setCreateGUI(boolean createGUI) { this.simulationConstructionSetParameters.setCreateGUI(createGUI); }
public void setCreateGUI(boolean createGUI) { this.simulationConstructionSetParameters.setCreateGUI(createGUI); }
public void setCreateGUI(boolean createGUI) { this.simulationConstructionSetParameters.setCreateGUI(createGUI); }
private SimulationConstructionSet constructSimulationConstructionSet(Robot robot, RobotController controller) { SimulationConstructionSetParameters parameters = SimulationConstructionSetParameters.createFromSystemProperties();; parameters.setCreateGUI(SHOW_GUI); SimulationConstructionSet scs = new SimulationConstructionSet(robot, parameters); scs.setDT(DT, 1); Thread thread = new Thread(scs); thread.start(); try { Thread.sleep(2000); } catch (InterruptedException e) { } return scs; }
private SimulationConstructionSet createSimulation() { SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters(); parameters.setCreateGUI(false); return new SimulationConstructionSet(createRobot(), parameters); }
private void setupSim() { SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters(); parameters.setCreateGUI(simulationTestingParameters.getCreateGUI()); simulationConstructionSet = new SimulationConstructionSet(robot, parameters); simulationConstructionSet.setDT(0.001, 1); bsr = new BlockingSimulationRunner(simulationConstructionSet, 60.0 * 10.0); Thread simThread = new Thread(simulationConstructionSet); simThread.start(); }
public LogVisualizer(int bufferSize, boolean showOverheadView, File logFile) throws IOException { if (logFile == null) { logFile = FileSelectionDialog.loadDirectoryWithFileNamed(YoVariableLoggerListener.propertyFile); } if (logFile != null) { System.out.println("loading log from folder:" + logFile); SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters(); parameters.setCreateGUI(true); parameters.setDataBufferSize(bufferSize); scs = new SimulationConstructionSet(parameters); scs.setFastSimulate(true, 50); readLogFile(logFile, showOverheadView); if (PRINT_OUT_YOVARIABLE_NAMES) printOutYoVariableNames(); } else { scs = null; } }
public LogVisualizer(int bufferSize, boolean showOverheadView, File logFile) throws IOException { if (logFile == null) { logFile = FileSelectionDialog.loadDirectoryWithFileNamed(YoVariableLoggerListener.propertyFile); } if (logFile != null) { System.out.println("loading log from folder:" + logFile); SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters(); parameters.setCreateGUI(true); parameters.setDataBufferSize(bufferSize); scs = new SimulationConstructionSet(parameters); scs.setFastSimulate(true, 50); readLogFile(logFile, showOverheadView); if (PRINT_OUT_YOVARIABLE_NAMES) printOutYoVariableNames(); } else { scs = null; } }
public LogVisualizer(int bufferSize, boolean showOverheadView, File logFile) throws IOException { if (logFile == null) { logFile = FileSelectionDialog.loadDirectoryWithFileNamed(YoVariableLoggerListener.propertyFile); } if (logFile != null) { System.out.println("loading log from folder:" + logFile); SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters(); parameters.setCreateGUI(true); parameters.setDataBufferSize(bufferSize); scs = new SimulationConstructionSet(parameters); scs.setFastSimulate(true, 50); readLogFile(logFile, showOverheadView); if (PRINT_OUT_YOVARIABLE_NAMES) printOutYoVariableNames(); } else { scs = null; } }
private void doATestWithJustAnSCS() throws SimulationExceededMaximumTimeException { // BambooTools.reportTestStartedMessage(simulationTestingParameters.getShowWindows()); SimulationConstructionSetParameters simulationConstructionSetParameters = new SimulationConstructionSetParameters(); simulationConstructionSetParameters.setCreateGUI(true); simulationConstructionSetParameters.setShowSplashScreen(false); simulationConstructionSetParameters.setShowWindows(true); SimulationConstructionSet scs = new SimulationConstructionSet(new Robot("TEST"), simulationConstructionSetParameters); scs.startOnAThread(); ThreadTools.sleep(4000); scs.closeAndDispose(); // BambooTools.reportTestFinishedMessage(simulationTestingParameters.getShowWindows()); }
public <T extends RobotControllerWithAttachRobot> SimulationConstructionSet setupSCS(T controller) throws InterruptedException { boolean showGUI = true; FallingBrickRobot robot = new FallingBrickRobot(); controller.attachRobot(robot); assertFalse(controller.getYoVariableRegistry() == null); robot.setController(controller); SimulationConstructionSetParameters parameters = SimulationConstructionSetParameters.createFromSystemProperties();; parameters.setCreateGUI(showGUI); parameters.setDataBufferSize(2000); SimulationConstructionSet scs = new SimulationConstructionSet(robot, parameters); scs.setFrameMaximized(); scs.startOnAThread(); Thread.sleep(DELAY_TIME_FOR_HUMAN_CONVENIENT_VIEWING); StandardSimulationGUI scsGUI = scs.getStandardSimulationGUI(); EntryBoxArrayPanel temp = scsGUI.getEntryBoxArrayPanel(); temp.removeAllEntryBoxes(); scsGUI.getEntryBoxArrayPanel().updateUI(); Thread.sleep(DELAY_TIME_FOR_HUMAN_CONVENIENT_VIEWING); return scs; }
parameters.setCreateGUI(true); parameters.setDataBufferSize(5000); scs = new SimulationConstructionSet(parameters);
parameters.setCreateGUI(false); parameters.setDataBufferSize(100); SimulationConstructionSet scs0 = new SimulationConstructionSet(new Robot("Null"), parameters);
scsParameters.setCreateGUI(false);
parameters.setCreateGUI(SHOW_GUI); SimulationConstructionSet scs = new SimulationConstructionSet(robot, parameters); sleep(1000);
@ContinuousIntegrationTest(estimatedDuration = 0.6) @Test(timeout = 30000) public void testTwoRewindableSimulationsWithAScript() throws IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException, UnreasonableAccelerationException { Robot robot0 = createSimpleRobot(); RobotController rewindableController0 = new RewindableOrNotRewindableController(true); robot0.setController(rewindableController0); SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters(); parameters.setCreateGUI(false); parameters.setDataBufferSize(100); SimulationConstructionSet scs0 = new SimulationConstructionSet(robot0, parameters); scs0.setDT(0.0001, 11); scs0.startOnAThread(); Robot robot1 = createSimpleRobot(); RobotController rewindableController1 = new RewindableOrNotRewindableController(true); robot1.setController(rewindableController1); SimulationConstructionSet scs1 = new SimulationConstructionSet(robot1, parameters); scs1.setDT(0.0001, 11); scs1.startOnAThread(); int nTicksInitial = 121; int nTicksCompare = 121; int nTicksFinal = 11; SimulationComparisonScript script = new SimpleRewindabilityComparisonScript(nTicksInitial, nTicksCompare, nTicksFinal); ReflectionSimulationComparer.compareTwoSimulations(scs0, scs1, script, true, true); }
@ContinuousIntegrationTest(estimatedDuration = 0.5) @Test(timeout = 30000) public void testTwoNonRewindableSimulationsWithAScript() throws IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException, UnreasonableAccelerationException { Robot robot0 = new Robot("robot"); RobotController rewindableController0 = new RewindableOrNotRewindableController(false); robot0.setController(rewindableController0); SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters(); parameters.setCreateGUI(false); parameters.setDataBufferSize(100); SimulationConstructionSet scs0 = new SimulationConstructionSet(robot0, parameters); scs0.setDT(0.0001, 10); scs0.startOnAThread(); Robot robot1 = new Robot("robot"); RobotController rewindableController1 = new RewindableOrNotRewindableController(false); robot1.setController(rewindableController1); SimulationConstructionSet scs1 = new SimulationConstructionSet(robot1, parameters); scs1.setDT(0.0001, 10); scs1.startOnAThread(); int nTicksInitial = 20; int nTicksCompare = 30; int nTicksFinal = 40; SimulationComparisonScript script = new SimpleRewindabilityComparisonScript(nTicksInitial, nTicksCompare, nTicksFinal); ReflectionSimulationComparer.compareTwoSimulations(scs0, scs1, script, false, true); }
simulationConstructionSetParameters.setCreateGUI(false); simulationConstructionSetParameters.setShowSplashScreen(false); SimulationConstructionSet scs = new SimulationConstructionSet(robot, simulationConstructionSetParameters);
@ContinuousIntegrationTest(estimatedDuration = 0.3) @Test(timeout = 30000) public void testWithLowEpsilon() { AllYoVariablesSimulationComparer comparerWithLowEpsilon = new AllYoVariablesSimulationComparer(0.01); SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters(); parameters.setCreateGUI(false); SimulationConstructionSet scs1 = new SimulationConstructionSet(robot1, parameters); SimulationConstructionSet scs2 = new SimulationConstructionSet(robot2, parameters); scs1.getRootRegistry().addChild(rootRegistry1); scs2.getRootRegistry().addChild(rootRegistry2); yoDouble1.set(1.8); yoDouble2.set(2.0); yoDouble3.set(1.791); yoDouble4.set(2.009); assertFalse(comparerWithLowEpsilon.compare(scs1, scs2)); comparerWithLowEpsilon.addException("yoDoubleA12"); comparerWithLowEpsilon.addException("Ignore"); assertTrue(comparerWithLowEpsilon.compare(scs1, scs2)); yoDouble1.set(1.80); yoDouble2.set(2.0); yoDouble3.set(1.79); yoDouble4.set(2.009); assertFalse(comparerWithLowEpsilon.compare(scs1, scs2)); }
@ContinuousIntegrationTest(estimatedDuration = 0.4) @Test(timeout = 30000) public void testWithHighEpsilon() { AllYoVariablesSimulationComparer comparerWithLargeEpsilon = new AllYoVariablesSimulationComparer(5.0); SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters(); parameters.setCreateGUI(false); SimulationConstructionSet scs1 = new SimulationConstructionSet(robot1, parameters); SimulationConstructionSet scs2 = new SimulationConstructionSet(robot2, parameters); scs1.getRootRegistry().addChild(rootRegistry1); scs2.getRootRegistry().addChild(rootRegistry2); yoDouble1.set(98.56); yoDouble2.set(97.01); yoDouble3.set(94.98); yoDouble4.set(92.02); assertFalse(comparerWithLargeEpsilon.compare(scs1, scs2)); comparerWithLargeEpsilon.addException("yoDoubleA12"); comparerWithLargeEpsilon.addException("Ignore"); assertTrue(comparerWithLargeEpsilon.compare(scs1, scs2)); yoDouble1.set(97.02); yoDouble2.set(95.01); yoDouble3.set(9); yoDouble4.set(92.02); assertFalse(comparerWithLargeEpsilon.compare(scs1, scs2)); } }