jaga.evolve
Class Stretcher

java.lang.Object
  |
  +--jaga.evolve.Stretcher
All Implemented Interfaces:
GeneticOperator, java.io.Serializable

public class Stretcher
extends java.lang.Object
implements GeneticOperator

Strecher is a Genetic Operator that will add length to a genotype.

The amount it is streched by is configurable and even randomized between limits.

What data is placed in the new section is also configurable.

The position where this new data will be inserted/appended is also configurable.

NOTE: ONLY (FIXED) LENGTH OF NEW SECTION & POS OF SOURCE OF DATA TO COPY CONFIGURABLE

See Also:
Serialized Form

Constructor Summary
Stretcher()
          Creates new Stretcher.
Stretcher(int stretchAmountP, int copyFromP)
          Creates new Stretcher.
 
Method Summary
 void operate(Selector selector, Population oldPopulation, Population newPopulation, int howMany)
          method that adds genotypes to the new population by extracting some from the old one and manipulating them in some way.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Stretcher

public Stretcher()
Creates new Stretcher. Default values are used for stretchAmount = 1 and for copyFrom = -1 (this means no data is copied, all zeros are added).

Stretcher

public Stretcher(int stretchAmountP,
                 int copyFromP)
Creates new Stretcher.
Parameters:
stretchAmountP - Fixed amount to add at end of genotype.
copyFromP - Where to get data from to fill in new section.
Method Detail

operate

public void operate(Selector selector,
                    Population oldPopulation,
                    Population newPopulation,
                    int howMany)
method that adds genotypes to the new population by extracting some from the old one and manipulating them in some way.
Specified by:
operate in interface GeneticOperator
Parameters:
oldPopulation - in parameter having all the original genotypes
newPopulation - in/out parameter where the next generation of genotypes is being built
howMany - how many new genotypes to add to the new population

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object