Enum Class ConstraintSeverityLevel
- All Implemented Interfaces:
Serializable, Comparable<ConstraintSeverityLevel>, Constable
Unified severity level for all constraint types in the optimization framework.
This enum provides a common 4-level severity classification that maps between:
CapacityConstraint.ConstraintSeverity— equipment-level (CRITICAL/HARD/SOFT/ADVISORY)ProductionOptimizer.ConstraintSeverity— optimizer-level (HARD/SOFT)ProcessSimulationEvaluator.ConstraintDefinition.isHard()— boolean flag
Optimizer behavior by level:
| Level | Optimizer Impact | Example |
|---|---|---|
| CRITICAL | Solution rejected; optimizer may abort | Compressor surge, overspeed trip |
| HARD | Solution marked infeasible | Design capacity, max power |
| SOFT | Penalty applied to objective | Recommended operating range |
| ADVISORY | No optimization impact; reporting only | Turndown ratio, design deviation |
- Version:
- 1.0
- Author:
- NeqSim Development Team
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ConstraintSeverityLevelConverts fromCapacityConstraint.ConstraintSeverityto unified severity.static ConstraintSeverityLevelfromIsHard(boolean isHard) Converts from the booleanisHardflag used inProcessSimulationEvaluator.ConstraintDefinitionto unified severity.static ConstraintSeverityLevelConverts fromProductionOptimizer.ConstraintSeverityto unified severity.Converts this unified severity to the 4-levelCapacityConstraint.ConstraintSeverity.booleantoIsHard()Converts this unified severity to a boolean hard/soft flag.Converts this unified severity to the 2-levelProductionOptimizer.ConstraintSeverity.static ConstraintSeverityLevelReturns the enum constant of this class with the specified name.static ConstraintSeverityLevel[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CRITICAL
Critical violation — equipment damage or safety hazard. Optimizer must stop or reject solution immediately. -
HARD
Hard violation — solution is infeasible if violated. Optimizer marks solution as infeasible. -
SOFT
Soft violation — undesirable but acceptable. Optimizer applies penalty to objective function. -
ADVISORY
Advisory — informational only with no optimization impact. Used for reporting and monitoring.
-
-
Constructor Details
-
ConstraintSeverityLevel
private ConstraintSeverityLevel()
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
fromCapacitySeverity
public static ConstraintSeverityLevel fromCapacitySeverity(CapacityConstraint.ConstraintSeverity severity) Converts fromCapacityConstraint.ConstraintSeverityto unified severity.- Parameters:
severity- the equipment-level severity- Returns:
- the equivalent unified severity level
-
fromOptimizerSeverity
public static ConstraintSeverityLevel fromOptimizerSeverity(ProductionOptimizer.ConstraintSeverity severity) Converts fromProductionOptimizer.ConstraintSeverityto unified severity.- Parameters:
severity- the optimizer-level severity (HARD or SOFT)- Returns:
- the equivalent unified severity level
-
fromIsHard
Converts from the booleanisHardflag used inProcessSimulationEvaluator.ConstraintDefinitionto unified severity.- Parameters:
isHard- true for hard constraints, false for soft- Returns:
- HARD if isHard is true, SOFT otherwise
-
toOptimizerSeverity
Converts this unified severity to the 2-levelProductionOptimizer.ConstraintSeverity.CRITICAL maps to HARD (since the 2-level enum has no critical level). ADVISORY maps to SOFT.
- Returns:
- the equivalent optimizer severity
-
toCapacitySeverity
Converts this unified severity to the 4-levelCapacityConstraint.ConstraintSeverity.- Returns:
- the equivalent equipment-level severity
-
toIsHard
public boolean toIsHard()Converts this unified severity to a boolean hard/soft flag.- Returns:
- true for CRITICAL and HARD; false for SOFT and ADVISORY
-