Package net.sf.tweety.math.equation
Class Inequation
- java.lang.Object
-
- net.sf.tweety.math.equation.Statement
-
- net.sf.tweety.math.equation.Inequation
-
public class Inequation extends Statement
This class models an inequation of two terms.- Author:
- Matthias Thimm
-
-
Field Summary
Fields Modifier and Type Field Description static intGREATERstatic intGREATER_EQUALstatic intLESSstatic intLESS_EQUALprivate inttypestatic intUNEQUAL
-
Constructor Summary
Constructors Constructor Description Inequation(Term leftTerm, Term rightTerm, int type)Creates a new inequation of the given type with the two terms.
-
Method Summary
Modifier and Type Method Description java.lang.StringgetRelationSymbol()Returns the relation symbol of this statement.intgetType()Returns the type of this inequation.booleanisNormalized()Checks whether this constraint is of normalized form, i.e.StatementreplaceTerm(Term toSubstitute, Term substitution)Replaces each occurrence of "toSubstitute" by "substitution" and return the new statement.StatementtoLinearForm()Brings both terms into linear form.StatementtoNormalizedForm()Normalizes this constraint, i.e.-
Methods inherited from class net.sf.tweety.math.equation.Statement
collapseAssociativeOperations, expandAssociativeOperations, getAbsoluteValues, getLeftTerm, getMaximums, getMinimums, getRightTerm, replaceAllTerms, setLeftTerm, setRightTerm, toString
-
-
-
-
Field Detail
-
LESS
public static final int LESS
- See Also:
- Constant Field Values
-
LESS_EQUAL
public static final int LESS_EQUAL
- See Also:
- Constant Field Values
-
GREATER
public static final int GREATER
- See Also:
- Constant Field Values
-
GREATER_EQUAL
public static final int GREATER_EQUAL
- See Also:
- Constant Field Values
-
UNEQUAL
public static final int UNEQUAL
- See Also:
- Constant Field Values
-
type
private int type
-
-
Constructor Detail
-
Inequation
public Inequation(Term leftTerm, Term rightTerm, int type)
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 Detail
-
replaceTerm
public Statement replaceTerm(Term toSubstitute, Term substitution)
Description copied from class:StatementReplaces each occurrence of "toSubstitute" by "substitution" and return the new statement.- Specified by:
replaceTermin 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:StatementChecks 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:
isNormalizedin classStatement- Returns:
- "true" iff this constraint is normalized.
-
toNormalizedForm
public Statement toNormalizedForm()
Description copied from class:StatementNormalizes this constraint, i.e. brings it into an equivalent form "T > 0" or "T >= 0", "T = 0" or "T != 0".- Specified by:
toNormalizedFormin classStatement- Returns:
- a statement.
-
toLinearForm
public Statement toLinearForm()
Description copied from class:StatementBrings 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:
toLinearFormin classStatement- Returns:
- a statement.
-
getRelationSymbol
public java.lang.String getRelationSymbol()
Description copied from class:StatementReturns the relation symbol of this statement.- Specified by:
getRelationSymbolin classStatement- Returns:
- the relation symbol of this statement.
-
-