Class ParetoFront

java.lang.Object
neqsim.process.util.optimizer.ParetoFront
All Implemented Interfaces:
Serializable, Iterable<ParetoSolution>

public class ParetoFront extends Object implements 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 Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • logger

      private static final org.apache.logging.log4j.Logger logger
      Logger for this class.
    • solutions

      private final List<ParetoSolution> solutions
      The non-dominated solutions.
    • feasibleOnly

      private final boolean feasibleOnly
      Whether 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

      public boolean add(ParetoSolution candidate)
      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

      public List<ParetoSolution> getSolutions()
      Get all solutions on the front.
      Returns:
      unmodifiable list of solutions (snapshot at time of call)
    • getSolutionsSortedBy

      public List<ParetoSolution> getSolutionsSortedBy(int objectiveIndex, boolean ascending)
      Get solutions sorted by a specific objective.
      Parameters:
      objectiveIndex - index of objective to sort by
      ascending - 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

      public ParetoSolution 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

      private ParetoSolution findKneePointHighDimensional()
      Find knee point for high-dimensional objectives using normalized Euclidean distance.
      Returns:
      knee point solution
    • findMinimum

      public ParetoSolution findMinimum(int objectiveIndex)
      Find the solution that minimizes a specific objective.
      Parameters:
      objectiveIndex - index of objective
      Returns:
      solution with minimum value for that objective
    • findMaximum

      public ParetoSolution findMaximum(int objectiveIndex)
      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

      public String toJson()
      Export front to JSON format.
      Returns:
      JSON string representation
    • iterator

      public Iterator<ParetoSolution> iterator()
      Specified by:
      iterator in interface Iterable<ParetoSolution>
    • toString

      public String toString()
      Overrides:
      toString in class Object