scpsolver.constraints
Interface Constraint

All Known Subinterfaces:
LinearConstraint, QuadraticConstraint, StochasticConstraint
All Known Implementing Classes:
LinearBiggerThanEqualsConstraint, LinearEqualsConstraint, LinearSmallerThanEqualsConstraint, QuadraticSmallerThanEqualsContraint, StochasticAbstractConstraint, StochasticBiggerThanEqualsConstraint, StochasticEqualsConstraint, StochasticSmallerThanEqualsConstraint

public interface Constraint

Basic format for a constraint of a constrained mathematical optimization problem.

The most common constraints are the LinearConstraints, valid for the LinearProgram problem description.

Author:
schober

Method Summary
 java.lang.String getName()
          Returns the name of a specific constraint.
 double getRHS()
          Returns the right hand side.
 boolean isSatisfiedBy(double[] x)
          Evaluates the constraint at input value x and checks if the constraint holds.
 

Method Detail

getName

java.lang.String getName()
Returns the name of a specific constraint.

When creating a new constraint for a problem, a name can be given to this constraint to identify it later and see, which specific constrains hold and maybe which contradict each other.

Please note: unlike Problem, where the name describes the type of problem instead of the actual instance, here the name the describes the actual instance and not the generic type.

Returns:
the name of the given constraint

isSatisfiedBy

boolean isSatisfiedBy(double[] x)
Evaluates the constraint at input value x and checks if the constraint holds. Returns true if input x satisfies the constraint, false otherwise. The input dimension (i.e. the array.length), must be the same as the target function.

Parameters:
x - the position, where the constraint is to be evaluated
Returns:
true if input value x satisfies this constraint, false otherwise

getRHS

double getRHS()
Returns the right hand side.

Returns:
right hand side