Example #1
0
 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);
     }
   }
 }
Example #2
0
 @Override
 public void run() {
   while (autorun != null && !mySolver.isDone()) {
     try {
       iterate();
       Thread.sleep(getTimeToSleep());
     } catch (Exception ex) {
       return; // thread abborted
     }
   }
   // clean autorun
   autorun = null;
 }