Package org.tweetyproject.math.term
Class AssociativeOperation
- java.lang.Object
-
- org.tweetyproject.math.term.Term
-
- org.tweetyproject.math.term.AssociativeOperation
-
-
Constructor Summary
Constructors Constructor Description AssociativeOperation()Creates a new (empty) operation.AssociativeOperation(java.util.Collection<? extends Term> terms)Creates a new operation with the given list of terms.AssociativeOperation(Term first, Term second)Creates a new operation with the given terms.
-
Method Summary
Modifier and Type Method Description voidaddAllTerm(java.util.Collection<Term> terms)Adds all the given terms of this operation.voidaddTerm(Term t)Adds the given term to this operation.voidcollapseAssociativeOperations()This method collapses all associative operations appearing in this term, e.g.java.util.Set<AbsoluteValue>getAbsoluteValues()Returns all absolute values of this term.java.util.Set<Maximum>getMaximums()Returns all maximums of this term.java.util.Set<Minimum>getMinimums()Returns all minimums of this term.java.util.Set<Product>getProducts()Returns all products of this term.java.util.Set<Sum>getSums()Returns all sums of this term.java.util.List<Term>getTerms()Returns the terms of this operation.java.util.Set<Variable>getVariables()Returns all variables in this term.booleanisInteger()Checks whether this term represents an integer value.voidremoveTerm(Term t)Removes the given term from this operation.intsize()Returns the number of the terms in this operation.-
Methods inherited from class org.tweetyproject.math.term.Term
add, derive, doubleValue, evaluateMatrix, evaluateVector, evaluateVector, expandAssociativeOperations, isContinuous, isContinuous, isLinear, isQuadratic, min, minus, mult, replaceAllTerms, replaceAllTerms, replaceTerm, simplify, toLinearForm, toQuadraticForm, toString, value
-
-
-
-
Constructor Detail
-
AssociativeOperation
public AssociativeOperation()
Creates a new (empty) operation.
-
AssociativeOperation
public AssociativeOperation(Term first, Term second)
Creates a new operation with the given terms.- Parameters:
first- a term.second- a term.
-
AssociativeOperation
public AssociativeOperation(java.util.Collection<? extends Term> terms)
Creates a new operation with the given list of terms.- Parameters:
terms- a list of terms.
-
-
Method Detail
-
size
public int size()
Returns the number of the terms in this operation.- Returns:
- the number of the terms in this operation.
-
getTerms
public java.util.List<Term> getTerms()
Returns the terms of this operation.
-
addTerm
public void addTerm(Term t)
Adds the given term to this operation.- Parameters:
t- a term.
-
addAllTerm
public void addAllTerm(java.util.Collection<Term> terms)
Adds all the given terms of this operation.- Parameters:
terms- a collection of terms.
-
removeTerm
public void removeTerm(Term t)
Removes the given term from this operation.- Parameters:
t- a term.
-
isInteger
public boolean isInteger()
Description copied from class:TermChecks whether this term represents an integer value.
-
getVariables
public java.util.Set<Variable> getVariables()
Description copied from class:TermReturns all variables in this term.- Specified by:
getVariablesin classTerm- Returns:
- all variables in this term.
-
getProducts
public java.util.Set<Product> getProducts()
Description copied from class:TermReturns all products of this term.- Specified by:
getProductsin classTerm- Returns:
- all products of this term.
-
getSums
public java.util.Set<Sum> getSums()
Description copied from class:TermReturns all sums of this term.
-
getMinimums
public java.util.Set<Minimum> getMinimums()
Description copied from class:TermReturns all minimums of this term.- Specified by:
getMinimumsin classTerm- Returns:
- all minimums of this term.
-
getMaximums
public java.util.Set<Maximum> getMaximums()
Description copied from class:TermReturns all maximums of this term.- Specified by:
getMaximumsin classTerm- Returns:
- all maximums of this term.
-
getAbsoluteValues
public java.util.Set<AbsoluteValue> getAbsoluteValues()
Description copied from class:TermReturns all absolute values of this term.- Specified by:
getAbsoluteValuesin classTerm- Returns:
- all absolute values of this term.
-
collapseAssociativeOperations
public void collapseAssociativeOperations()
Description copied from class:TermThis method collapses all associative operations appearing in this term, e.g. every min{min{a,b},c} becomes min{a,b,c}.- Specified by:
collapseAssociativeOperationsin classTerm
-
-