Class OperatorModule<P extends Operator>

java.lang.Object
com.google.inject.AbstractModule
org.opt4j.start.Opt4JModule
org.opt4j.operator.OperatorModule<P>
Type Parameters:
P - The specific operator with a wildcard (?).
All Implemented Interfaces:
com.google.inject.Module
Direct Known Subclasses:
CopyModule, CrossoverModule, DiversityModule, MutateModule, NeighborModule

public abstract class OperatorModule<P extends Operator> extends Opt4JModule
Module class for an Operator.
  • Constructor Details

    • OperatorModule

      public OperatorModule()
  • Method Details

    • addOperator

      protected void addOperator(Class<? extends P> operator)
      Add an Operator.
      Parameters:
      operator - the operator to be added
    • addOperator

      protected void addOperator(AbstractGenericOperator.OperatorPredicate predicate, Class<? extends P> operator)
      Add an Operator and apply it to each Genotype that satisfies the predicate.
      Parameters:
      predicate - the predicate
      operator - the operator
    • getOperatorTypeLiteral

      protected abstract com.google.inject.TypeLiteral<P> getOperatorTypeLiteral()
    • addOperator

      protected void addOperator(Class<? extends Genotype> genotype, Class<? extends P> operator)
      Add an Operator and apply it to each Genotype that equals the given class.
      Parameters:
      genotype - the genotype class
      operator - the operator