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
GenericOperator
s.-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Comparator for a specific order: Superclasses always are sorted after subclasses.static class
TheAbstractGenericOperator.OperatorClassPredicate
returnstrue
for a given specific class.protected static class
static interface
TheAbstractGenericOperator.OperatorPredicate
interface.static class
TheAbstractGenericOperator.OperatorVoidPredicate
interface is used as marker forOperator
s for which the predicate is not explicitly defined. -
Field Summary
-
Constructor Summary
ConstructorDescriptionAbstractGenericOperator
(Class<? extends Q>... clazzes) Constructs anAbstractGenericOperator
class with the given clazzes of default operators. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addOperator
(AbstractGenericOperator.OperatorPredicate predicate, O operator) Adds an operator.getOperator
(Genotype genotype) Returns all classOperators.getTarget
(O operator) protected void
Inject and organize the operators.
-
Field Details
-
classOperators
-
genericOperators
-
cldef
-
-
Constructor Details
-
AbstractGenericOperator
Constructs anAbstractGenericOperator
class 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:GenericOperator
Adds an operator.- Specified by:
addOperator
in interfaceGenericOperator<O extends Operator<?>>
- Parameters:
predicate
- the operator predicateoperator
- TheOperator
-
getOperator
Description copied from interface:GenericOperator
- Specified by:
getOperator
in interfaceGenericOperator<O extends Operator<?>>
- Parameters:
genotype
- the genotype- Returns:
- the operator for this genotype
-
getOperators
Description copied from interface:GenericOperator
Returns all classOperators.- Specified by:
getOperators
in interfaceGenericOperator<O extends Operator<?>>
- Returns:
- all classOperators
-
getTarget
- Type Parameters:
O
- the type of operator- Parameters:
operator
-- Returns:
- the target genotype
-