|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectgeneticWedge.gp.Crossover
public final class Crossover
Crossover performs crossover ('sexual' recombination) between 2 Individuals, generating 1 or 2 offspring. It holds various parameters that control the way in which crossover is performed.
Constructor Summary | |
---|---|
Crossover()
The default constructor creates a Crossover with default parameters. |
|
Crossover(double functionProportion,
int noOfTries)
Create a Crossover object. |
Method Summary | |
---|---|
void |
collectTransmissionInfo(boolean collect)
If set to true, collectTransmissionInfo saves information concerning the relationship between parent and offspring during crossover operations |
Individual[] |
cross(Individual ind1,
Individual ind2,
boolean twoOffspring,
Input[] inputs,
Constant[] constants,
int maxLength,
int maxDepth)
This method returns an array of Individuals created by crossing 2 parents (ind1 and ind2). |
boolean |
getBroodUse()
Checks whether brood recombination is being used. |
int |
getDataSamplingFactor()
The dataSamplingFactor is a variable related to brood recombination. |
int |
getHalfBroodSize()
halfBroodSize is the number of pairs of offspring created during brood recombination. |
java.util.Vector<double[]> |
getTransmissionInfo()
Returns a vector containing information about the relationship between parent and offspring during crossover operations, provided collectTransmissionInfo has been set to true. |
void |
setBroodSize(int halfBroodSize)
halfBroodSize is the number of pairs of offspring created during brood recombination. |
void |
setBroodSize(int halfBroodSize,
int dataSamplingFactor)
halfBroodSize is the number of pairs of offspring created during brood recombination. |
void |
setBroodUse(boolean useBrood)
Sets whether brood recombination should be used. |
void |
setData(double[][] inputs,
double[] targets)
In order to use brood recombination the data, i.e. |
void |
setExpectedCrossoverDepth(double depth)
This sets the 'expected' depth at which crossover will take place. |
void |
setFitnessFunction(AbstractPopulation.FitnessFunction fitnessFunction)
This method is only important when using brood recombination. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Crossover()
public Crossover(double functionProportion, int noOfTries)
functionProportion
- The proportion of crossover points that will be chosen to be Functions. The remainder of crossover points will occur at Terminals. If set to NaN, crossover points will be seleted randomly.noOfTries
- The number of times that Crossover will try to create valid offspring.Method Detail |
---|
public void setExpectedCrossoverDepth(double depth)
public void collectTransmissionInfo(boolean collect)
public java.util.Vector<double[]> getTransmissionInfo()
public Individual[] cross(Individual ind1, Individual ind2, boolean twoOffspring, Input[] inputs, Constant[] constants, int maxLength, int maxDepth)
twoOffspring
- If true two offspring will be returned. If false only one offspring will be returned.maxDepth
- The maximum depth of the returned offspringmaxLength
- The maximum length of the returned offspringpublic void setBroodSize(int halfBroodSize)
public void setBroodSize(int halfBroodSize, int dataSamplingFactor)
public int getHalfBroodSize()
public int getDataSamplingFactor()
public void setData(double[][] inputs, double[] targets)
public void setBroodUse(boolean useBrood)
public boolean getBroodUse()
public void setFitnessFunction(AbstractPopulation.FitnessFunction fitnessFunction)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |