ec.multiobjective.spea2
Class SPEA2MultiObjectiveFitness

java.lang.Object
  extended byec.multiobjective.MultiObjectiveFitness
      extended byec.multiobjective.spea2.SPEA2MultiObjectiveFitness
All Implemented Interfaces:
java.lang.Cloneable, Fitness, Prototype, java.io.Serializable, Setup

public class SPEA2MultiObjectiveFitness
extends MultiObjectiveFitness

SPEA2MultiObjectiveFitness is a subclass of Fitness which implements basic multiobjective fitness functions along with support for the ECJ SPEA2 (Strength Pareto Evolutionary Algorithm) extensions.

The object contains two items: an array of floating point values representing the various multiple fitnesses (ranging from 0.0 (worst) to infinity (best)), and a single SPEA2 fitness value which represents the individual's overall fitness ( a function of the number of individuals it dominates and it's raw score where 0.0 is the best).

Parameters

base.numobjectives
(else)multi.numobjectives
int >= 1
(the number of fitnesses in the multifitness array)

See Also:
Serialized Form

Field Summary
static java.lang.String SPEA2FIT_PREAMBLE
           
 double SPEA2Fitness
          SPEA2 overall fitness
 double SPEA2kthNNDistance
          SPEA2 NN distance
 double SPEA2RawFitness
          SPEA2 RAW fitness
 double SPEA2Strength
          SPEA2 strength (# of nodes it dominates)
 
Fields inherited from class ec.multiobjective.MultiObjectiveFitness
FITNESS_POSTAMBLE, FITNESS_PREAMBLE, multifitness, P_FITNESS, P_NUMFITNESSES
 
Constructor Summary
SPEA2MultiObjectiveFitness()
           
 
Method Summary
 float calcDistance(SPEA2MultiObjectiveFitness otherFit)
          Returns the sum of the squared differences between the vector fitness values.
 void printFitness(EvolutionState state, int log, int verbosity)
          Prints the fitness in the computer-readable form:
 void printFitness(EvolutionState state, java.io.PrintWriter writer)
          Prints the fitness in the computer-readable form:
 void printFitnessForHumans(EvolutionState state, int log, int verbosity)
          Prints the fitness in the human-readable form:
 void readFitness(EvolutionState state, java.io.LineNumberReader reader)
          Reads in the fitness from a form printed by printFitness().
 
Methods inherited from class ec.multiobjective.MultiObjectiveFitness
betterThan, defaultBase, equivalentTo, fitness, isIdealFitness, protoClone, protoCloneSimple, setup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPEA2FIT_PREAMBLE

public static final java.lang.String SPEA2FIT_PREAMBLE
See Also:
Constant Field Values

SPEA2Fitness

public double SPEA2Fitness
SPEA2 overall fitness


SPEA2Strength

public double SPEA2Strength
SPEA2 strength (# of nodes it dominates)


SPEA2RawFitness

public double SPEA2RawFitness
SPEA2 RAW fitness


SPEA2kthNNDistance

public double SPEA2kthNNDistance
SPEA2 NN distance

Constructor Detail

SPEA2MultiObjectiveFitness

public SPEA2MultiObjectiveFitness()
Method Detail

calcDistance

public float calcDistance(SPEA2MultiObjectiveFitness otherFit)
Returns the sum of the squared differences between the vector fitness values.


printFitness

public void printFitness(EvolutionState state,
                         int log,
                         int verbosity)
Prints the fitness in the computer-readable form:

Fitness: [fitness values encoded with ec.util.Code, separated by spaces]

Specified by:
printFitness in interface Fitness
Overrides:
printFitness in class MultiObjectiveFitness

printFitness

public void printFitness(EvolutionState state,
                         java.io.PrintWriter writer)
Prints the fitness in the computer-readable form:

Fitness: [fitness values encoded with ec.util.Code, separated by spaces]

Specified by:
printFitness in interface Fitness
Overrides:
printFitness in class MultiObjectiveFitness

printFitnessForHumans

public void printFitnessForHumans(EvolutionState state,
                                  int log,
                                  int verbosity)
Prints the fitness in the human-readable form:

Fitness: [fitness values separated by spaces]

Specified by:
printFitnessForHumans in interface Fitness
Overrides:
printFitnessForHumans in class MultiObjectiveFitness

readFitness

public void readFitness(EvolutionState state,
                        java.io.LineNumberReader reader)
                 throws java.io.IOException,
                        java.lang.CloneNotSupportedException
Description copied from interface: Fitness
Reads in the fitness from a form printed by printFitness().

Specified by:
readFitness in interface Fitness
Overrides:
readFitness in class MultiObjectiveFitness
Throws:
java.io.IOException
java.lang.CloneNotSupportedException