Class ParetoFront
java.lang.Object
neqsim.process.util.optimizer.ParetoFront
- All Implemented Interfaces:
Serializable, Iterable<ParetoSolution>
Collection of Pareto-optimal solutions forming the Pareto front.
The Pareto front contains all non-dominated solutions found during multi-objective optimization. It automatically maintains the non-dominated property when solutions are added.
- Version:
- 1.0
- Author:
- ASMF
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanWhether to only keep feasible solutions.private static final org.apache.logging.log4j.LoggerLogger for this class.private static final longprivate final List<ParetoSolution> The non-dominated solutions. -
Constructor Summary
ConstructorsConstructorDescriptionCreate an empty Pareto front.ParetoFront(boolean feasibleOnly) Create an empty Pareto front. -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(ParetoSolution candidate) Add a candidate solution to the front.doublecalculateHypervolume2D(double[] referencePoint) Calculate hypervolume indicator (2D case).doubleGet spacing metric (uniformity of distribution).voidclear()Clear all solutions from the front.Find the "knee" point on the Pareto front.private ParetoSolutionFind knee point for high-dimensional objectives using normalized Euclidean distance.findMaximum(int objectiveIndex) Find the solution that maximizes a specific objective.findMinimum(int objectiveIndex) Find the solution that minimizes a specific objective.Get all solutions on the front.getSolutionsSortedBy(int objectiveIndex, boolean ascending) Get solutions sorted by a specific objective.booleanisEmpty()Check if the front is empty.iterator()intsize()Get the number of solutions on the front.toJson()Export front to JSON format.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
logger
private static final org.apache.logging.log4j.Logger loggerLogger for this class. -
solutions
The non-dominated solutions. -
feasibleOnly
private final boolean feasibleOnlyWhether to only keep feasible solutions.
-
-
Constructor Details
-
ParetoFront
public ParetoFront()Create an empty Pareto front. -
ParetoFront
public ParetoFront(boolean feasibleOnly) Create an empty Pareto front.- Parameters:
feasibleOnly- if true, only feasible solutions are kept
-
-
Method Details
-
add
Add a candidate solution to the front.If the candidate dominates any existing solutions, those are removed. If the candidate is dominated by any existing solution, it is not added. This method is thread-safe.
- Parameters:
candidate- the solution to add- Returns:
- true if the candidate was added to the front
-
getSolutions
Get all solutions on the front.- Returns:
- unmodifiable list of solutions (snapshot at time of call)
-
getSolutionsSortedBy
Get solutions sorted by a specific objective.- Parameters:
objectiveIndex- index of objective to sort byascending- if true, sort ascending; otherwise descending- Returns:
- sorted list of solutions
-
size
public int size()Get the number of solutions on the front.- Returns:
- number of solutions
-
isEmpty
public boolean isEmpty()Check if the front is empty.- Returns:
- true if empty
-
clear
public void clear()Clear all solutions from the front. -
findKneePoint
Find the "knee" point on the Pareto front.The knee point is the solution with maximum distance from the line connecting the extreme points. This often represents a good trade-off between objectives.
- Returns:
- the knee point solution, or null if front is empty
-
findKneePointHighDimensional
Find knee point for high-dimensional objectives using normalized Euclidean distance.- Returns:
- knee point solution
-
findMinimum
Find the solution that minimizes a specific objective.- Parameters:
objectiveIndex- index of objective- Returns:
- solution with minimum value for that objective
-
findMaximum
Find the solution that maximizes a specific objective.- Parameters:
objectiveIndex- index of objective- Returns:
- solution with maximum value for that objective
-
calculateHypervolume2D
public double calculateHypervolume2D(double[] referencePoint) Calculate hypervolume indicator (2D case).The hypervolume is the area/volume dominated by the front with respect to a reference point. Higher values indicate better convergence and diversity.
- Parameters:
referencePoint- reference point (nadir point)- Returns:
- hypervolume value
-
calculateSpacing
public double calculateSpacing()Get spacing metric (uniformity of distribution).- Returns:
- spacing metric (lower is more uniform)
-
toJson
-
iterator
- Specified by:
iteratorin interfaceIterable<ParetoSolution>
-
toString
-