lio.mutation.bitchain
Class BinaryMutation

java.lang.Object
  extended by lio.mutation.bitchain.BinaryMutation
All Implemented Interfaces:
LiOResource, Mutation

public class BinaryMutation
extends java.lang.Object
implements Mutation

Implements the classical mutation operator for binary strings.


Constructor Summary
BinaryMutation()
           
 
Method Summary
 LiOResourceDefinition getDefinition()
          Return a LiOResDescription object with the information of each object.
static void main(java.lang.String[] args)
          Main class that allows testing the class.
 void mutate(Individual ind)
          Applies mutation to one position choosen at random.
 void mutate(Individual ind, double probability)
          Applies mutation to each position depending on the probability.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryMutation

public BinaryMutation()
Method Detail

mutate

public void mutate(Individual ind,
                   double probability)
Applies mutation to each position depending on the probability.

Specified by:
mutate in interface Mutation
Parameters:
individual - Individual that will be mutated.
pMutationProbability - probability of carrying out the mutation.

mutate

public void mutate(Individual ind)
Applies mutation to one position choosen at random.

Specified by:
mutate in interface Mutation
Parameters:
individual - Individual that will be mutated.

getDefinition

public LiOResourceDefinition getDefinition()
Return a LiOResDescription object with the information of each object. That object holds the name and all parameters that describe the object

Specified by:
getDefinition in interface LiOResource
Returns:
A definition of the object.

main

public static void main(java.lang.String[] args)
Main class that allows testing the class.

Parameters:
args - Arguments passed by command line