Package org.tweetyproject.math.term
Class AssociativeOperation
java.lang.Object
org.tweetyproject.math.term.Term
org.tweetyproject.math.term.AssociativeOperation
-
Constructor Summary
ConstructorDescriptionCreates a new (empty) operation.AssociativeOperation
(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 TypeMethodDescriptionvoid
addAllTerm
(Collection<Term> terms) Adds all the given terms of this operation.void
Adds the given term to this operation.void
This method collapses all associative operations appearing in this term, e.g.Returns all absolute values of this term.Returns all maximums of this term.Returns all minimums of this term.Returns all products of this term.getSums()
Returns all sums of this term.getTerms()
Returns the terms of this operation.Returns all variables in this term.boolean
Checks whether this term represents an integer value.void
removeTerm
(Term t) Removes the given term from this operation.int
size()
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 Details
-
AssociativeOperation
public AssociativeOperation()Creates a new (empty) operation. -
AssociativeOperation
Creates a new operation with the given terms.- Parameters:
first
- a term.second
- a term.
-
AssociativeOperation
Creates a new operation with the given list of terms.- Parameters:
terms
- a list of terms.
-
-
Method Details
-
size
public int size()Returns the number of the terms in this operation.- Returns:
- the number of the terms in this operation.
-
getTerms
Returns the terms of this operation. -
addTerm
Adds the given term to this operation.- Parameters:
t
- a term.
-
addAllTerm
Adds all the given terms of this operation.- Parameters:
terms
- a collection of terms.
-
removeTerm
Removes the given term from this operation.- Parameters:
t
- a term.
-
isInteger
public boolean isInteger()Description copied from class:Term
Checks whether this term represents an integer value. -
getVariables
Description copied from class:Term
Returns all variables in this term.- Specified by:
getVariables
in classTerm
- Returns:
- all variables in this term.
-
getProducts
Description copied from class:Term
Returns all products of this term.- Specified by:
getProducts
in classTerm
- Returns:
- all products of this term.
-
getSums
Description copied from class:Term
Returns all sums of this term. -
getMinimums
Description copied from class:Term
Returns all minimums of this term.- Specified by:
getMinimums
in classTerm
- Returns:
- all minimums of this term.
-
getMaximums
Description copied from class:Term
Returns all maximums of this term.- Specified by:
getMaximums
in classTerm
- Returns:
- all maximums of this term.
-
getAbsoluteValues
Description copied from class:Term
Returns all absolute values of this term.- Specified by:
getAbsoluteValues
in classTerm
- Returns:
- all absolute values of this term.
-
collapseAssociativeOperations
public void collapseAssociativeOperations()Description copied from class:Term
This method collapses all associative operations appearing in this term, e.g. every min{min{a,b},c} becomes min{a,b,c}.- Specified by:
collapseAssociativeOperations
in classTerm
-