Interface MutationOperator<T>
-
- Type Parameters:
T
- The type of object used to represent candidate solutions to the problem.
- All Superinterfaces:
Splittable<MutationOperator<T>>
- All Known Subinterfaces:
IterableMutationOperator<T>
,UndoableMutationOperator<T>
- All Known Implementing Classes:
AdjacentSwapMutation
,BitFlipMutation
,BlockInterchangeMutation
,BlockMoveMutation
,CauchyMutation
,DefiniteBitFlipMutation
,GaussianMutation
,HybridMutation
,HybridUndoableMutation
,InsertionMutation
,RandomValueChangeMutation
,ReversalMutation
,ScrambleMutation
,SwapMutation
,UndoableCauchyMutation
,UndoableGaussianMutation
,UndoableRandomValueChangeMutation
,UndoableScrambleMutation
,UndoableUniformMutation
,UndoableUniformMutation
,UniformMutation
,UniformMutation
,WeightedHybridMutation
,WeightedHybridUndoableMutation
,WindowLimitedBlockMoveMutation
,WindowLimitedInsertionMutation
,WindowLimitedReversalMutation
,WindowLimitedScrambleMutation
,WindowLimitedSwapMutation
,WindowLimitedUndoableScrambleMutation
public interface MutationOperator<T> extends Splittable<MutationOperator<T>>
Implement the MutationOperator interface to implement a mutation operator for use in simulated annealing, and other metaheuristics, that require a way to generate random neighbors of a candidate solution.
If your mutation operator is one in which the inverse operation (i.e., the operation that reverts an object to its previous state from prior to the mutation) can be implemented without substantially affecting the runtime of the mutation itself, then consider implementing the
UndoableMutationOperator
interface instead, a subinterface of MutationOperator that adds an undo method.On the other hand, if implementing
UndoableMutationOperator.undo(T)
would require significant added cost in either time or memory to themutate(T)
method, then consider implementing two versions of your mutation operator, one that implements MutationOperator and a second that implementsUndoableMutationOperator
. In this way, you can use the first version with metaheuristics that do not utilize the undo method, and the second for those that do.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
mutate(T c)
Mutates a candidate solution to a problem, by randomly modifying its state.-
Methods inherited from interface org.cicirello.search.concurrent.Splittable
split
-
-
-
-
Method Detail
-
mutate
void mutate(T c)
Mutates a candidate solution to a problem, by randomly modifying its state. The mutant that is produced is in the local neighborhood of the original candidate solution.- Parameters:
c
- The candidate solution subject to the mutation. This method changes the state of c.
-
-