es.udc.gii.common.eaf.algorithm.population
Class NSGA2Individual

java.lang.Object
  extended by es.udc.gii.common.eaf.algorithm.population.Individual
      extended by es.udc.gii.common.eaf.algorithm.population.NSGA2Individual
All Implemented Interfaces:
Configurable, java.io.Externalizable, java.io.Serializable, java.lang.Cloneable

public class NSGA2Individual
extends Individual

This class represents an individual for the NSGA2 algorithm.

Since:
1.0
Author:
Grupo Integrado de IngenierĂ­a (www.gii.udc.es)
See Also:
Serialized Form

Field Summary
private  double crowdingDistance
          Crowding distance value.
private  java.util.List<NSGA2Individual> dominatedIndividuals
          List of individuals dominated by this instance.
private  int dominationCount
          Number of individuals that dominate this instance.
private  int rank
          Rank of this instance, i.e. the number of the Pareto-front to which this instance belongs.
 
Constructor Summary
NSGA2Individual()
           
NSGA2Individual(org.apache.commons.math.util.DoubleArray[] chromosomes)
           
 
Method Summary
 void addDominatedIndividual(NSGA2Individual ind)
          Adds an individual to the list of dominated individuals by this instance.
 void clearDominatedIndividuals()
          Removes all individuals from the dominated individuals' list.
 java.lang.Object clone()
          Clones this instance.
 void decreaseDominationCount()
          Decreases the count of individuals that dominate this instance by one.
 void decreaseDominationCountOfDominatedIndividuals()
          Decreases the domination count of each individual dominated by this instance by one.
 void emptyDominatedIndividualsList()
          Clears the list of dominated individuals by this individual.
 double getCrowdingDistance()
           
 java.util.List<NSGA2Individual> getDominatedIndividuals()
          Returns the list of dominated individuals by this instance.
 int getDominationCount()
           
 int getRank()
           
 void increaseCrowdingDistance(double increase)
          Increases the crowding distance by an specified amount.
 void increaseDominationCount()
          Increases the count of individuals that dominate this instance by one.
private  void initialize()
          Initialized this instance.
 void setCrowdingDistance(double crowdingDistance)
          Sets the crowding distance.
 void setDominatedIndividuals(java.util.List<NSGA2Individual> dominatedIndividuals)
          Sets the list of individuals dominated by this instance.
 void setDominationCount(int dominationCount)
          Sets the number of individuals that dominated this instance.
 void setRank(int rank)
          Sets the rank of this individual.
 java.lang.String toString()
          Resturns a String representation of the Individual.
 
Methods inherited from class es.udc.gii.common.eaf.algorithm.population.Individual
configure, copyEvalResults, copyGenotype, equals, generate, getChromosomeAt, getChromosomes, getComparator, getConstraints, getDimension, getFitness, getObjectives, getViolatedConstraints, hashCode, isSerializeEvalResults, isSerializeGenotype, readExternal, setChromosomeAt, setChromosomes, setComparator, setConstraints, setDimension, setFitness, setObjectives, setSerializeEvalResults, setSerializeGenotype, setViolatedConstraints, writeExternal
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

dominatedIndividuals

private java.util.List<NSGA2Individual> dominatedIndividuals
List of individuals dominated by this instance.


dominationCount

private int dominationCount
Number of individuals that dominate this instance.


rank

private int rank
Rank of this instance, i.e. the number of the Pareto-front to which this instance belongs. Lesser values are better.


crowdingDistance

private double crowdingDistance
Crowding distance value. Greater values are better.

Constructor Detail

NSGA2Individual

public NSGA2Individual()

NSGA2Individual

public NSGA2Individual(org.apache.commons.math.util.DoubleArray[] chromosomes)
Method Detail

initialize

private void initialize()
Initialized this instance.


getDominatedIndividuals

public java.util.List<NSGA2Individual> getDominatedIndividuals()
Returns the list of dominated individuals by this instance.


addDominatedIndividual

public void addDominatedIndividual(NSGA2Individual ind)
Adds an individual to the list of dominated individuals by this instance.

Parameters:
ind - - Individual dominated by this instance.

setDominatedIndividuals

public void setDominatedIndividuals(java.util.List<NSGA2Individual> dominatedIndividuals)
Sets the list of individuals dominated by this instance.

Parameters:
dominatedIndividuals - - A list containing individuals dominated by this instance.

clearDominatedIndividuals

public void clearDominatedIndividuals()
Removes all individuals from the dominated individuals' list.


getRank

public int getRank()
Returns:
The rank of this instance. I.e. it returns the number of the Pareto-front to which this instance belongs. Lesser values are better.

setRank

public void setRank(int rank)
Sets the rank of this individual.

Parameters:
rank - - The rank of the individual, i.e. the number of the Pareto-front to which this instance belongs.

getDominationCount

public int getDominationCount()
Returns:
The number of individuals of the current population that dominate this individual.

setDominationCount

public void setDominationCount(int dominationCount)
Sets the number of individuals that dominated this instance.

Parameters:
dominationCount - - Number of individuals that dominated this instance.

decreaseDominationCount

public void decreaseDominationCount()
Decreases the count of individuals that dominate this instance by one. It is ensured that the domination count is always greather or equal cero.


increaseDominationCount

public void increaseDominationCount()
Increases the count of individuals that dominate this instance by one.


decreaseDominationCountOfDominatedIndividuals

public void decreaseDominationCountOfDominatedIndividuals()
Decreases the domination count of each individual dominated by this instance by one.


increaseCrowdingDistance

public void increaseCrowdingDistance(double increase)
Increases the crowding distance by an specified amount.

Parameters:
increase - - Amount to increase the crowding distance.

setCrowdingDistance

public void setCrowdingDistance(double crowdingDistance)
Sets the crowding distance.

Parameters:
crowdingDistance - - The crowding distance.

getCrowdingDistance

public double getCrowdingDistance()
Returns:
The current crowding distance of this instance.

emptyDominatedIndividualsList

public void emptyDominatedIndividualsList()
Clears the list of dominated individuals by this individual.


clone

public java.lang.Object clone()
Clones this instance.

Overrides:
clone in class Individual
Returns:
A new instance of this class containing the same state as this instance.

toString

public java.lang.String toString()
Description copied from class: Individual
Resturns a String representation of the Individual.

Overrides:
toString in class Individual
Returns:
a string representation of the Individual.