Class OperatorModule<P extends org.opt4j.core.optimizer.Operator>

  • 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 org.opt4j.core.optimizer.Operator>
    extends org.opt4j.core.start.Opt4JModule
    Module class for an Operator.
    • Field Summary

      • Fields inherited from class org.opt4j.core.start.Opt4JModule

        SINGLETON
    • Constructor Summary

      Constructors 
      Constructor Description
      OperatorModule()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void addOperator​(java.lang.Class<? extends org.opt4j.core.Genotype> genotype, java.lang.Class<? extends P> operator)
      Add an Operator and apply it to each Genotype that equals the given class.
      void addOperator​(java.lang.Class<? extends P> operator)
      Add an Operator.
      void addOperator​(AbstractGenericOperator.OperatorPredicate predicate, java.lang.Class<? extends P> operator)
      Add an Operator and apply it to each Genotype that satisfies the predicate.
      void addOperatorSelector​(java.lang.Class<? extends org.opt4j.core.Genotype> genotype, java.lang.Class<? extends org.opt4j.core.optimizer.Operator> operatorType, java.lang.Class<? extends IOperatorSelector> selector)
      Adds an IOperatorSelector that decides which Operator is executed in case multiple Operators are registered for a Genotype.
      void addOperatorSelectorInstance​(java.lang.Class<? extends org.opt4j.core.Genotype> genotype, java.lang.Class<? extends org.opt4j.core.optimizer.Operator> operatorType, IOperatorSelector selector)
      Adds an IOperatorSelector that decides which Operator is executed in case multiple Operators are registered for a Genotype.
      protected abstract com.google.inject.TypeLiteral<P> getOperatorTypeLiteral()  
      • Methods inherited from class org.opt4j.core.start.Opt4JModule

        addControlListener, addIndividualStateListener, addOptimizerIterationListener, addOptimizerStateListener, bindConstant, bindConstant, bindConstant, bindConstant, config, configure, constant, multi
      • Methods inherited from class com.google.inject.AbstractModule

        addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OperatorModule

        public OperatorModule()
    • Method Detail

      • addOperator

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

        public void addOperator​(AbstractGenericOperator.OperatorPredicate predicate,
                                java.lang.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

        public void addOperator​(java.lang.Class<? extends org.opt4j.core.Genotype> genotype,
                                java.lang.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
      • addOperatorSelector

        public void addOperatorSelector​(java.lang.Class<? extends org.opt4j.core.Genotype> genotype,
                                        java.lang.Class<? extends org.opt4j.core.optimizer.Operator> operatorType,
                                        java.lang.Class<? extends IOperatorSelector> selector)
        Adds an IOperatorSelector that decides which Operator is executed in case multiple Operators are registered for a Genotype.
        Parameters:
        genotype - Genotype type for which the IOperatorSelector is applicable.
        selector - The IOperatorSelector to add.
      • addOperatorSelectorInstance

        public void addOperatorSelectorInstance​(java.lang.Class<? extends org.opt4j.core.Genotype> genotype,
                                                java.lang.Class<? extends org.opt4j.core.optimizer.Operator> operatorType,
                                                IOperatorSelector selector)
        Adds an IOperatorSelector that decides which Operator is executed in case multiple Operators are registered for a Genotype.
        Parameters:
        genotype - Genotype type for which the IOperatorSelector is applicable.
        selector - The IOperatorSelector to add.