for (Iterator iterator = selection.iterator(); iterator.hasNext();) {
Model model = (Model)iterator.next();
if (model instanceof ResourceAllocation) {
ResourceAllocationPerspective perspective = mainWindow.getRAPerspective();
ResourceAllocation raProblem = (ResourceAllocation) model;
if ((raProblem.isStarted()) && (!raProblem.isFailed()) && (!raProblem.isSolved())) {
raProblem.getSolverThread().stopSolving();
SolutionMonitorThread.monitors.get(raProblem.getName()).stopMonitoring(); // FIX: started problem fails to stop
}
raProblem.clear();
perspective.clearSolutionTables(raProblem.getName());
perspective.clearText();
perspective.setSummaryText(raProblem.getSummary());
perspective.getAlgSelector().select(raProblem.getAlgorithmIndex(raProblem.getAlgorithm()));
Text mText =
(Text)perspective.getOptionsGroup().getChildren()[ResourceAllocationPerspective.M_TEXT];
mText.setEnabled(false);
mText.setText("1");
perspective.getAlgSelector().setEnabled(true);
perspective.getOptionsGroup().setEnabled(true);
ClientLogManager.addUserLog("Results cleared for problem " + raProblem
+ " [#" + raProblem.getUniqueID() + "].", false);
}
mainWindow.getProblemBrowserTree().getTreeViewer().refresh();
}