ResponseConstraint

class ResponseConstraint(val responseName: String, val rhsValue: Double, val inequalityType: InequalityType = InequalityType.LESS_THAN, val target: Double = 0.0, val tolerance: Double = 0.0)

A response constraint represents a general constraint of the form ER(x)< b or ER(x) b where R(x) is some response from the model that is a function of the model inputs.

Parameters

responseName

the name of the response in the model

rhsValue

the right-hand side value

inequalityType

the type of inequality (less-than or greater-than)

target

the constraint's target. A parameter often used by solver methods that behaves as a cut-off point between desirable and unacceptable systems

tolerance

the constraint's tolerance. A parameter often used by solver methods that specifies how much we are willing to be off from the target. Similar to an indifference parameter.

Constructors

Link copied to clipboard
constructor(responseName: String, rhsValue: Double, inequalityType: InequalityType = InequalityType.LESS_THAN, target: Double = 0.0, tolerance: Double = 0.0)

Properties

Link copied to clipboard

If supplied will be used to estimate if the constraint is satisfied.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val target: Double = 0.0
Link copied to clipboard
Link copied to clipboard
val tolerance: Double = 0.0
Link copied to clipboard

Functions

Link copied to clipboard
fun difference(responseValue: Double): Double

The difference between the response and the right-hand side of the constraint adjusted to ensure a less-than interpretation. If R(x) is the estimated response value, then for a less-than constraint, where ER(x)< b, then the difference is R(x) - b. This difference is useful when constructing confidence intervals.

Link copied to clipboard
fun oneSidedUpperResponseInterval(estimatedResponse: EstimatedResponse, confidenceLevel: Double): Interval

Computes a one-sided upper confidence interval for the response constraint to test if the interval contains zero. The interval is based on the estimated difference between the value of the response and the right-hand side constraint value. If the constraint has form ER(x)< b, then if ER(x) - b < 0, the constraint is satisfied. If R is an estimated value of ER(x), then the difference estimate is D = R - b. The computed confidence interval is a one-sided upper confidence interval on the difference. If the interval contains 0, then we do not have enough evidence to conclude that the constraint is satisfied.

Link copied to clipboard
fun slack(responseValue: Double): Double

The "slack" is the gap between the response and the right-hand side of the constraint adjusted to ensure a less-than interpretation. If R(x) is the estimated response value, then for a less-than constraint, where ER(x)< b, then the slack is b-R(x). Essentially, the slack is (b-R(x)) adjusted for the direction of the constraint.

Link copied to clipboard
fun testFeasibility(estimatedResponse: EstimatedResponse, confidenceLevel: Double): Boolean

Returns true if the implied test of feasibility indicates that the constraint is satisfied. If the user supplied a FeasibilityCheckerIfc instance for the property feasibilityChecker, it is used to check for feasibility; otherwise, the function uses the function oneSidedUpperResponseInterval() to construct a one-sided upper confidence interval for the constraint and uses the interval to check for feasibility.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun violation(responseValue: Double): Double

The violation is maxOf(0, R(x) - b). This quantity is often used in penalty function calculations.