package org.dgpf.search.api.utils;
import java.io.Serializable;
import org.dgpf.search.api.SearchContext;
/**
* This interface unifies classes that are able to mutate something in a
* randomized manner.
* @param <Genotype> The type of the things to be mutated.
* @param <Contexttype> The sort of context to be used.
* @param <Infotype> An information object to be propagated. If no
* information object is needed, just leave this
* parameter <code>Object</code> and always pass in
* <code>null</code>.
* @author Thomas Weise
*/
public interface IMutator<Genotype extends Serializable,
Contexttype extends SearchContext,
Infotype>
{
/**
* Perform the mutation.
* @param p_source The source object to create a randomizedly altered
* copy of.
* @param p_context The context hosting the operation.
* @param p_info The information record.
* @return The new, randomizedly altered copy of the object
* <code>p_source</code> or <code>p_source</code> itself if no
* mutation was possible.
*/
public abstract Genotype mutate (final Genotype p_source,
final Contexttype p_context,
final Infotype p_info);
}