Package org.tweetyproject.math.equation
Class Inequation
java.lang.Object
org.tweetyproject.math.term.OptProbElement
org.tweetyproject.math.equation.Statement
org.tweetyproject.math.equation.Inequation
This class models an inequation of two terms.
- Author:
- Matthias Thimm
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
greaterstatic final int
greater or equalstatic final int
lessstatic final int
less or equalstatic final int
unequal -
Constructor Summary
ConstructorDescriptionInequation
(Term leftTerm, Term rightTerm, int type) Creates a new inequation of the given type with the two terms. -
Method Summary
Modifier and TypeMethodDescriptionReturns the relation symbol of this statement.int
getType()
Returns the type of this inequation.boolean
Checks whether this constraint is of normalized form, i.e.boolean
checks if a Statement fulfills the relationreplaceTerm
(Term toSubstitute, Term substitution) Replaces each occurrence of "toSubstitute" by "substitution" and return the new statement.Brings both terms into linear form.Normalizes this constraint, i.e.Methods inherited from class org.tweetyproject.math.equation.Statement
collapseAssociativeOperations, expandAssociativeOperations, getAbsoluteValues, getLeftTerm, getMaximums, getMinimums, getRightTerm, replaceAllTerms, setLeftTerm, setRightTerm, toString
-
Field Details
-
LESS
public static final int LESSless- See Also:
-
LESS_EQUAL
public static final int LESS_EQUALless or equal- See Also:
-
GREATER
public static final int GREATERgreater- See Also:
-
GREATER_EQUAL
public static final int GREATER_EQUALgreater or equal- See Also:
-
UNEQUAL
public static final int UNEQUALunequal- See Also:
-
-
Constructor Details
-
Inequation
Creates a new inequation of the given type with the two terms.- Parameters:
leftTerm
- a term.rightTerm
- a term.type
- the type of the inequality, one of Inequation.LESS, Inequation.LESS_EQUAL Inequation.GREATER, Inequation.GREATER_EQUAL, Inequation.UNEQUAL.
-
-
Method Details
-
replaceTerm
Description copied from class:Statement
Replaces each occurrence of "toSubstitute" by "substitution" and return the new statement.- Specified by:
replaceTerm
in classStatement
- Parameters:
toSubstitute
- the term to be substitutedsubstitution
- the new term- Returns:
- this statement where "toSubstitute" is replaced by "substitution"
-
getType
public int getType()Returns the type of this inequation.- Returns:
- the type of this inequation.
-
isNormalized
public boolean isNormalized()Description copied from class:Statement
Checks whether this constraint is of normalized form, i.e. whether it has the form "T > 0" or "T >= 0", "T = 0" or "T != 0"- Specified by:
isNormalized
in classStatement
- Returns:
- "true" iff this constraint is normalized.
-
toNormalizedForm
Description copied from class:Statement
Normalizes this constraint, i.e. brings it into an equivalent form "T > 0" or "T >= 0", "T = 0" or "T != 0".- Specified by:
toNormalizedForm
in classStatement
- Returns:
- a statement.
-
toLinearForm
Description copied from class:Statement
Brings both terms into linear form. If this constraint is normalized (i.e. the right term consists of the constant 0) the right term is not linearized.- Specified by:
toLinearForm
in classStatement
- Returns:
- a statement.
-
getRelationSymbol
Description copied from class:Statement
Returns the relation symbol of this statement.- Specified by:
getRelationSymbol
in classStatement
- Returns:
- the relation symbol of this statement.
-
isValid
Description copied from class:Statement
checks if a Statement fulfills the relation
-