Exemple #1
0
 /**
  * Returns an instance of Subpopulation just like it had been before it was populated with
  * individuals. You may need to override this if you override Subpopulation. <b>IMPORTANT
  * NOTE</b>: if the size of the array in Subpopulation has been changed, then the clone will take
  * on the new array size. This helps some evolution strategies.
  *
  * @see Group#emptyClone()
  */
 public Group emptyClone() {
   try {
     Subpopulation p = (Subpopulation) clone();
     p.species = species; // don't throw it away...maybe this is a bad idea...
     p.individuals = new Individual[individuals.length]; // empty
     return p;
   } catch (CloneNotSupportedException e) {
     throw new InternalError();
   } // never happens
 }