Class ParetoSolution
java.lang.Object
neqsim.process.util.optimizer.ParetoSolution
- All Implemented Interfaces:
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for creating ParetoSolution instances. -
Field Summary
FieldsModifier and TypeFieldDescriptionDecision variables that produced this solution.private final booleanWhether this solution is feasible (satisfies all hard constraints).Additional metadata.private final String[]Objective names corresponding to values.private final String[]Objective units for display.private final double[]Objective values (normalized: higher is always better).private final double[]Raw (non-normalized) objective values.private static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMetadata(String key, Object value) Add metadata to this solution.intcompareTo(ParetoSolution other) doublecrowdingDistance(ParetoSolution leftNeighbor, ParetoSolution rightNeighbor, int objectiveIndex, double objectiveRange) Calculate crowding distance contribution from neighbors.doubledistanceTo(ParetoSolution other) Calculate Euclidean distance to another solution in objective space.booleandominates(ParetoSolution other) Check if this solution dominates another solution.booleanGet decision variables.getMetadata(String key) Get metadata value.intGet the number of objectives.getObjectiveName(int index) Get objective name at index.getObjectiveUnit(int index) Get objective unit at index.double[]Get all normalized objective values.double[]Get all raw objective values.doublegetRawValue(int index) Get raw (original) objective value at index.doublegetValue(int index) Get normalized objective value at index (higher is better).inthashCode()booleanCheck if this solution is feasible.toString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
objectiveValues
private final double[] objectiveValuesObjective values (normalized: higher is always better). -
objectiveNames
Objective names corresponding to values. -
objectiveUnits
Objective units for display. -
rawObjectiveValues
private final double[] rawObjectiveValuesRaw (non-normalized) objective values. -
decisionVariables
-
feasible
private final boolean feasibleWhether this solution is feasible (satisfies all hard constraints). -
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 normalizationobjectiveNames- names of objectivesobjectiveUnits- units for each objectivedecisionVariables- decision variable valuesfeasible- 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
Get objective name at index.- Parameters:
index- objective index- Returns:
- objective name
-
getObjectiveUnit
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
-
isFeasible
public boolean isFeasible()Check if this solution is feasible.- Returns:
- true if feasible
-
addMetadata
-
getMetadata
-
dominates
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
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 forobjectiveRange- total range of objective values- Returns:
- crowding distance contribution
-
compareTo
- Specified by:
compareToin interfaceComparable<ParetoSolution>
-
equals
-
hashCode
-
toString
-