scpsolver.constraints
Class StochasticAbstractConstraint
java.lang.Object
scpsolver.constraints.StochasticAbstractConstraint
- All Implemented Interfaces:
- Constraint, StochasticConstraint
- Direct Known Subclasses:
- StochasticBiggerThanEqualsConstraint, StochasticEqualsConstraint, StochasticSmallerThanEqualsConstraint
public abstract class StochasticAbstractConstraint
- extends java.lang.Object
- implements StochasticConstraint
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
w
protected SparseVector w
t
protected SparseVector[] t
h
protected double[] h
name
protected java.lang.String name
StochasticAbstractConstraint
protected StochasticAbstractConstraint(SparseVector[] t,
SparseVector c,
double[] h,
java.lang.String name)
StochasticAbstractConstraint
protected StochasticAbstractConstraint(double[][] t,
double[] pc,
double[] h,
java.lang.String name)
getC
public double[] getC()
- Specified by:
getC
in interface StochasticConstraint
getCSparse
public SparseVector getCSparse()
- Specified by:
getCSparse
in interface StochasticConstraint
getExtensiveForm
public abstract LinearConstraint[] getExtensiveForm()
- Specified by:
getExtensiveForm
in interface StochasticConstraint
getH
public double[] getH()
- Specified by:
getH
in interface StochasticConstraint
getT
public double[][] getT()
- Specified by:
getT
in interface StochasticConstraint
getTSparse
public SparseVector[] getTSparse()
- Specified by:
getTSparse
in interface StochasticConstraint
getName
public java.lang.String getName()
- Description copied from interface:
Constraint
- 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.
- Specified by:
getName
in interface Constraint
- Returns:
- the name of the given constraint
isSatisfiedBy
public abstract boolean isSatisfiedBy(double[] x)
- Description copied from interface:
Constraint
- 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.
- Specified by:
isSatisfiedBy
in interface Constraint
- Parameters:
x
- the position, where the constraint is to be evaluated
- Returns:
true
if input value x
satisfies this constraint,
false
otherwise
getRHS
public double getRHS()
- Description copied from interface:
Constraint
- Returns the right hand side.
- Specified by:
getRHS
in interface Constraint
- Returns:
- right hand side