public class SimpleDistanceConstraint extends BinaryConstraint
APSPSolver STP solve.annotation, autoRemovable, color, id, logger, masked, numIDs, scope| Constructor and Description |
|---|
SimpleDistanceConstraint() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addInterval(Bounds i)
Add an [lb,ub] interval between the two
TimePoints of this constraint. |
SimpleDistanceConstraint |
clone() |
boolean |
draw()
Draw a graphical representation of this constraint.
|
int |
getCounter()
Get the current constraint counter, expressing the number of [lb,ub] intervals added between the two
TimePoints
(including the active constraint). |
java.lang.String |
getEdgeLabel()
Every
Constraint should implement this method - its value is
what is drawn by the ConstraintNetwork rendering methods. |
long |
getMaximum()
Get the maximum time lag between the two
TimePoints involved in this constraint. |
long |
getMinimum()
Get the minimum time lag between the two
TimePoints involved in this constraint. |
SimpleDistanceConstraint |
invert()
|
boolean |
isEquivalent(Constraint c)
Method for assessing the "equivalence" between two constraints.
|
SimpleDistanceConstraint |
normalize()
Inverts the constraint if its lower bound is negative.
|
boolean |
removeInterval(Bounds i)
Remove an [lb,ub] interval between the two
TimePoints of this constraint. |
void |
setMaximum(long newVal)
Set the minimum time lag between the two
TimePoints involved in this constraint. |
void |
setMinimum(long newVal)
Set the minimum time lag between the two
TimePoints involved in this constraint. |
java.lang.String |
toString()
Get a String representation of this constraint.
|
getFrom, getTo, setFrom, setTogetAnnotation, getColor, getDescription, getID, getScope, isAutoRemovable, isMasked, isSkippableSolver, isUnary, mask, setAnnotation, setAutoRemovable, setColor, setScope, skipSolver, unmaskpublic java.lang.String toString()
toString in class BinaryConstraintpublic boolean draw()
public long getMinimum()
TimePoints involved in this constraint.TimePoints involved in this constraint.public void setMinimum(long newVal)
TimePoints involved in this constraint.newVal - The minimum time lag between the two TimePoints involved in this constraint.public long getMaximum()
TimePoints involved in this constraint.TimePoints involved in this constraint.public void setMaximum(long newVal)
TimePoints involved in this constraint.newVal - The minimum time lag between the two TimePoints involved in this constraint.public int getCounter()
TimePoints
(including the active constraint).TimePoints
(including the active constraint).public boolean addInterval(Bounds i)
TimePoints of this constraint.i - The interval to add.true if the interval was added, false if it is malformed.public boolean removeInterval(Bounds i)
TimePoints of this constraint.i - The interval to remove.true if the interval was removed, false if this was
an attempt to remove the active constraint.public java.lang.String getEdgeLabel()
ConstraintConstraint should implement this method - its value is
what is drawn by the ConstraintNetwork rendering methods.getEdgeLabel in class ConstraintString representation of the constraint to be used for
ConstraintNetwork rendering.public SimpleDistanceConstraint clone()
clone in class Constraintpublic final SimpleDistanceConstraint normalize()
minimum and maximum values are negative.
If this becomes possible in the future, this function will have little use.
(Since all constraint can't necessarily be expressed with positive bounds then.)public final SimpleDistanceConstraint invert()
minimum and maximum bounds accordingly.public boolean isEquivalent(Constraint c)
ConstraintisEquivalent in class Constraintc - The Constraint to compare against.true iff the two constraints are considered to be equivalent.