Package net.sf.tweety.math.term
Class Maximum
- java.lang.Object
-
- net.sf.tweety.math.term.Term
-
- net.sf.tweety.math.term.AssociativeOperation
-
- net.sf.tweety.math.term.Maximum
-
public class Maximum extends AssociativeOperation
This class models the maximum of two terms.- Author:
- Matthias Thimm
-
-
Method Summary
Modifier and Type Method Description Term
derive(Variable v)
Differentiates the term with respect to the given variable.void
expandAssociativeOperations()
This method expands all associative operations appearing in this term, e.g.java.util.Set<Maximum>
getMaximums()
Returns all maximums of this term.java.util.Set<Minimum>
getMinimums()
Returns all minimums of this term.boolean
isContinuous(Variable v)
Checks whether this term is continuous in v.Term
replaceTerm(Term toSubstitute, Term substitution)
Replaces each occurrence of "toSubstitute" by "substitution" and return the new term.Term
simplify()
Simplifies this term in an equivalent way:
- Replaces products that contain a zero by the constant zero
- Removes a term one from products
- Removes a term zero from sums
- Aggregates constants in sums, products, and minimums
- Evaluates functional terms on constants
- Simplifies fractions where possible.Sum
toLinearForm()
Converts this term into a linear normal form, i.e.java.lang.String
toString()
Constant
value()
Computes the actual value of this term if it contains no variables.-
Methods inherited from class net.sf.tweety.math.term.AssociativeOperation
addAllTerm, addTerm, collapseAssociativeOperations, getAbsoluteValues, getProducts, getTerms, getVariables, isInteger, removeTerm, size
-
Methods inherited from class net.sf.tweety.math.term.Term
add, doubleValue, evaluateMatrix, evaluateVector, evaluateVector, isContinuous, isLinear, min, minus, mult, replaceAllTerms, replaceAllTerms
-
-
-
-
Method Detail
-
value
public Constant value()
Description copied from class:Term
Computes the actual value of this term if it contains no variables.
-
replaceTerm
public Term replaceTerm(Term toSubstitute, Term substitution)
Description copied from class:Term
Replaces each occurrence of "toSubstitute" by "substitution" and return the new term.- Specified by:
replaceTerm
in classTerm
- Parameters:
toSubstitute
- the term to be substitutedsubstitution
- the new term- Returns:
- this term where "toSubstitute" is replaced by "substitution"
-
getMinimums
public java.util.Set<Minimum> getMinimums()
Description copied from class:Term
Returns all minimums of this term.- Overrides:
getMinimums
in classAssociativeOperation
- Returns:
- all minimums of this term.
-
getMaximums
public java.util.Set<Maximum> getMaximums()
Description copied from class:Term
Returns all maximums of this term.- Overrides:
getMaximums
in classAssociativeOperation
- Returns:
- all maximums of this term.
-
expandAssociativeOperations
public void expandAssociativeOperations()
Description copied from class:Term
This method expands all associative operations appearing in this term, e.g. every min{a,b,c} becomes min{min{a,b},c}.- Specified by:
expandAssociativeOperations
in classTerm
-
toLinearForm
public Sum toLinearForm() throws java.lang.IllegalArgumentException
Description copied from class:Term
Converts this term into a linear normal form, i.e. into a sum of products of a constant and a variable.- Specified by:
toLinearForm
in classTerm
- Returns:
- a term in linear normal form.
- Throws:
java.lang.IllegalArgumentException
- if this term cannot be converted into a linear normal form.
-
derive
public Term derive(Variable v) throws NonDifferentiableException
Description copied from class:Term
Differentiates the term with respect to the given variable.- Specified by:
derive
in classTerm
- Parameters:
v
- a variable.- Returns:
- the derivation of this term wrt. the given variable.
- Throws:
NonDifferentiableException
- if the term cannot be differentiated.
-
simplify
public Term simplify()
Description copied from class:Term
Simplifies this term in an equivalent way:
- Replaces products that contain a zero by the constant zero
- Removes a term one from products
- Removes a term zero from sums
- Aggregates constants in sums, products, and minimums
- Evaluates functional terms on constants
- Simplifies fractions where possible.
-
isContinuous
public boolean isContinuous(Variable v)
Description copied from class:Term
Checks whether this term is continuous in v.- Specified by:
isContinuous
in classTerm
- Parameters:
v
- a variable- Returns:
- "true" iff this term is continuous in v.
-
-