Documentation of 'org.jgap.impl.ChromosomePool' Java class
ChromosomePool
org.jgap.impl

Class ChromosomePool

  • All Implemented Interfaces:
    IChromosomePool


    public class ChromosomePool
    extends java.lang.Object
    implements IChromosomePool
    Provides a pooling mechanism for Chromosome instances so that discarded Chromosome instances can be recycled, thus saving memory and the overhead of constructing new ones from scratch each time.
    Since:
    1.0
    • Constructor Detail

      • ChromosomePool

        public ChromosomePool()
        Constructor.
        Since:
        1.0
    • Method Detail

      • acquireChromosome

        public IChromosome acquireChromosome()
        Attempts to acquire an Chromosome instance from the chromosome pool. It should be noted that nothing is guaranteed about the value of the Chromosome's genes and they should be treated as undefined.
        Specified by:
        acquireChromosome in interface IChromosomePool
        Returns:
        a Chromosome instance from the pool or null if no Chromosome instances are available in the pool
        Since:
        1.0
      • releaseChromosome

        public void releaseChromosome(IChromosome a_chromosome)
        Releases a Chromosome to the pool. It's not required that the Chromosome originated from the pool--any Chromosome can be released to it. This method will invoke the cleanup() method on each of the Chromosome's genes prior to adding it back to the pool.
        Specified by:
        releaseChromosome in interface IChromosomePool
        Parameters:
        a_chromosome - the Chromosome instance to be released into the pool
        Since:
        1.0

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.