Package org.opt4j.core
Class Constraint
- java.lang.Object
-
- org.opt4j.core.Criterion
-
- org.opt4j.core.Constraint
-
- All Implemented Interfaces:
Comparable<Constraint>
- Direct Known Subclasses:
InfeasibilityConstraint
,SatisfactionConstraint
public abstract class Constraint extends Criterion implements Comparable<Constraint>
The
Constraint
is the identifier for a single constraint in theConstraints
. It is the superclass for concrete constraints. It is specified by the following properties:- Name
- Direction
- Limit
Each
Evaluator
sets a specific amount ofConstraint
-Value
pairs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Constraint.Direction
Defines the possible directions a constraint can be defined.
-
Field Summary
Fields Modifier and Type Field Description protected Constraint.Direction
direction
protected double
limit
-
Constructor Summary
Constructors Constructor Description Constraint(String name, Constraint.Direction direction, double limit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Constraint other)
Constraint.Direction
getDirection()
double
getLimit()
String
toString()
-
-
-
Field Detail
-
direction
protected final Constraint.Direction direction
-
limit
protected final double limit
-
-
Constructor Detail
-
Constraint
public Constraint(String name, Constraint.Direction direction, double limit)
-
-
Method Detail
-
getDirection
public Constraint.Direction getDirection()
- Returns:
- the direction
-
getLimit
public double getLimit()
- Returns:
- the limit
-
compareTo
public int compareTo(Constraint other)
- Specified by:
compareTo
in interfaceComparable<Constraint>
-
-