Example #1
0
 /**
  * solve the array of solvers in parallell
  *
  * @param verbose
  */
 public void solve(boolean verbose) {
   InitializeEvolution(verbose); // reset solvers
   // ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
   // running solvers
   ThreadRunSolver[] thr = new ThreadRunSolver[arrayOfSolvers.length];
   for (int i = 0; i < arrayOfSolvers.length; i++) {
     final int index = i;
     thr[i] = new ThreadRunSolver(arrayOfSolvers[index]);
     thr[i].start();
   }
   // ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
   // waiting to solvers finish
   for (Thread thread : thr) {
     try {
       thread.join();
     } catch (InterruptedException ex) {
       Logger.getLogger(EAsolver.class.getName()).log(Level.SEVERE, null, ex);
     }
   }
   // ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
   // save report
   // report = new ReportSolverArray(this);
   ((ReportSolverArray) report).updateEvolutionStatistics(arrayOfSolvers);
   ((ReportSolverArray) report).save();
   System.out.println(
       MyString.toString(new Date()) + " : Simulation " + report.filename + " Complete!");
 }