/** {@inheritDoc} */ public void contextualize(ISystem context) { // Set execution context this.context = context; // Contextualize components (if necessary) if (components != null) { for (IMutator component : components) component.contextualize(context); } }
public final void setComponents(IMutator[] components) { // Assign components this.components = components; // Contextualize (if necessary) if (context != null) { for (IMutator component : components) component.contextualize(context); } }
/** {@inheritDoc} */ public List<IIndividual> mutate(List<IIndividual> parents) { // Allocate space for result ArrayList<IIndividual> result = new ArrayList<IIndividual>(); // Apply component mutators over parents and // add all mutated individuals to result for (IMutator component : components) { result.addAll(component.mutate(parents)); } // Return result return result; }