|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectgeneticWedge.gp.FitnessShare
public class FitnessShare
The use of a FitnessShare object encourages diversity within a population. It 'shares' the fitness of Individuals that are close together, either genotypically (similar tree structure) or phenotypically (similar fitness), making them less fit. This aims to prevents premature convergence to a small niche.
Nested Class Summary | |
---|---|
static class |
FitnessShare.FitnessShareFunction
FitnessShareFunction determines the shape of the fitness sharing within a niche. |
static class |
FitnessShare.ShareType
ShareType determines the function over which sharing is performed |
Constructor Summary | |
---|---|
FitnessShare(double nicheSize,
FitnessShare.FitnessShareFunction shareFunction)
Creates a FitnessShare with a niche size and a FitnessShareFunction. |
Method Summary | |
---|---|
double |
getNicheSize()
Returns the niche size (radius). |
double[] |
getShareValuesFromMultipleObjectives(double[][] data,
double[] weighting)
This method takes weightings for a multi-objective function as the second input. |
double[] |
getShareValuesFromSingleObjective(double[] data)
Returns the share values (degree of sharing) for the data provided. |
double |
getShareValuesFromSingleObjective(double[] data,
int index)
Returns the share value (degree of sharing) for the particular datum identified by index. |
double[] |
getShareValuesFromSquaredDistances(double[][] squaredDistances)
Returns the share values (degree of sharing) for the squared distances provided. |
double |
getShareValuesFromSquaredDistances(double[][] squaredDistances,
int index)
Returns the share value (degree of sharing) for the particular datum identified by index. |
void |
setNicheSize(double nicheSize)
Sets the niche size (radius). |
java.lang.String |
toString()
Returns a String representation of this FitnessShare object, identifying its niche size and share function (niche shape) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FitnessShare(double nicheSize, FitnessShare.FitnessShareFunction shareFunction)
shareFunction
- This determines the shape of the sharing function.Method Detail |
---|
public double[] getShareValuesFromSingleObjective(double[] data)
data
- data should be either fitnesses or average squared genotypic distances, depending whether the ShareType is OBJECTIVE_FUNCTION or GENE_DISTANCEpublic double getShareValuesFromSingleObjective(double[] data, int index)
data
- data should be either fitnesses or average squared genotypic distances, depending whether the ShareType is OBJECTIVE_FUNCTION or GENE_DISTANCEindex
- The index of the target datum within the array data.public void setNicheSize(double nicheSize)
public double getNicheSize()
public double[] getShareValuesFromMultipleObjectives(double[][] data, double[] weighting)
Weightings may be adjusted dynamically by calling this method. For example, a Population may adjust the weightings to the current ranges of the objectives.
public double[] getShareValuesFromSquaredDistances(double[][] squaredDistances)
squaredDistances
- The distances between all pairs of Individuals. Only the values above the diagonal
(2nd dimension greater than 1st dimension) are used.public double getShareValuesFromSquaredDistances(double[][] squaredDistances, int index)
squaredDistances
- The distances between all pairs of Individualsindex
- The index of the target datum within the array data.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |