jmetal.util.archive
Class R2Archive
java.lang.Object
jmetal.core.SolutionSet
jmetal.util.archive.Archive
jmetal.util.archive.R2Archive
- All Implemented Interfaces:
- java.io.Serializable
public class R2Archive
- extends Archive
This class implements a bounded archive based on crowding distances (as
defined in NSGA-II).
- See Also:
- Serialized Form
Constructor Summary |
R2Archive(int maxSize)
Constructor. |
R2Archive(int maxSize,
int numberOfObjectives,
java.lang.String file)
Constructor. |
Method Summary |
boolean |
add(Solution solution)
Adds a Solution to the archive. |
Solution |
getSolution()
Returns a solution from the archive based on their contribution to the R2
indicator. |
Methods inherited from class jmetal.core.SolutionSet |
add, best, clear, get, getCapacity, getMaxSize, indexWorst, iterator, printFeasibleFUN, printFeasibleVAR, printObjectives, printObjectivesToFile, printVariablesToFile, remove, replace, setCapacity, size, sort, union, worst, writeObjectivesToMatrix |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
R2Archive
public R2Archive(int maxSize)
- Constructor. Creates an R2Archive for a problem of 2 objectives
- Parameters:
maxSize
- The maximum size of the archive.
R2Archive
public R2Archive(int maxSize,
int numberOfObjectives,
java.lang.String file)
- Constructor.
- Parameters:
maxSize
- The maximum size of the archive.numberOfObjectives
- The number of objectives.
add
public boolean add(Solution solution)
- Adds a
Solution
to the archive. If the Solution
is dominated by any member of the archive, then it is discarded. If the
Solution
dominates some members of the archive, these are
removed. If the archive is full and the Solution
has to be
inserted, the solutions are sorted by crowding distance and the one having
the minimum crowding distance value.
- Overrides:
add
in class SolutionSet
- Parameters:
solution
- The Solution
- Returns:
- true if the
Solution
has been inserted, false
otherwise.
getSolution
public Solution getSolution()
- Returns a solution from the archive based on their contribution to the R2
indicator. The solution is chosen using a binary tournament.