public void iterate() { // solver not done if (!mySolver.isDone()) { // next generation mySolver.iterate(); // notify changes fireEvolutionChanges(mySolver); // solver done if (mySolver.isDone()) { // notify complete fireEvolutionComplete(mySolver); } } }
@Override public void run() { while (autorun != null && !mySolver.isDone()) { try { iterate(); Thread.sleep(getTimeToSleep()); } catch (Exception ex) { return; // thread abborted } } // clean autorun autorun = null; }