|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectes.udc.gii.common.eaf.algorithm.operator.replace.mmga.Hypercube
public class Hypercube
This class represents a hypercube with individuals inside. Each individual is stored in a single cell.
Nested Class Summary | |
---|---|
class |
Hypercube.Cell
This class represents a cell of a hypercube. |
Field Summary | |
---|---|
private java.util.Map<java.lang.Long,Hypercube.Cell> |
crowdedCells
Maps cell numbers to cells. |
private boolean |
dirty
If the hypercube is modified without updating it, dirty is set to true. |
private double[] |
divisionSize
Size of a division in each dimension. |
private java.util.Map<Individual,Hypercube.Cell> |
individualCellMapping
Maps an individual to the cell where it belongs. |
private java.util.List<Individual> |
individuals
Contains all the individuals in the hypercube. |
private int |
numberOfDimensions
Number of dimensions of the hypercube. |
private int |
numberOfDivisionsPerDimension
Number of divisions into which we divide each dimension. |
private double[] |
origin
Represents the origin of the hypercube. |
Constructor Summary | |
---|---|
Hypercube(java.util.List<Individual> individuals,
int numberOfDimensions,
int numberOfDivisionsPerDimension)
Class constructor. |
Method Summary | |
---|---|
void |
addAllIndividuals(java.util.List<Individual> toAdd)
Adds individuals to the hypercube. |
void |
addIndividual(Individual individual)
Adds a new individual to the hypercube. |
Hypercube.Cell |
findCell(Individual individual)
Finds the cell of an individual. |
private java.lang.Long |
getCellNumber(Individual individual)
Returns the cell number of the cell to wich a individual belongs. |
java.util.List<Hypercube.Cell> |
getCrowdedCells()
Returns the cells that have at least one individual. |
java.util.List<Individual> |
getIndividuals()
Returns all individuals from the hypercube. |
Hypercube.Cell |
getMostCrowdedCell()
Returns one cell among those which are most populated. |
private double |
getObjectiveValue(Individual individual,
int dimension)
Returns the objective value of an individual on a dimension. |
int |
getSize()
Returns the number of individuals in the hypercube. |
private void |
initializeHypercube()
Initializes the hypercube. |
boolean |
isDirty()
Returns true if the hypercube has been modified without updating it. |
void |
removeAllIndividuals(java.util.List<Individual> toRemove)
Removes individuals from hypercube. |
void |
removeIndividual(Individual individual)
Removes an individual from hypercube. |
void |
setIndividuals(java.util.List<Individual> newIndividuals)
Set a new list of individuals. |
void |
update()
Updates the hypercube. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int numberOfDimensions
private int numberOfDivisionsPerDimension
private double[] divisionSize
private double[] origin
private java.util.Map<java.lang.Long,Hypercube.Cell> crowdedCells
private java.util.Map<Individual,Hypercube.Cell> individualCellMapping
private java.util.List<Individual> individuals
private boolean dirty
Constructor Detail |
---|
public Hypercube(java.util.List<Individual> individuals, int numberOfDimensions, int numberOfDivisionsPerDimension)
individuals
- List of individuals that will be inside the
hypercube.numberOfDimensions
- The number of objectives of the problem.numberOfDivisionsPerDimension
- Number of parts in wich each
dimension will be divided for constructing cell. Each division on
a dimension represents the coordinate of a cell on that dimension.Method Detail |
---|
private double getObjectiveValue(Individual individual, int dimension)
private void initializeHypercube()
public java.util.List<Hypercube.Cell> getCrowdedCells()
public Hypercube.Cell getMostCrowdedCell()
private java.lang.Long getCellNumber(Individual individual)
public Hypercube.Cell findCell(Individual individual)
null
if the individual is out of the current hypercube's bounds.public void update()
public void setIndividuals(java.util.List<Individual> newIndividuals)
public void addIndividual(Individual individual)
public void addAllIndividuals(java.util.List<Individual> toAdd)
public void removeIndividual(Individual individual)
public void removeAllIndividuals(java.util.List<Individual> toRemove)
public int getSize()
public boolean isDirty()
true
if the hypercube has been modified without updating it.
public java.util.List<Individual> getIndividuals()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |