Class Constraint

java.lang.Object
jline.opt.objectives.Constraint
Direct Known Subclasses:
BudgetConstraint, ResponseTimeConstraint, SystemResponseTimeConstraint, ThroughputConstraint, UtilizationConstraint

public abstract class Constraint extends Object
Abstract base for line-opt constraints. Each constraint computes a non-negative violation amount (0 if satisfied) given an EvaluationResult and the current variable values. Mirrors native-Python line_solver.opt.objectives.Constraint.
  • Field Details

    • name

      protected final String name
  • Constructor Details

    • Constraint

      protected Constraint(String name)
  • Method Details

    • getName

      public String getName()
    • generateName

      protected abstract String generateName()
    • evaluate

      public abstract double evaluate(EvaluationResult result, Map<String,Object> variableValues)
      Violation amount: 0 if satisfied, positive if violated.
    • isSatisfied

      public boolean isSatisfied(EvaluationResult result, Map<String,Object> variableValues, double tolerance)
    • upperBoundViolation

      protected static double upperBoundViolation(double actual, double bound)
      Violation for an upper-bound constraint (actual <= bound). A non-finite metric signals divergence and is reported as strongly infeasible (+inf), mirroring the native guard that avoids NaN silently satisfying bounds.
    • lowerBoundViolation

      protected static double lowerBoundViolation(double actual, double bound)
      Violation for a lower-bound constraint (actual >= bound).