Class ParetoSolution

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

public class ParetoSolution extends Object implements Serializable, Comparable<ParetoSolution>
Represents a single solution on the Pareto front.

A Pareto solution contains the objective values at a specific decision point (e.g., flow rate) and can be compared to other solutions for dominance.

Version:
1.0
Author:
ASMF
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • objectiveValues

      private final double[] objectiveValues
      Objective values (normalized: higher is always better).
    • objectiveNames

      private final String[] objectiveNames
      Objective names corresponding to values.
    • objectiveUnits

      private final String[] objectiveUnits
      Objective units for display.
    • rawObjectiveValues

      private final double[] rawObjectiveValues
      Raw (non-normalized) objective values.
    • decisionVariables

      private final Map<String,Double> decisionVariables
      Decision variables that produced this solution.
    • feasible

      private final boolean feasible
      Whether this solution is feasible (satisfies all hard constraints).
    • metadata

      private final Map<String,Object> metadata
      Additional metadata.
  • Constructor Details

    • ParetoSolution

      public ParetoSolution(double[] objectiveValues, double[] rawObjectiveValues, String[] objectiveNames, String[] objectiveUnits, Map<String,Double> decisionVariables, boolean feasible)
      Constructor for ParetoSolution.
      Parameters:
      objectiveValues - normalized objective values (higher is better)
      rawObjectiveValues - original objective values before normalization
      objectiveNames - names of objectives
      objectiveUnits - units for each objective
      decisionVariables - decision variable values
      feasible - whether solution is feasible
  • Method Details

    • getNumObjectives

      public int getNumObjectives()
      Get the number of objectives.
      Returns:
      number of objectives
    • getValue

      public double getValue(int index)
      Get normalized objective value at index (higher is better).
      Parameters:
      index - objective index
      Returns:
      normalized value
    • getRawValue

      public double getRawValue(int index)
      Get raw (original) objective value at index.
      Parameters:
      index - objective index
      Returns:
      raw value
    • getObjectiveName

      public String getObjectiveName(int index)
      Get objective name at index.
      Parameters:
      index - objective index
      Returns:
      objective name
    • getObjectiveUnit

      public String getObjectiveUnit(int index)
      Get objective unit at index.
      Parameters:
      index - objective index
      Returns:
      unit string
    • getObjectiveValues

      public double[] getObjectiveValues()
      Get all normalized objective values.
      Returns:
      copy of objective values array
    • getRawObjectiveValues

      public double[] getRawObjectiveValues()
      Get all raw objective values.
      Returns:
      copy of raw values array
    • getDecisionVariables

      public Map<String,Double> getDecisionVariables()
      Get decision variables.
      Returns:
      unmodifiable map of decision variables
    • isFeasible

      public boolean isFeasible()
      Check if this solution is feasible.
      Returns:
      true if feasible
    • addMetadata

      public void addMetadata(String key, Object value)
      Add metadata to this solution.
      Parameters:
      key - metadata key
      value - metadata value
    • getMetadata

      public Object getMetadata(String key)
      Get metadata value.
      Parameters:
      key - metadata key
      Returns:
      metadata value or null
    • dominates

      public boolean dominates(ParetoSolution other)
      Check if this solution dominates another solution.

      Solution A dominates B if A is at least as good as B on all objectives and strictly better on at least one.

      Parameters:
      other - the other solution to compare
      Returns:
      true if this dominates other
    • distanceTo

      public double distanceTo(ParetoSolution other)
      Calculate Euclidean distance to another solution in objective space.
      Parameters:
      other - the other solution
      Returns:
      Euclidean distance
    • crowdingDistance

      public double crowdingDistance(ParetoSolution leftNeighbor, ParetoSolution rightNeighbor, int objectiveIndex, double objectiveRange)
      Calculate crowding distance contribution from neighbors.
      Parameters:
      leftNeighbor - left neighbor in sorted order (can be null)
      rightNeighbor - right neighbor in sorted order (can be null)
      objectiveIndex - objective to calculate distance for
      objectiveRange - total range of objective values
      Returns:
      crowding distance contribution
    • compareTo

      public int compareTo(ParetoSolution other)
      Specified by:
      compareTo in interface Comparable<ParetoSolution>
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object