コード例 #1
0
 /** {@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);
   }
 }
コード例 #2
0
 public final void setComponents(IMutator[] components) {
   // Assign components
   this.components = components;
   // Contextualize (if necessary)
   if (context != null) {
     for (IMutator component : components) component.contextualize(context);
   }
 }
コード例 #3
0
 /** {@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;
 }