ec.multiobjective.nsga2
Class NSGA2Evaluator

java.lang.Object
  extended by ec.Evaluator
      extended by ec.simple.SimpleEvaluator
          extended by ec.multiobjective.nsga2.NSGA2Evaluator
All Implemented Interfaces:
Setup, Singleton, java.io.Serializable

public class NSGA2Evaluator
extends SimpleEvaluator

The NSGA2Evaluator is a simple generational evaluator which evaluates every single member of the population (in a multithreaded fashion). Then it reduces the population size to an archive consisting of the best front ranks. When there isn't enough space to fit another front rank, individuals in that final front rank vie for the remaining slots in the archive based on their sparsity.

The evaluator is also responsible for calculating the rank and sparsity values stored in the NSGA2MultiObjectiveFitness class and used largely for statistical information.

NSGA-II has fixed archive size (the population size), and so ignores the 'elites' declaration. However it will adhere to the 'reevaluate-elites' parameter in SimpleBreeder to determine whether to force fitness reevaluation.

See Also:
Serialized Form

Field Summary
 int[] originalPopSize
          The original population size is stored here so NSGA2 knows how large to create the archive (it's the size of the original population -- keep in mind that NSGA2Breeder had made the population larger to include the children.
 
Fields inherited from class ec.Evaluator
P_IAMSLAVE, P_MASTERPROBLEM, p_problem, P_PROBLEM
 
Constructor Summary
NSGA2Evaluator()
           
 
Method Summary
 java.util.ArrayList assignFrontRanks(Subpopulation subpop)
          Divides inds into ranks and assigns each individual's rank to be the rank it was placed into.
 void assignSparsity(Individual[] front)
          Computes and assigns the sparsity values of a given front.
 Individual[] buildArchive(EvolutionState state, int subpop)
          Build the auxiliary fitness data and reduce the subpopulation to just the archive, which is returned.
 void evaluatePopulation(EvolutionState state)
          Evaluates the population, then builds the archive and reduces the population to just the archive.
 void setup(EvolutionState state, Parameter base)
          Sets up the object by reading it from the parameters stored in state, built off of the parameter base base.
 
Methods inherited from class ec.simple.SimpleEvaluator
evalPopChunk, runComplete
 
Methods inherited from class ec.Evaluator
closeContacts, initializeContacts, reinitializeContacts
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

originalPopSize

public int[] originalPopSize
The original population size is stored here so NSGA2 knows how large to create the archive (it's the size of the original population -- keep in mind that NSGA2Breeder had made the population larger to include the children.

Constructor Detail

NSGA2Evaluator

public NSGA2Evaluator()
Method Detail

setup

public void setup(EvolutionState state,
                  Parameter base)
Description copied from interface: Setup
Sets up the object by reading it from the parameters stored in state, built off of the parameter base base. If an ancestor implements this method, be sure to call super.setup(state,base); before you do anything else.

Specified by:
setup in interface Setup
Overrides:
setup in class SimpleEvaluator

evaluatePopulation

public void evaluatePopulation(EvolutionState state)
Evaluates the population, then builds the archive and reduces the population to just the archive.

Overrides:
evaluatePopulation in class SimpleEvaluator

buildArchive

public Individual[] buildArchive(EvolutionState state,
                                 int subpop)
Build the auxiliary fitness data and reduce the subpopulation to just the archive, which is returned.


assignFrontRanks

public java.util.ArrayList assignFrontRanks(Subpopulation subpop)
Divides inds into ranks and assigns each individual's rank to be the rank it was placed into. Each front is an ArrayList.


assignSparsity

public void assignSparsity(Individual[] front)
Computes and assigns the sparsity values of a given front.