Beispiel #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
 }
  /** Read additional parameters for the spatially-embedded subpopulation. */
  public void setup(final EvolutionState state, final Parameter base) {
    super.setup(state, base);

    // by default, the space is toroidal
    toroidal = state.parameters.getBoolean(base.push(P_TOROIDAL), null, true);
  }