Package org.oristool.math.expression
Class ExponentialTerm
java.lang.Object
org.oristool.math.expression.ExponentialTerm
- All Implemented Interfaces:
AtomicTerm
An atomic term of the form
exp(-lambda * x)
.-
Constructor Summary
ConstructorDescriptionExponentialTerm
(Variable variable, BigDecimal lambda) Builds an instance for a given variable and rate. -
Method Summary
Modifier and TypeMethodDescriptionDuplicates an atomic term.boolean
evaluate
(OmegaBigDecimal value) Evaluates the atomic term substituting value to its variable.Returns the variable associated with the atomic term.int
hashCode()
boolean
isOne()
Checks if this term the constant 1.void
multiply
(AtomicTerm term) Multiplies with another term.void
setLambda
(BigDecimal lambda) void
setVariable
(Variable variable) void
substitute
(Variable oldVar, Variable newVar) Substitutes oldVar with newVar in the atomic term.toString()
-
Constructor Details
-
ExponentialTerm
Builds an instance for a given variable and rate.- Parameters:
variable
- variable of the exponential termlambda
- rate (before the negation)
-
-
Method Details
-
getVariable
Description copied from interface:AtomicTerm
Returns the variable associated with the atomic term.- Specified by:
getVariable
in interfaceAtomicTerm
- Returns:
- the associated variable
-
setVariable
-
getLambda
-
setLambda
-
multiply
Description copied from interface:AtomicTerm
Multiplies with another term.- Specified by:
multiply
in interfaceAtomicTerm
- Parameters:
term
- to be multiplied
-
duplicate
Description copied from interface:AtomicTerm
Duplicates an atomic term.- Specified by:
duplicate
in interfaceAtomicTerm
- Returns:
- a copy of this term
-
isOne
public boolean isOne()Description copied from interface:AtomicTerm
Checks if this term the constant 1.- Specified by:
isOne
in interfaceAtomicTerm
- Returns:
- true if the term is one, false otherwise
-
evaluate
Description copied from interface:AtomicTerm
Evaluates the atomic term substituting value to its variable.- Specified by:
evaluate
in interfaceAtomicTerm
- Parameters:
value
- the value to be substituted tox
- Returns:
- the result of the evaluation
-
substitute
Description copied from interface:AtomicTerm
Substitutes oldVar with newVar in the atomic term.- Specified by:
substitute
in interfaceAtomicTerm
- Parameters:
oldVar
- variable to be substitutednewVar
- new variable
-
equals
-
hashCode
public int hashCode() -
toString
-