es.udc.gii.common.eaf.algorithm.operator.replace.mmga
Class PopulationMemoryReplaceOperator

java.lang.Object
  extended by java.util.Observable
      extended by es.udc.gii.common.eaf.algorithm.operator.replace.ReplaceOperator
          extended by es.udc.gii.common.eaf.algorithm.operator.replace.mmga.PopulationMemoryReplaceOperator
All Implemented Interfaces:
Operator, Configurable

public class PopulationMemoryReplaceOperator
extends ReplaceOperator

This class implements a replace operator for replacing the population memory of MMGAAlgorithm. It only replaces a part of the population memory. The rest is kept unchanged for providing diversity.

Configuration example:

 <HypercubeDivisions>25</HypercubeDivisions>
 <ReplacementCycle>4</ReplacementCycle>
 <ReplaceablePart>0.666</ReplaceablePart>
 
 
The values showed are the default values for these parameters. If some parameter is not explicitly set, it takes the default value.

The HypercubeDivisions parameter states how many divisions per dimension has the hypercube used for crowding.

The ReplacementCycle parameter sets the frequency in generations with which a replacement with solutions from the Pareto front is performed instead with those of the converged population (nominal solutions).

The PopulationMemorySize is the total population size of the population memory.

The ReplaceablePart is a number between 0 and 1 that sets the portion of the population memory that should be replaced.

Since:
1.0
Author:
Grupo Integrado de IngenierĂ­a (www.gii.udc.es)

Field Summary
private  int currentIndex
           
private  int hypercubeDivisions
           
private  int popMemSize
           
private  int replaceablePartSize
           
private  int replacementCycle
           
 
Constructor Summary
PopulationMemoryReplaceOperator()
          Creates a new instance of PopulationMemoryReplaceOperator
 
Method Summary
 void configure(org.apache.commons.configuration.Configuration conf)
          Configures the specific element that implements this method.
 int getHypercubeDivisions()
           
 int getPopMemSize()
           
 int getReplaceablePartSize()
           
 int getReplacementCycle()
           
private  int nextIndex()
           
protected  java.util.List<Individual> replace(EvolutionaryAlgorithm algorithm, java.util.List<Individual> toPopulation)
           
private  java.util.List<Individual> replaceWithNominalSolutions(MMGAAlgorithm mmga, java.util.List<Individual> toPopulation)
           
private  java.util.List<Individual> replaceWithParetoFront(MMGAAlgorithm mmga, java.util.List<Individual> toPopulation)
           
 void setHypercubeDivisions(int hypercubeDivisions)
          Estabishes the number of divisions per dimension of the hypercube.
 void setPopMemSize(int popMemSize)
          Sets the size of the population memory.
 void setReplaceablePartSize(int replaceablePartSize)
          Sets the number of individuals that are to be replaced from the population memory.
 void setReplacementCycle(int replacementCycle)
          Establishes the replacement frequency (in generations) of the population memory.
 
Methods inherited from class es.udc.gii.common.eaf.algorithm.operator.replace.ReplaceOperator
operate
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hypercubeDivisions

private int hypercubeDivisions

replaceablePartSize

private int replaceablePartSize

replacementCycle

private int replacementCycle

currentIndex

private int currentIndex

popMemSize

private int popMemSize
Constructor Detail

PopulationMemoryReplaceOperator

public PopulationMemoryReplaceOperator()
Creates a new instance of PopulationMemoryReplaceOperator

Method Detail

replace

protected java.util.List<Individual> replace(EvolutionaryAlgorithm algorithm,
                                             java.util.List<Individual> toPopulation)
Specified by:
replace in class ReplaceOperator

configure

public void configure(org.apache.commons.configuration.Configuration conf)
Description copied from interface: Configurable
Configures the specific element that implements this method.

Specified by:
configure in interface Configurable
Overrides:
configure in class ReplaceOperator
Parameters:
conf - a Configuration object.
See Also:
Configuration

nextIndex

private int nextIndex()

replaceWithNominalSolutions

private java.util.List<Individual> replaceWithNominalSolutions(MMGAAlgorithm mmga,
                                                               java.util.List<Individual> toPopulation)

replaceWithParetoFront

private java.util.List<Individual> replaceWithParetoFront(MMGAAlgorithm mmga,
                                                          java.util.List<Individual> toPopulation)

getReplacementCycle

public int getReplacementCycle()
Returns:
The the replacement frequency (in generations) of the population memory.

setReplacementCycle

public void setReplacementCycle(int replacementCycle)
Establishes the replacement frequency (in generations) of the population memory.

Parameters:
replacementCycle - The new frequency. As an example, setting this frequency to 5 means that every 5 generations a replacement will take place.

getHypercubeDivisions

public int getHypercubeDivisions()
Returns:
The number of divisions per dimension of the hypercube.

setHypercubeDivisions

public void setHypercubeDivisions(int hypercubeDivisions)
Estabishes the number of divisions per dimension of the hypercube.

Parameters:
hypercubeDivisions - The new number of divisions per dimension of the hypercube.

getReplaceablePartSize

public int getReplaceablePartSize()
Returns:
The number of individuals that are to be replaced from the population memory.

setReplaceablePartSize

public void setReplaceablePartSize(int replaceablePartSize)
Sets the number of individuals that are to be replaced from the population memory.

Parameters:
replaceablePartSize - The new number of individuals that are to be replaced.

getPopMemSize

public int getPopMemSize()
Returns:
The size of the population memory.

setPopMemSize

public void setPopMemSize(int popMemSize)
Sets the size of the population memory.

Parameters:
popMemSize - The new size of the population memory considered by this operator.