|
@@ -56,7 +56,9 @@ public class FlexExample implements Algorithm {
|
|
|
private boolean useGroupNode = false;
|
|
|
private DecoratedGroupNode dGroupNode = null;
|
|
|
private boolean cancel = false;
|
|
|
-
|
|
|
+ private boolean overAllTimeSteps = false;
|
|
|
+
|
|
|
+
|
|
|
|
|
|
//Parameter defined by Algo
|
|
|
private HashMap<Integer, AccessWrapper> access;
|
|
@@ -143,6 +145,14 @@ public class FlexExample implements Algorithm {
|
|
|
borderPanel.add(useGroupNodeCheckBox);
|
|
|
|
|
|
|
|
|
+ JCheckBox overAllTimeStepsCheckbox = new JCheckBox("overAllTimeSteps");
|
|
|
+ overAllTimeStepsCheckbox.setSelected(false);
|
|
|
+ overAllTimeStepsCheckbox.setBounds(20, 30, 250, 30);
|
|
|
+ overAllTimeStepsCheckbox.addActionListener(actionEvent -> {
|
|
|
+ overAllTimeSteps = overAllTimeStepsCheckbox.isSelected();
|
|
|
+ });
|
|
|
+ parameterPanel.add(overAllTimeStepsCheckbox);
|
|
|
+
|
|
|
NumberFormat format = NumberFormat.getIntegerInstance();
|
|
|
format.setGroupingUsed(false);
|
|
|
format.setParseIntegerOnly(true);
|
|
@@ -177,7 +187,10 @@ public class FlexExample implements Algorithm {
|
|
|
buttonPanel.add(undoButton);
|
|
|
JButton runButton = new JButton("Run");
|
|
|
runButton.addActionListener(actionEvent -> {
|
|
|
- Runnable task = () -> run();
|
|
|
+ Runnable task = () -> {
|
|
|
+ if(this.overAllTimeSteps)runAll();
|
|
|
+ else run();
|
|
|
+ };
|
|
|
runThread = new Thread(task);
|
|
|
runThread.start();
|
|
|
});
|
|
@@ -195,19 +208,30 @@ public class FlexExample implements Algorithm {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void run() {
|
|
|
+ private void runAll() {
|
|
|
cancel = false;
|
|
|
disableGuiInput(true);
|
|
|
startTimer();
|
|
|
- executeDemoAlgo();
|
|
|
- if(cancel) {
|
|
|
- resetLast();
|
|
|
- disableGuiInput(false);
|
|
|
- return;
|
|
|
+ control.resetSimulation();
|
|
|
+ for(int i = 0; i < 100; i++) {
|
|
|
+ control.setCurIteration(i);
|
|
|
+ executeDemoAlgo();
|
|
|
+ if(cancel) {
|
|
|
+ resetLast();
|
|
|
+ disableGuiInput(false);
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
printElapsedTime();
|
|
|
disableGuiInput(false);
|
|
|
}
|
|
|
+ private void run() {
|
|
|
+ disableGuiInput(true);
|
|
|
+ startTimer();
|
|
|
+ executeDemoAlgo();
|
|
|
+ printElapsedTime();
|
|
|
+ disableGuiInput(false);
|
|
|
+ }
|
|
|
|
|
|
private void resetLast() {
|
|
|
if(!resetChain.isEmpty()) {
|