LinearConstraintSpec

@Serializable
data class LinearConstraintSpec(val coefficients: Map<String, Double>, val rhsValue: Double = 0.0, val inequalityType: InequalityType = InequalityType.LESS_THAN, val penaltyFunction: PenaltyFunctionSpec? = null)(source)

Serializable counterpart to ksl.simopt.problem.ProblemDefinition.linearConstraint.

A linear constraint over the decision variables: the dot product of the named coefficients with the corresponding decision-variable values is compared, via inequalityType, to rhsValue. Each key in coefficients must resolve to a declared OptimizationInputSpec in the enclosing problem; missing input names are treated as having coefficient 0 (matching engine semantics).

Domain invariants are enforced in init so that malformed constraints cannot be constructed. Cross-reference checks (coefficient keys must match declared decision-variable names) require the enclosing problem and remain the responsibility of OptimizationConfigurationValidator.

Constructors

Link copied to clipboard
constructor(coefficients: Map<String, Double>, rhsValue: Double = 0.0, inequalityType: InequalityType = InequalityType.LESS_THAN, penaltyFunction: PenaltyFunctionSpec? = null)

Properties

Link copied to clipboard

linear coefficients keyed by decision-variable name; must be non-empty, every key non-blank, every value finite

Link copied to clipboard

direction of the inequality

Link copied to clipboard

optional per-constraint penalty function overriding the problem-level default; null (the default) inherits OptimizationProblemSpec.defaultLinearPenalty

Link copied to clipboard

right-hand-side value; must be finite; defaults to 0.0