Package ec.multiobjective.nsga2
Class NSGA2MultiObjectiveFitness
java.lang.Object
ec.Fitness
ec.multiobjective.MultiObjectiveFitness
ec.multiobjective.nsga2.NSGA2MultiObjectiveFitness
- All Implemented Interfaces:
Prototype,Setup,Serializable,Cloneable,Comparable<Object>
NSGA2MultiObjectiveFitness is a subclass of MultiObjeciveFitness which
adds auxiliary fitness measures (sparsity, rank) largely used by MultiObjectiveStatistics.
It also redefines the comparison measures to compare based on rank, and break ties
based on sparsity.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringintPareto front rank measure (lower ranks are better)doubleSparsity along front rank measure (higher sparsity is better)Fields inherited from class ec.multiobjective.MultiObjectiveFitness
FITNESS_POSTAMBLE, maximize, maxObjective, minObjective, MULTI_FITNESS_POSTAMBLE, objectives, P_MAXIMIZE, P_MAXOBJECTIVE, P_MINOBJECTIVE, P_NUMOBJECTIVESFields inherited from class ec.Fitness
context, FITNESS_PREAMBLE, P_FITNESS, trials -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbetterThan(Fitness _fitness) We specify the tournament selection criteria, Rank (lower values are better) and Sparsity (higher values are better)booleanequivalentTo(Fitness _fitness) Returns true if I'm equivalent in fitness (neither better nor worse) to _fitness.Print to a string the fitness in a fashion intended to be parsed in again via readFitness(...).Print to a string the fitness in a fashion readable by humans, and not intended to be parsed in again.String[]Returns auxilliary fitness value names to be printed by the statistics object.double[]Returns auxilliary fitness values to be printed by the statistics object.voidreadFitness(EvolutionState state, DataInput dataInput) Reads the binary form of an individual from a DataInput.voidreadFitness(EvolutionState state, LineNumberReader reader) Reads in the fitness from a form outputted by fitnessToString() and thus printFitnessForHumans(...).voidwriteFitness(EvolutionState state, DataOutput dataOutput) Writes the binary form of an individual out to a DataOutput.Methods inherited from class ec.multiobjective.MultiObjectiveFitness
clone, defaultBase, fitness, getNumObjectives, getObjective, getObjectives, getRankings, getSortedParetoFront, isIdealFitness, isMaximizing, isMaximizing, manhattanObjectiveDistance, paretoDominates, partitionIntoParetoFront, partitionIntoRanks, setObjectives, setToBestOf, setToMeanOf, setToMedianOf, setup, sumSquaredObjectiveDistanceMethods inherited from class ec.Fitness
compareTo, contextIsBetterThan, getContext, merge, printFitness, printFitness, printFitness, printFitnessForHumans, printFitnessForHumans, readTrials, setContext, setContext, writeTrials
-
Field Details
-
NSGA2_RANK_PREAMBLE
- See Also:
-
NSGA2_SPARSITY_PREAMBLE
- See Also:
-
rank
public int rankPareto front rank measure (lower ranks are better) -
sparsity
public double sparsitySparsity along front rank measure (higher sparsity is better)
-
-
Constructor Details
-
NSGA2MultiObjectiveFitness
public NSGA2MultiObjectiveFitness()
-
-
Method Details
-
getAuxilliaryFitnessNames
Description copied from class:MultiObjectiveFitnessReturns auxilliary fitness value names to be printed by the statistics object. By default, an empty array is returned, but various algorithms may override this to provide additional columns.- Overrides:
getAuxilliaryFitnessNamesin classMultiObjectiveFitness
-
getAuxilliaryFitnessValues
public double[] getAuxilliaryFitnessValues()Description copied from class:MultiObjectiveFitnessReturns auxilliary fitness values to be printed by the statistics object. By default, an empty array is returned, but various algorithms may override this to provide additional columns.- Overrides:
getAuxilliaryFitnessValuesin classMultiObjectiveFitness
-
fitnessToString
Description copied from class:FitnessPrint to a string the fitness in a fashion intended to be parsed in again via readFitness(...). The fitness and evaluated flag should not be included. The default form simply calls toString(), which is almost certainly wrong, and you'll probably want to override this to something else. When overriding, you may wish to check to see if the 'trials' variable is non-null, and issue an error if so.- Overrides:
fitnessToStringin classMultiObjectiveFitness
-
fitnessToStringForHumans
Description copied from class:FitnessPrint to a string the fitness in a fashion readable by humans, and not intended to be parsed in again. The default form simply calls toString(), but you'll probably want to override this to something else.- Overrides:
fitnessToStringForHumansin classMultiObjectiveFitness
-
readFitness
Description copied from class:FitnessReads in the fitness from a form outputted by fitnessToString() and thus printFitnessForHumans(...). The default version of this method exits the program with an "unimplemented" error.- Overrides:
readFitnessin classMultiObjectiveFitness- Throws:
IOException
-
writeFitness
Description copied from class:FitnessWrites the binary form of an individual out to a DataOutput. This is not for serialization: the object should only write out the data relevant to the object sufficient to rebuild it from a DataInput. The default version exits the program with an "unimplemented" error; you should override this, and be certain to also write the 'trials' variable as well.- Overrides:
writeFitnessin classMultiObjectiveFitness- Throws:
IOException
-
readFitness
Description copied from class:FitnessReads the binary form of an individual from a DataInput. This is not for serialization: the object should only read in the data written out via printIndividual(state,dataInput). The default version exits the program with an "unimplemented" error; you should override this, and be certain to also write the 'trials' variable as well.- Overrides:
readFitnessin classMultiObjectiveFitness- Throws:
IOException
-
equivalentTo
Description copied from class:MultiObjectiveFitnessReturns true if I'm equivalent in fitness (neither better nor worse) to _fitness. The rule I'm using is this: If one of us is better in one or more criteria, and we are equal in the others, then equivalentTo is false. If each of us is better in one or more criteria each, or we are equal in all criteria, then equivalentTo is true. Multiobjective optimization algorithms may choose to override this to do something else.- Overrides:
equivalentToin classMultiObjectiveFitness
-
betterThan
We specify the tournament selection criteria, Rank (lower values are better) and Sparsity (higher values are better)- Overrides:
betterThanin classMultiObjectiveFitness
-