net.sourceforge.cilib.ec.iterationstrategies
Class GeneticAlgorithmIterationStrategy

java.lang.Object
  extended by net.sourceforge.cilib.algorithm.population.AbstractIterationStrategy<EC>
      extended by net.sourceforge.cilib.ec.iterationstrategies.GeneticAlgorithmIterationStrategy
All Implemented Interfaces:
Serializable, IterationStrategy<EC>, Cloneable

public class GeneticAlgorithmIterationStrategy
extends AbstractIterationStrategy<EC>

TODO: Complete this javadoc.

Author:
Gary Pampara
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.cilib.algorithm.population.AbstractIterationStrategy
boundaryConstraint, operatorPipeline
 
Constructor Summary
GeneticAlgorithmIterationStrategy()
          Create an instance of the IterationStrategy.
GeneticAlgorithmIterationStrategy(GeneticAlgorithmIterationStrategy copy)
          Copy constructor.
 
Method Summary
 GeneticAlgorithmIterationStrategy getClone()
          Create a cloned copy of the current object and return it.
 CrossoverStrategy getCrossoverStrategy()
          Get the currently specified CrossoverStrategy.
 MutationStrategy getMutationStrategy()
          Get the currently specified MutationStrategy.
 void performIteration(EC ec)
          Perform the iteration of the PopulationBasedAlgorithm.
 void setCrossoverStrategy(CrossoverStrategy crossoverStrategy)
          Set the current CrossoverStrategy and reinitialise the operator pipeline.
 void setMutationStrategy(MutationStrategy mutationStrategy)
          Set the current MutationStrategy and reinitialise the operator pipeline.
 
Methods inherited from class net.sourceforge.cilib.algorithm.population.AbstractIterationStrategy
getBoundaryConstraint, getOperatorPipeline, setBoundaryConstraint, setOperatorPipeline
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneticAlgorithmIterationStrategy

public GeneticAlgorithmIterationStrategy()
Create an instance of the IterationStrategy. Default cross-over and mutation operators are UniformCrossoverStrategy and GaussianMutationStrategy respectively.


GeneticAlgorithmIterationStrategy

public GeneticAlgorithmIterationStrategy(GeneticAlgorithmIterationStrategy copy)
Copy constructor. Create an instance that is a copy of the provided instance.

Parameters:
copy - the instance to copy.
Method Detail

getClone

public GeneticAlgorithmIterationStrategy getClone()
Create a cloned copy of the current object and return it. In general the created copy will be a deep copy of the provided instance. As a result this operation an be quite expensive if used incorrectly.

Specified by:
getClone in interface IterationStrategy<EC>
Specified by:
getClone in interface Cloneable
Specified by:
getClone in class AbstractIterationStrategy<EC>
Returns:
An exact clone of the current object instance.
See Also:
Object.clone()

performIteration

public void performIteration(EC ec)
Perform the iteration of the PopulationBasedAlgorithm.

Due to the nature of the PopulationBasedAlgorithms, the actual manner in which the algorithm's iteration is performed is deferred to the specific iteration strategy being used.

This implies that the general structure of the iteration for a specific flavour of algorithm is constant with modifications on that algorithm being made. For example, within a Genetic Algorithm you would expect:

  1. Parent individuals to be selected in some manner
  2. A crossover process to be done on the selected parent individuals to create the offspring
  3. A mutation process to alter the generated offspring
  4. Recombine the existing parent individuals and the generated offspring to create the next generation

Specified by:
performIteration in interface IterationStrategy<EC>
Specified by:
performIteration in class AbstractIterationStrategy<EC>
Parameters:
ec - The EC algorithm to perform the iteration on.

getCrossoverStrategy

public CrossoverStrategy getCrossoverStrategy()
Get the currently specified CrossoverStrategy.

Returns:
The current CrossoverStrategy.

setCrossoverStrategy

public void setCrossoverStrategy(CrossoverStrategy crossoverStrategy)
Set the current CrossoverStrategy and reinitialise the operator pipeline.

Parameters:
crossoverStrategy - The CrossoverStrategy to use.

getMutationStrategy

public MutationStrategy getMutationStrategy()
Get the currently specified MutationStrategy.

Returns:
The current MutationStrategy.

setMutationStrategy

public void setMutationStrategy(MutationStrategy mutationStrategy)
Set the current MutationStrategy and reinitialise the operator pipeline.

Parameters:
mutationStrategy - The MutationStrategy to use.


Copyright © 2009 CIRG. All Rights Reserved.