net.sourceforge.cilib.pso.dynamic
Class DynamicIterationStrategy<E extends PopulationBasedAlgorithm>

java.lang.Object
  extended by net.sourceforge.cilib.pso.dynamic.DynamicIterationStrategy<E>
All Implemented Interfaces:
Serializable, IterationStrategy<E>, Cloneable

public class DynamicIterationStrategy<E extends PopulationBasedAlgorithm>
extends Object
implements IterationStrategy<E>

Dynamic iteration strategy for PSO in dynamic environments. In each iteration, it checks for an environmental change, and reinitialises a percentage of the swarm once such a change is detected in order to preserve diversity. The algorithm is adopted from

Author:
Anna Rakitianskaia
See Also:
Serialized Form

Constructor Summary
DynamicIterationStrategy()
          Create a new instance of DynamicIterationStrategy.
DynamicIterationStrategy(DynamicIterationStrategy copy)
          Create a copy of the provided instance.
 
Method Summary
 DynamicIterationStrategy<E> getClone()
          Create a cloned copy of the current object and return it.
 EnvironmentChangeDetectionStrategy<PopulationBasedAlgorithm> getDetectionStrategy()
          Get the currently defined EnvironmentChangeDetectionStrategy.
 IterationStrategy<PopulationBasedAlgorithm> getIterationStrategy()
          Get the current IterationStrategy.
 EnvironmentChangeResponseStrategy<PopulationBasedAlgorithm> getResponseStrategy()
          Get the currently defined EnvironmentChangeResponseStrategy,
 void performIteration(E algorithm)
          Perform the iteration of the PopulationBasedAlgorithm.
 void setDetectionStrategy(EnvironmentChangeDetectionStrategy<PopulationBasedAlgorithm> detectionStrategy)
          Set the EnvironmentChangeDetectionStrategy to be used.
 void setIterationStrategy(IterationStrategy<PopulationBasedAlgorithm> iterationStrategy)
          Set the IterationStrategy to be used.
 void setResponseStrategy(EnvironmentChangeResponseStrategy<PopulationBasedAlgorithm> responseStrategy)
          Set the current EnvironmentChangeResponseStrategy to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicIterationStrategy

public DynamicIterationStrategy()
Create a new instance of DynamicIterationStrategy.

The following defaults are set in the constructor: randomiser is instantiated as a MersenneTwister, theta is set to 0.001, reinitialisationRatio is set to 0.5 (reinitialise one half of the swarm)


DynamicIterationStrategy

public DynamicIterationStrategy(DynamicIterationStrategy copy)
Create a copy of the provided instance.

Parameters:
copy - The instance to copy.
Method Detail

getClone

public DynamicIterationStrategy<E> 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<E extends PopulationBasedAlgorithm>
Specified by:
getClone in interface Cloneable
Returns:
An exact clone of the current object instance.
See Also:
Object.clone()

performIteration

public void performIteration(E algorithm)
Description copied from interface: IterationStrategy
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<E extends PopulationBasedAlgorithm>
Parameters:
algorithm - The algorithm to perform the iteration process on.
See Also:
Structure of Dynamic iteration strategy with re-initialisation:
  1. Check for environment change
  2. If the environment has changed:
    1. Respond to change
      1. Perform normal iteration

getIterationStrategy

public IterationStrategy<PopulationBasedAlgorithm> getIterationStrategy()
Get the current IterationStrategy.

Returns:
The current IterationStrategy.

setIterationStrategy

public void setIterationStrategy(IterationStrategy<PopulationBasedAlgorithm> iterationStrategy)
Set the IterationStrategy to be used.

Parameters:
iterationStrategy - The value to set.

getDetectionStrategy

public EnvironmentChangeDetectionStrategy<PopulationBasedAlgorithm> getDetectionStrategy()
Get the currently defined EnvironmentChangeDetectionStrategy.

Returns:
The current EnvironmentChangeDetectionStrategy.

setDetectionStrategy

public void setDetectionStrategy(EnvironmentChangeDetectionStrategy<PopulationBasedAlgorithm> detectionStrategy)
Set the EnvironmentChangeDetectionStrategy to be used.

Parameters:
detectionStrategy - The EnvironmentChangeDetectionStrategy to set.

getResponseStrategy

public EnvironmentChangeResponseStrategy<PopulationBasedAlgorithm> getResponseStrategy()
Get the currently defined EnvironmentChangeResponseStrategy,

Returns:
The current EnvironmentChangeResponseStrategy.

setResponseStrategy

public void setResponseStrategy(EnvironmentChangeResponseStrategy<PopulationBasedAlgorithm> responseStrategy)
Set the current EnvironmentChangeResponseStrategy to use.

Parameters:
responseStrategy - The EnvironmentChangeResponseStrategy to set.


Copyright © 2009 CIRG. All Rights Reserved.