Package org.opt4j.operator
Class AbstractGenericOperator<O extends Operator<?>,Q extends Operator<?>>
java.lang.Object
org.opt4j.operator.AbstractGenericOperator<O,Q>
- All Implemented Interfaces:
GenericOperator<O>
- Direct Known Subclasses:
AlgebraGenericImplementation,CopyGenericImplementation,CrossoverGenericImplementation,DiversityGenericImplementation,MutateGenericImplementation,NeighborGenericImplementation
public abstract class AbstractGenericOperator<O extends Operator<?>,Q extends Operator<?>>
extends Object
implements GenericOperator<O>
Superclass for
GenericOperators.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classComparator for a specific order: Superclasses always are sorted after subclasses.static classTheAbstractGenericOperator.OperatorClassPredicatereturnstruefor a given specific class.protected static classstatic interfaceTheAbstractGenericOperator.OperatorPredicateinterface.static classTheAbstractGenericOperator.OperatorVoidPredicateinterface is used as marker forOperators for which the predicate is not explicitly defined. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractGenericOperator(Class<? extends Q>... clazzes) Constructs anAbstractGenericOperatorclass with the given clazzes of default operators. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOperator(AbstractGenericOperator.OperatorPredicate predicate, O operator) Adds an operator.getOperator(Genotype genotype) Returns all classOperators.getTarget(O operator) protected voidInject and organize the operators.
-
Field Details
-
classOperators
-
genericOperators
-
cldef
-
-
Constructor Details
-
AbstractGenericOperator
Constructs anAbstractGenericOperatorclass with the given clazzes of default operators.- Parameters:
clazzes- the default operators
-
-
Method Details
-
inject
Inject and organize the operators.- Parameters:
holder- the operator holder
-
addOperator
Description copied from interface:GenericOperatorAdds an operator.- Specified by:
addOperatorin interfaceGenericOperator<O extends Operator<?>>- Parameters:
predicate- the operator predicateoperator- TheOperator
-
getOperator
Description copied from interface:GenericOperator- Specified by:
getOperatorin interfaceGenericOperator<O extends Operator<?>>- Parameters:
genotype- the genotype- Returns:
- the operator for this genotype
-
getOperators
Description copied from interface:GenericOperatorReturns all classOperators.- Specified by:
getOperatorsin interfaceGenericOperator<O extends Operator<?>>- Returns:
- all classOperators
-
getTarget
- Type Parameters:
O- the type of operator- Parameters:
operator-- Returns:
- the target genotype
-